[MINOR] Fix windows EOL
Project: http://git-wip-us.apache.org/repos/asf/incubator-eagle/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-eagle/commit/76fc4410 Tree: http://git-wip-us.apache.org/repos/asf/incubator-eagle/tree/76fc4410 Diff: http://git-wip-us.apache.org/repos/asf/incubator-eagle/diff/76fc4410 Branch: refs/heads/master Commit: 76fc4410bbfcddc4757eeb6ebabaa8baf658036a Parents: 2479d32 Author: Hao Chen <h...@apache.org> Authored: Tue Oct 18 17:59:55 2016 +0800 Committer: Hao Chen <h...@apache.org> Committed: Tue Oct 18 17:59:55 2016 +0800 ---------------------------------------------------------------------- .../eagle/service/hbase/EmbeddedHbaseTest.java | 50 ++--- .../store/jdbc/JDBCDataSourceProviderTest.java | 148 ++++++------- .../jdbc/JDBCMetadataQueryServiceTest.java | 72 +++---- eagle-dev/ci-log4j.properties | 42 ++-- .../jpm/mr/history/MRHistoryJobApplication.java | 142 ++++++------- ....history.MRHistoryJobApplicationProvider.xml | 206 +++++++++---------- .../audit/JDBCSecurityMetadataDAOTest.java | 138 ++++++------- 7 files changed, 399 insertions(+), 399 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/76fc4410/eagle-core/eagle-embed/eagle-embed-hbase/src/test/java/org/apache/eagle/service/hbase/EmbeddedHbaseTest.java ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-embed/eagle-embed-hbase/src/test/java/org/apache/eagle/service/hbase/EmbeddedHbaseTest.java b/eagle-core/eagle-embed/eagle-embed-hbase/src/test/java/org/apache/eagle/service/hbase/EmbeddedHbaseTest.java index 0330eee..e65f062 100644 --- a/eagle-core/eagle-embed/eagle-embed-hbase/src/test/java/org/apache/eagle/service/hbase/EmbeddedHbaseTest.java +++ b/eagle-core/eagle-embed/eagle-embed-hbase/src/test/java/org/apache/eagle/service/hbase/EmbeddedHbaseTest.java @@ -1,26 +1,26 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * <p/> - * http://www.apache.org/licenses/LICENSE-2.0 - * <p/> - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.eagle.service.hbase; - -import org.junit.Test; - -public class EmbeddedHbaseTest extends TestHBaseBase { - @Test - public void testHBaseCreateTable() { - // hbase.createTable("test_hbase_table","f"); - } +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * <p/> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p/> + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.eagle.service.hbase; + +import org.junit.Test; + +public class EmbeddedHbaseTest extends TestHBaseBase { + @Test + public void testHBaseCreateTable() { + // hbase.createTable("test_hbase_table","f"); + } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/76fc4410/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/test/java/org/apache/eagle/metadata/store/jdbc/JDBCDataSourceProviderTest.java ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/test/java/org/apache/eagle/metadata/store/jdbc/JDBCDataSourceProviderTest.java b/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/test/java/org/apache/eagle/metadata/store/jdbc/JDBCDataSourceProviderTest.java index 545ade4..1af1839 100644 --- a/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/test/java/org/apache/eagle/metadata/store/jdbc/JDBCDataSourceProviderTest.java +++ b/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/test/java/org/apache/eagle/metadata/store/jdbc/JDBCDataSourceProviderTest.java @@ -1,75 +1,75 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * <p/> - * http://www.apache.org/licenses/LICENSE-2.0 - * <p/> - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.eagle.metadata.store.jdbc; - -import com.google.inject.Inject; -import org.junit.Assert; -import org.junit.Test; - -import javax.sql.DataSource; -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; - -public class JDBCDataSourceProviderTest extends JDBCMetadataTestBase { - @Inject - private DataSource dataSource; - @Inject - private JDBCDataSourceConfig dataSourceConfig; - - @Test - public void testSingletonDataSource(){ - DataSource dataSource1 = injector().getInstance(DataSource.class); - DataSource dataSource2 = injector().getInstance(DataSource.class); - Assert.assertTrue("Should get datasource in singleton pattern",dataSource == dataSource1); - Assert.assertTrue("Should get datasource in singleton pattern",dataSource1 == dataSource2); - } - - @Test - public void testDataSourceConfig(){ - Assert.assertEquals("jdbc:h2:mem:test;INIT=RUNSCRIPT FROM './src/test/resources/init.sql'",dataSourceConfig.getUrl()); - Assert.assertEquals(null,dataSourceConfig.getUsername()); - Assert.assertEquals(null,dataSourceConfig.getPassword()); - Assert.assertEquals("encoding=UTF8;timeout=60",dataSourceConfig.getConnectionProperties()); - } - - @Test - public void testConnection() throws SQLException { - Connection connection = null; - Statement statement = null; - ResultSet resultSet = null; - try { - connection = dataSource.getConnection(); - Assert.assertNotNull(connection); - statement = connection.createStatement(); - resultSet = statement.executeQuery("SELECT 1"); - Assert.assertTrue(resultSet.next()); - Assert.assertEquals(1,resultSet.getInt(1)); - } catch (SQLException e) { - Assert.fail(e.getMessage()); - throw e; - } finally { - if(resultSet!=null) - resultSet.close(); - if(statement != null) - statement.close(); - if(connection!=null) - connection.close(); - } - } +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * <p/> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p/> + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.eagle.metadata.store.jdbc; + +import com.google.inject.Inject; +import org.junit.Assert; +import org.junit.Test; + +import javax.sql.DataSource; +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; + +public class JDBCDataSourceProviderTest extends JDBCMetadataTestBase { + @Inject + private DataSource dataSource; + @Inject + private JDBCDataSourceConfig dataSourceConfig; + + @Test + public void testSingletonDataSource(){ + DataSource dataSource1 = injector().getInstance(DataSource.class); + DataSource dataSource2 = injector().getInstance(DataSource.class); + Assert.assertTrue("Should get datasource in singleton pattern",dataSource == dataSource1); + Assert.assertTrue("Should get datasource in singleton pattern",dataSource1 == dataSource2); + } + + @Test + public void testDataSourceConfig(){ + Assert.assertEquals("jdbc:h2:mem:test;INIT=RUNSCRIPT FROM './src/test/resources/init.sql'",dataSourceConfig.getUrl()); + Assert.assertEquals(null,dataSourceConfig.getUsername()); + Assert.assertEquals(null,dataSourceConfig.getPassword()); + Assert.assertEquals("encoding=UTF8;timeout=60",dataSourceConfig.getConnectionProperties()); + } + + @Test + public void testConnection() throws SQLException { + Connection connection = null; + Statement statement = null; + ResultSet resultSet = null; + try { + connection = dataSource.getConnection(); + Assert.assertNotNull(connection); + statement = connection.createStatement(); + resultSet = statement.executeQuery("SELECT 1"); + Assert.assertTrue(resultSet.next()); + Assert.assertEquals(1,resultSet.getInt(1)); + } catch (SQLException e) { + Assert.fail(e.getMessage()); + throw e; + } finally { + if(resultSet!=null) + resultSet.close(); + if(statement != null) + statement.close(); + if(connection!=null) + connection.close(); + } + } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/76fc4410/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/test/java/org/apache/eagle/metadata/store/jdbc/JDBCMetadataQueryServiceTest.java ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/test/java/org/apache/eagle/metadata/store/jdbc/JDBCMetadataQueryServiceTest.java b/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/test/java/org/apache/eagle/metadata/store/jdbc/JDBCMetadataQueryServiceTest.java index 97a06ab..5d608c6 100644 --- a/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/test/java/org/apache/eagle/metadata/store/jdbc/JDBCMetadataQueryServiceTest.java +++ b/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/test/java/org/apache/eagle/metadata/store/jdbc/JDBCMetadataQueryServiceTest.java @@ -1,36 +1,36 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * <p/> - * http://www.apache.org/licenses/LICENSE-2.0 - * <p/> - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.eagle.metadata.store.jdbc; - -import org.junit.Assert; -import org.junit.Test; - -import javax.inject.Inject; -import java.sql.SQLException; -import java.util.List; - -public class JDBCMetadataQueryServiceTest extends JDBCMetadataTestBase { - @Inject - JDBCMetadataQueryService queryService; - - @Test - public void testQuery() throws SQLException { - List<Integer> result = queryService.query("SELECT 7",(resultSet) -> resultSet.getInt(1)); - Assert.assertEquals(1,result.size()); - Assert.assertEquals(7,result.get(0).intValue()); - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * <p/> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p/> + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.eagle.metadata.store.jdbc; + +import org.junit.Assert; +import org.junit.Test; + +import javax.inject.Inject; +import java.sql.SQLException; +import java.util.List; + +public class JDBCMetadataQueryServiceTest extends JDBCMetadataTestBase { + @Inject + JDBCMetadataQueryService queryService; + + @Test + public void testQuery() throws SQLException { + List<Integer> result = queryService.query("SELECT 7",(resultSet) -> resultSet.getInt(1)); + Assert.assertEquals(1,result.size()); + Assert.assertEquals(7,result.get(0).intValue()); + } +} http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/76fc4410/eagle-dev/ci-log4j.properties ---------------------------------------------------------------------- diff --git a/eagle-dev/ci-log4j.properties b/eagle-dev/ci-log4j.properties index a01759a..2ee78e3 100644 --- a/eagle-dev/ci-log4j.properties +++ b/eagle-dev/ci-log4j.properties @@ -1,22 +1,22 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -log4j.debug=false - -log4j.rootLogger=OFF, console - -log4j.appender.console=org.apache.log4j.ConsoleAppender -log4j.appender.console.layout=org.apache.log4j.PatternLayout +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +log4j.debug=false + +log4j.rootLogger=OFF, console + +log4j.appender.console=org.apache.log4j.ConsoleAppender +log4j.appender.console.layout=org.apache.log4j.PatternLayout log4j.appender.console.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/76fc4410/eagle-jpm/eagle-jpm-mr-history/src/main/java/org/apache/eagle/jpm/mr/history/MRHistoryJobApplication.java ---------------------------------------------------------------------- diff --git a/eagle-jpm/eagle-jpm-mr-history/src/main/java/org/apache/eagle/jpm/mr/history/MRHistoryJobApplication.java b/eagle-jpm/eagle-jpm-mr-history/src/main/java/org/apache/eagle/jpm/mr/history/MRHistoryJobApplication.java index de35678..e33fc02 100644 --- a/eagle-jpm/eagle-jpm-mr-history/src/main/java/org/apache/eagle/jpm/mr/history/MRHistoryJobApplication.java +++ b/eagle-jpm/eagle-jpm-mr-history/src/main/java/org/apache/eagle/jpm/mr/history/MRHistoryJobApplication.java @@ -1,71 +1,71 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * <p/> - * http://www.apache.org/licenses/LICENSE-2.0 - * <p/> - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.eagle.jpm.mr.history; - -import org.apache.eagle.app.StormApplication; -import org.apache.eagle.app.environment.impl.StormEnvironment; -import org.apache.eagle.jpm.mr.history.crawler.JobHistoryContentFilter; -import org.apache.eagle.jpm.mr.history.crawler.JobHistoryContentFilterBuilder; -import org.apache.eagle.jpm.mr.history.storm.JobHistorySpout; -import org.apache.eagle.jpm.util.Constants; - -import backtype.storm.generated.StormTopology; -import backtype.storm.topology.TopologyBuilder; -import com.typesafe.config.Config; - -import java.util.ArrayList; -import java.util.List; -import java.util.regex.Pattern; - -public class MRHistoryJobApplication extends StormApplication { - @Override - public StormTopology execute(Config config, StormEnvironment environment) { - //1. trigger init conf - MRHistoryJobConfig appConfig = MRHistoryJobConfig.getInstance(config); - com.typesafe.config.Config jhfAppConf = appConfig.getConfig(); - - //2. init JobHistoryContentFilter - final JobHistoryContentFilterBuilder builder = JobHistoryContentFilterBuilder.newBuilder().acceptJobFile().acceptJobConfFile(); - String[] confKeyPatternsSplit = jhfAppConf.getString("MRConfigureKeys.jobConfigKey").split(","); - List<String> confKeyPatterns = new ArrayList<>(confKeyPatternsSplit.length); - for (String confKeyPattern : confKeyPatternsSplit) { - confKeyPatterns.add(confKeyPattern.trim()); - } - confKeyPatterns.add(Constants.JobConfiguration.CASCADING_JOB); - confKeyPatterns.add(Constants.JobConfiguration.HIVE_JOB); - confKeyPatterns.add(Constants.JobConfiguration.PIG_JOB); - confKeyPatterns.add(Constants.JobConfiguration.SCOOBI_JOB); - - String jobNameKey = jhfAppConf.getString("MRConfigureKeys.jobNameKey"); - builder.setJobNameKey(jobNameKey); - - for (String key : confKeyPatterns) { - builder.includeJobKeyPatterns(Pattern.compile(key)); - } - JobHistoryContentFilter filter = builder.build(); - //3. init topology - TopologyBuilder topologyBuilder = new TopologyBuilder(); - String spoutName = "mrHistoryJobSpout"; - int tasks = jhfAppConf.getInt("stormConfig.mrHistoryJobSpoutTasks"); - topologyBuilder.setSpout( - spoutName, - new JobHistorySpout(filter, config), - tasks - ).setNumTasks(tasks); - return topologyBuilder.createTopology(); - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * <p/> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p/> + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.eagle.jpm.mr.history; + +import org.apache.eagle.app.StormApplication; +import org.apache.eagle.app.environment.impl.StormEnvironment; +import org.apache.eagle.jpm.mr.history.crawler.JobHistoryContentFilter; +import org.apache.eagle.jpm.mr.history.crawler.JobHistoryContentFilterBuilder; +import org.apache.eagle.jpm.mr.history.storm.JobHistorySpout; +import org.apache.eagle.jpm.util.Constants; + +import backtype.storm.generated.StormTopology; +import backtype.storm.topology.TopologyBuilder; +import com.typesafe.config.Config; + +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Pattern; + +public class MRHistoryJobApplication extends StormApplication { + @Override + public StormTopology execute(Config config, StormEnvironment environment) { + //1. trigger init conf + MRHistoryJobConfig appConfig = MRHistoryJobConfig.getInstance(config); + com.typesafe.config.Config jhfAppConf = appConfig.getConfig(); + + //2. init JobHistoryContentFilter + final JobHistoryContentFilterBuilder builder = JobHistoryContentFilterBuilder.newBuilder().acceptJobFile().acceptJobConfFile(); + String[] confKeyPatternsSplit = jhfAppConf.getString("MRConfigureKeys.jobConfigKey").split(","); + List<String> confKeyPatterns = new ArrayList<>(confKeyPatternsSplit.length); + for (String confKeyPattern : confKeyPatternsSplit) { + confKeyPatterns.add(confKeyPattern.trim()); + } + confKeyPatterns.add(Constants.JobConfiguration.CASCADING_JOB); + confKeyPatterns.add(Constants.JobConfiguration.HIVE_JOB); + confKeyPatterns.add(Constants.JobConfiguration.PIG_JOB); + confKeyPatterns.add(Constants.JobConfiguration.SCOOBI_JOB); + + String jobNameKey = jhfAppConf.getString("MRConfigureKeys.jobNameKey"); + builder.setJobNameKey(jobNameKey); + + for (String key : confKeyPatterns) { + builder.includeJobKeyPatterns(Pattern.compile(key)); + } + JobHistoryContentFilter filter = builder.build(); + //3. init topology + TopologyBuilder topologyBuilder = new TopologyBuilder(); + String spoutName = "mrHistoryJobSpout"; + int tasks = jhfAppConf.getInt("stormConfig.mrHistoryJobSpoutTasks"); + topologyBuilder.setSpout( + spoutName, + new JobHistorySpout(filter, config), + tasks + ).setNumTasks(tasks); + return topologyBuilder.createTopology(); + } +} http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/76fc4410/eagle-jpm/eagle-jpm-mr-history/src/main/resources/META-INF/providers/org.apache.eagle.jpm.mr.history.MRHistoryJobApplicationProvider.xml ---------------------------------------------------------------------- diff --git a/eagle-jpm/eagle-jpm-mr-history/src/main/resources/META-INF/providers/org.apache.eagle.jpm.mr.history.MRHistoryJobApplicationProvider.xml b/eagle-jpm/eagle-jpm-mr-history/src/main/resources/META-INF/providers/org.apache.eagle.jpm.mr.history.MRHistoryJobApplicationProvider.xml index 42f3167..77a3709 100644 --- a/eagle-jpm/eagle-jpm-mr-history/src/main/resources/META-INF/providers/org.apache.eagle.jpm.mr.history.MRHistoryJobApplicationProvider.xml +++ b/eagle-jpm/eagle-jpm-mr-history/src/main/resources/META-INF/providers/org.apache.eagle.jpm.mr.history.MRHistoryJobApplicationProvider.xml @@ -1,104 +1,104 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one or more - ~ contributor license agreements. See the NOTICE file distributed with - ~ this work for additional information regarding copyright ownership. - ~ The ASF licenses this file to You under the Apache License, Version 2.0 - ~ (the "License"); you may not use this file except in compliance with - ~ the License. You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, software - ~ distributed under the License is distributed on an "AS IS" BASIS, - ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - ~ See the License for the specific language governing permissions and - ~ limitations under the License. - --> - -<application> - <type>MR_HISTORY_JOB_APP</type> - <name>Map Reduce History Job Monitoring</name> - <version>0.5.0-incubating</version> - <configuration> - <!-- org.apache.eagle.jpm.mr.history.MRHistoryJobConfig --> - <property> - <name>workers</name> - <displayName>Worker Number</displayName> - <description>the number of storm workers will be used</description> - <value>4</value> - </property> - <property> - <name>stormConfig.mrHistoryJobSpoutTasks</name> - <displayName>Read Task Number</displayName> - <description>the number tasks of the spout will be assigned</description> - <value>4</value> - </property> - - <property> - <name>zookeeper.zkRoot</name> - <displayName>Zookeeper Root Path</displayName> - <description>zkRoot that used to save context for this application</description> - <value>/mrjobhistory_sandbox</value> - <required>true</required> - </property> - - <property> - <name>endpointConfig.timeZone</name> - <displayName>Time Zone</displayName> - <description>which time zone do hdfs data nodes locate in</description> - <value>Etc/GMT+7</value> - <required>true</required> - </property> - <property> - <name>endpointConfig.mrHistoryServerUrl</name> - <displayName>Map Reduce History Server</displayName> - <description>map reduce history server url address</description> - <value>http://sandbox.hortonworks.com:19888</value> - <required>true</required> - </property> - <property> - <name>endpointConfig.basePath</name> - <displayName>Map Reduce History Log File Path</displayName> - <description>which directory do map reduce history job files locate in</description> - <value>/mr-history/done</value> - <required>true</required> - </property> - <property> - <name>endpointConfig.hdfs.fs.defaultFS</name> - <displayName>HDFS Address</displayName> - <description>The name of the default file system. Either the literal string "local" or a host:port for NDFS</description> - <value>hdfs://sandbox.hortonworks.com:8020</value> - <required>true</required> - </property> - - <property> - <name>MRConfigureKeys.jobConfigKey</name> - <displayName>Map Reduce Extracted Configuration Keys</displayName> - <description>which configures will be extracted from map reduce job configurations</description> - <value>mapreduce.map.output.compress, - mapreduce.map.output.compress.codec, - mapreduce.output.fileoutputformat.compress, - mapreduce.output.fileoutputformat.compress.type, - mapreduce.output.fileoutputformat.compress.codec, - mapred.output.format.class, - dataplatform.etl.info, - mapreduce.map.memory.mb, - mapreduce.reduce.memory.mb, - mapreduce.map.java.opts, - mapreduce.reduce.java.opts</value> - </property> - <property> - <name>MRConfigureKeys.jobNameKey</name> - <displayName>Map Reduce Job Name Key</displayName> - <description>User use -Dkey=value to specify name of a job when submit. use this to extract job name from job configuration</description> - <value>eagle.job.name</value> - </property> - </configuration> - <docs> - <install> - </install> - <uninstall> - </uninstall> - </docs> +<?xml version="1.0" encoding="UTF-8" ?> +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one or more + ~ contributor license agreements. See the NOTICE file distributed with + ~ this work for additional information regarding copyright ownership. + ~ The ASF licenses this file to You under the Apache License, Version 2.0 + ~ (the "License"); you may not use this file except in compliance with + ~ the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> + +<application> + <type>MR_HISTORY_JOB_APP</type> + <name>Map Reduce History Job Monitoring</name> + <version>0.5.0-incubating</version> + <configuration> + <!-- org.apache.eagle.jpm.mr.history.MRHistoryJobConfig --> + <property> + <name>workers</name> + <displayName>Worker Number</displayName> + <description>the number of storm workers will be used</description> + <value>4</value> + </property> + <property> + <name>stormConfig.mrHistoryJobSpoutTasks</name> + <displayName>Read Task Number</displayName> + <description>the number tasks of the spout will be assigned</description> + <value>4</value> + </property> + + <property> + <name>zookeeper.zkRoot</name> + <displayName>Zookeeper Root Path</displayName> + <description>zkRoot that used to save context for this application</description> + <value>/mrjobhistory_sandbox</value> + <required>true</required> + </property> + + <property> + <name>endpointConfig.timeZone</name> + <displayName>Time Zone</displayName> + <description>which time zone do hdfs data nodes locate in</description> + <value>Etc/GMT+7</value> + <required>true</required> + </property> + <property> + <name>endpointConfig.mrHistoryServerUrl</name> + <displayName>Map Reduce History Server</displayName> + <description>map reduce history server url address</description> + <value>http://sandbox.hortonworks.com:19888</value> + <required>true</required> + </property> + <property> + <name>endpointConfig.basePath</name> + <displayName>Map Reduce History Log File Path</displayName> + <description>which directory do map reduce history job files locate in</description> + <value>/mr-history/done</value> + <required>true</required> + </property> + <property> + <name>endpointConfig.hdfs.fs.defaultFS</name> + <displayName>HDFS Address</displayName> + <description>The name of the default file system. Either the literal string "local" or a host:port for NDFS</description> + <value>hdfs://sandbox.hortonworks.com:8020</value> + <required>true</required> + </property> + + <property> + <name>MRConfigureKeys.jobConfigKey</name> + <displayName>Map Reduce Extracted Configuration Keys</displayName> + <description>which configures will be extracted from map reduce job configurations</description> + <value>mapreduce.map.output.compress, + mapreduce.map.output.compress.codec, + mapreduce.output.fileoutputformat.compress, + mapreduce.output.fileoutputformat.compress.type, + mapreduce.output.fileoutputformat.compress.codec, + mapred.output.format.class, + dataplatform.etl.info, + mapreduce.map.memory.mb, + mapreduce.reduce.memory.mb, + mapreduce.map.java.opts, + mapreduce.reduce.java.opts</value> + </property> + <property> + <name>MRConfigureKeys.jobNameKey</name> + <displayName>Map Reduce Job Name Key</displayName> + <description>User use -Dkey=value to specify name of a job when submit. use this to extract job name from job configuration</description> + <value>eagle.job.name</value> + </property> + </configuration> + <docs> + <install> + </install> + <uninstall> + </uninstall> + </docs> </application> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/76fc4410/eagle-security/eagle-security-common/src/test/java/org/apache/eagle/security/crawler/audit/JDBCSecurityMetadataDAOTest.java ---------------------------------------------------------------------- diff --git a/eagle-security/eagle-security-common/src/test/java/org/apache/eagle/security/crawler/audit/JDBCSecurityMetadataDAOTest.java b/eagle-security/eagle-security-common/src/test/java/org/apache/eagle/security/crawler/audit/JDBCSecurityMetadataDAOTest.java index 4cfe25e..03ae58c 100644 --- a/eagle-security/eagle-security-common/src/test/java/org/apache/eagle/security/crawler/audit/JDBCSecurityMetadataDAOTest.java +++ b/eagle-security/eagle-security-common/src/test/java/org/apache/eagle/security/crawler/audit/JDBCSecurityMetadataDAOTest.java @@ -1,69 +1,69 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * <p/> - * http://www.apache.org/licenses/LICENSE-2.0 - * <p/> - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.eagle.security.crawler.audit; - -import com.google.inject.Inject; -import org.apache.eagle.app.module.ApplicationGuiceModule; -import org.apache.eagle.common.module.CommonGuiceModule; -import org.apache.eagle.common.module.GuiceJUnitRunner; -import org.apache.eagle.common.module.Modules; -import org.apache.eagle.metadata.store.jdbc.JDBCMetadataQueryService; -import org.apache.eagle.metadata.store.jdbc.JDBCMetadataStore; -import org.apache.eagle.security.service.HBaseSensitivityEntity; -import org.apache.eagle.security.service.JDBCSecurityMetadataDAO; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; - -import java.sql.SQLException; -import java.util.Collection; -import java.util.Collections; - -@RunWith(GuiceJUnitRunner.class) -@Modules({ - JDBCMetadataStore.class, CommonGuiceModule.class, ApplicationGuiceModule.class -}) -public class JDBCSecurityMetadataDAOTest { - @Inject - private JDBCSecurityMetadataDAO metadataDAO; - - @Inject - private JDBCMetadataQueryService queryService; - - @Before - public void setUp() throws SQLException { - queryService.execute("create table hbase_sensitivity_entity (site varchar(20), hbase_resource varchar(100), sensitivity_type varchar(20), primary key (site, hbase_resource));"); - } - - @Test - public void testJDBCSecurityMetadataDAO(){ - HBaseSensitivityEntity entity = new HBaseSensitivityEntity(); - entity.setSite("test_site"); - entity.setHbaseResource("test_hbaseResource"); - metadataDAO.addHBaseSensitivity(Collections.singletonList(entity)); - Collection<HBaseSensitivityEntity> entities = metadataDAO.listHBaseSensitivities(); - Assert.assertEquals(1,entities.size()); - Assert.assertEquals("test_site",entities.iterator().next().getSite()); - } - - @After - public void after() throws SQLException { - queryService.dropTable("hbase_sensitivity_entity"); - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * <p/> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p/> + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.eagle.security.crawler.audit; + +import com.google.inject.Inject; +import org.apache.eagle.app.module.ApplicationGuiceModule; +import org.apache.eagle.common.module.CommonGuiceModule; +import org.apache.eagle.common.module.GuiceJUnitRunner; +import org.apache.eagle.common.module.Modules; +import org.apache.eagle.metadata.store.jdbc.JDBCMetadataQueryService; +import org.apache.eagle.metadata.store.jdbc.JDBCMetadataStore; +import org.apache.eagle.security.service.HBaseSensitivityEntity; +import org.apache.eagle.security.service.JDBCSecurityMetadataDAO; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; + +import java.sql.SQLException; +import java.util.Collection; +import java.util.Collections; + +@RunWith(GuiceJUnitRunner.class) +@Modules({ + JDBCMetadataStore.class, CommonGuiceModule.class, ApplicationGuiceModule.class +}) +public class JDBCSecurityMetadataDAOTest { + @Inject + private JDBCSecurityMetadataDAO metadataDAO; + + @Inject + private JDBCMetadataQueryService queryService; + + @Before + public void setUp() throws SQLException { + queryService.execute("create table hbase_sensitivity_entity (site varchar(20), hbase_resource varchar(100), sensitivity_type varchar(20), primary key (site, hbase_resource));"); + } + + @Test + public void testJDBCSecurityMetadataDAO(){ + HBaseSensitivityEntity entity = new HBaseSensitivityEntity(); + entity.setSite("test_site"); + entity.setHbaseResource("test_hbaseResource"); + metadataDAO.addHBaseSensitivity(Collections.singletonList(entity)); + Collection<HBaseSensitivityEntity> entities = metadataDAO.listHBaseSensitivities(); + Assert.assertEquals(1,entities.size()); + Assert.assertEquals("test_site",entities.iterator().next().getSite()); + } + + @After + public void after() throws SQLException { + queryService.dropTable("hbase_sensitivity_entity"); + } +}