You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pirk.apache.org by ea...@apache.org on 2016/08/18 22:48:10 UTC

incubator-pirk git commit: [PIRK-54]: Log Levels not Functioning, source formatting - closes apache/incubator-pirk#71

Repository: incubator-pirk
Updated Branches:
  refs/heads/master 204427848 -> e99d25013


[PIRK-54]: Log Levels not Functioning, source formatting - closes apache/incubator-pirk#71


Project: http://git-wip-us.apache.org/repos/asf/incubator-pirk/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-pirk/commit/e99d2501
Tree: http://git-wip-us.apache.org/repos/asf/incubator-pirk/tree/e99d2501
Diff: http://git-wip-us.apache.org/repos/asf/incubator-pirk/diff/e99d2501

Branch: refs/heads/master
Commit: e99d2501333b3db8ca1549fd9ed56701cc77d9d2
Parents: 2044278
Author: smarthi <sm...@apache.org>
Authored: Thu Aug 18 18:47:56 2016 -0400
Committer: eawilliams <ea...@apache.org>
Committed: Thu Aug 18 18:47:56 2016 -0400

----------------------------------------------------------------------
 .../apache/pirk/encryption/PrimeGenerator.java  |  2 +-
 .../wideskies/decrypt/DecryptResponse.java      |  7 +++---
 .../apache/pirk/query/wideskies/QueryUtils.java |  3 +--
 .../wideskies/common/ComputeEncryptedRow.java   |  4 ++--
 .../pirk/schema/data/DataSchemaLoader.java      | 21 +++++++++++------
 .../pirk/schema/query/QuerySchemaLoader.java    | 24 +++++++++++++-------
 .../apache/pirk/test/utils/StandaloneQuery.java |  4 ++--
 src/main/resources/log4j2.xml                   |  4 ++--
 .../apache/pirk/general/PartitionUtilsTest.java |  4 ++--
 9 files changed, 44 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-pirk/blob/e99d2501/src/main/java/org/apache/pirk/encryption/PrimeGenerator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/pirk/encryption/PrimeGenerator.java b/src/main/java/org/apache/pirk/encryption/PrimeGenerator.java
index d45cf56..8e82fc7 100644
--- a/src/main/java/org/apache/pirk/encryption/PrimeGenerator.java
+++ b/src/main/java/org/apache/pirk/encryption/PrimeGenerator.java
@@ -56,7 +56,7 @@ public class PrimeGenerator
   private static final Logger logger = LoggerFactory.getLogger(PrimeGenerator.class);
 
   private static final BigDecimal SQRT_2 = BigDecimal.valueOf(Math.sqrt(2));
-  
+
   private static final HashMap<Integer,BigInteger> lowerBoundCache = new HashMap<>();
   private static final HashMap<Integer,BigInteger> minimumDifferenceCache = new HashMap<>();
 

http://git-wip-us.apache.org/repos/asf/incubator-pirk/blob/e99d2501/src/main/java/org/apache/pirk/querier/wideskies/decrypt/DecryptResponse.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/pirk/querier/wideskies/decrypt/DecryptResponse.java b/src/main/java/org/apache/pirk/querier/wideskies/decrypt/DecryptResponse.java
index 97b93fd..972d157 100644
--- a/src/main/java/org/apache/pirk/querier/wideskies/decrypt/DecryptResponse.java
+++ b/src/main/java/org/apache/pirk/querier/wideskies/decrypt/DecryptResponse.java
@@ -51,7 +51,7 @@ import org.slf4j.LoggerFactory;
 public class DecryptResponse
 {
   private static final Logger logger = LoggerFactory.getLogger(DecryptResponse.class);
-  
+
   private static final BigInteger TWO_BI = BigInteger.valueOf(2);
 
   private final Response response;
@@ -141,7 +141,8 @@ public class DecryptResponse
       }
 
       // Create the runnable and execute
-      DecryptResponseRunnable<Map<String,List<QueryResponseJSON>>> runDec = new DecryptResponseRunnable<>(rElements, selectorsPartition, selectorMaskMap, queryInfo.clone(), embedSelectorMap);
+      DecryptResponseRunnable<Map<String,List<QueryResponseJSON>>> runDec = new DecryptResponseRunnable<>(rElements, selectorsPartition, selectorMaskMap,
+          queryInfo.clone(), embedSelectorMap);
       futures.add(es.submit(runDec));
     }
 
@@ -156,7 +157,7 @@ public class DecryptResponse
     {
       throw new PIRException("Exception in decryption threads.", e);
     }
-    
+
     es.shutdown();
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-pirk/blob/e99d2501/src/main/java/org/apache/pirk/query/wideskies/QueryUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/pirk/query/wideskies/QueryUtils.java b/src/main/java/org/apache/pirk/query/wideskies/QueryUtils.java
index 9e430d8..929056e 100644
--- a/src/main/java/org/apache/pirk/query/wideskies/QueryUtils.java
+++ b/src/main/java/org/apache/pirk/query/wideskies/QueryUtils.java
@@ -165,8 +165,7 @@ public class QueryUtils
   /**
    * Method to convert the given data element given by the MapWritable data element into the extracted BigInteger partitions based upon the given queryType
    */
-  public static List<BigInteger> partitionDataElement(MapWritable dataMap, QuerySchema qSchema, DataSchema dSchema, boolean embedSelector)
-      throws PIRException
+  public static List<BigInteger> partitionDataElement(MapWritable dataMap, QuerySchema qSchema, DataSchema dSchema, boolean embedSelector) throws PIRException
   {
     List<BigInteger> parts = new ArrayList<>();
 

http://git-wip-us.apache.org/repos/asf/incubator-pirk/blob/e99d2501/src/main/java/org/apache/pirk/responder/wideskies/common/ComputeEncryptedRow.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/pirk/responder/wideskies/common/ComputeEncryptedRow.java b/src/main/java/org/apache/pirk/responder/wideskies/common/ComputeEncryptedRow.java
index 2e58c0f..f65f1cb 100644
--- a/src/main/java/org/apache/pirk/responder/wideskies/common/ComputeEncryptedRow.java
+++ b/src/main/java/org/apache/pirk/responder/wideskies/common/ComputeEncryptedRow.java
@@ -234,8 +234,8 @@ public class ComputeEncryptedRow
    * Emits {@code Tuple2<<colNum, colVal>>}
    * 
    */
-  public static List<Tuple2<Long,BigInteger>> computeEncRowCacheInput(Iterable<List<BigInteger>> dataPartitionsIter,
-      HashMap<Integer,BigInteger> cache, int rowIndex, boolean limitHitsPerSelector, int maxHitsPerSelector) throws IOException
+  public static List<Tuple2<Long,BigInteger>> computeEncRowCacheInput(Iterable<List<BigInteger>> dataPartitionsIter, HashMap<Integer,BigInteger> cache,
+      int rowIndex, boolean limitHitsPerSelector, int maxHitsPerSelector) throws IOException
   {
     List<Tuple2<Long,BigInteger>> returnPairs = new ArrayList<>();
 

http://git-wip-us.apache.org/repos/asf/incubator-pirk/blob/e99d2501/src/main/java/org/apache/pirk/schema/data/DataSchemaLoader.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/pirk/schema/data/DataSchemaLoader.java b/src/main/java/org/apache/pirk/schema/data/DataSchemaLoader.java
index a51e7b6..2f210dc 100644
--- a/src/main/java/org/apache/pirk/schema/data/DataSchemaLoader.java
+++ b/src/main/java/org/apache/pirk/schema/data/DataSchemaLoader.java
@@ -93,7 +93,8 @@ public class DataSchemaLoader
   /**
    * Initializes the static {@link DataSchemaRegistry} with a list of available data schema names.
    * 
-   * @throws Exception - failed to initialize
+   * @throws Exception
+   *           - failed to initialize
    */
   public static void initialize() throws Exception
   {
@@ -108,7 +109,8 @@ public class DataSchemaLoader
    *          If true, specifies that the data schema is an hdfs file; if false, that it is a regular file.
    * @param fs
    *          Used only when {@code hdfs} is true; the {@link FileSystem} handle for the hdfs in which the data schema exists
-   * @throws Exception - failed to initialize
+   * @throws Exception
+   *           - failed to initialize
    */
   public static void initialize(boolean hdfs, FileSystem fs) throws Exception
   {
@@ -211,8 +213,10 @@ public class DataSchemaLoader
    * @param stream
    *          The input stream.
    * @return A {@link Document} representing the XML document.
-   * @throws IOException - Failed to read schema file
-   * @throws PIRException - Schema description is invalid
+   * @throws IOException
+   *           - Failed to read schema file
+   * @throws PIRException
+   *           - Schema description is invalid
    */
   private Document parseXMLDocument(InputStream stream) throws IOException, PIRException
   {
@@ -238,7 +242,8 @@ public class DataSchemaLoader
    *          A data schema element node.
    * @param schema
    *          The data schema
-   * @throws PIRException - Schema description is invalid
+   * @throws PIRException
+   *           - Schema description is invalid
    */
   private void extractElementNode(Element eElement, DataSchema schema) throws PIRException
   {
@@ -293,7 +298,8 @@ public class DataSchemaLoader
    *
    * @param typeName
    *          The type name to check.
-   * @throws PIRException -
+   * @throws PIRException
+   *           -
    */
   private void validateIsPrimitiveType(String typeName) throws PIRException
   {
@@ -311,7 +317,8 @@ public class DataSchemaLoader
    * @param partitionerTypeName
    *          The name of the {@link DataPartitioner} subclass to instantiate.
    * @return An instance of the named {@link DataPartitioner} subclass.
-   * @throws PIRException -
+   * @throws PIRException
+   *           -
    */
   private DataPartitioner instantiatePartitioner(String partitionerTypeName) throws PIRException
   {

http://git-wip-us.apache.org/repos/asf/incubator-pirk/blob/e99d2501/src/main/java/org/apache/pirk/schema/query/QuerySchemaLoader.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/pirk/schema/query/QuerySchemaLoader.java b/src/main/java/org/apache/pirk/schema/query/QuerySchemaLoader.java
index 94e6ff2..433a303 100644
--- a/src/main/java/org/apache/pirk/schema/query/QuerySchemaLoader.java
+++ b/src/main/java/org/apache/pirk/schema/query/QuerySchemaLoader.java
@@ -96,7 +96,8 @@ public class QuerySchemaLoader
   /**
    * Initializes the static {@link QuerySchemaRegistry} with a list of query schema names.
    * 
-   * @throws Exception - failed to initialize
+   * @throws Exception
+   *           - failed to initialize
    */
   public static void initialize() throws Exception
   {
@@ -111,7 +112,8 @@ public class QuerySchemaLoader
    *          If true, specifies that the query schema is an hdfs file; if false, that it is a regular file.
    * @param fs
    *          Used only when {@code hdfs} is true; the {@link FileSystem} handle for the hdfs in which the query schema exists
-   * @throws Exception - failed to initialize
+   * @throws Exception
+   *           - failed to initialize
    */
   public static void initialize(boolean hdfs, FileSystem fs) throws Exception
   {
@@ -270,8 +272,10 @@ public class QuerySchemaLoader
    * @param stream
    *          The input stream.
    * @return A Document representing the XML document.
-   * @throws IOException - failed to read input
-   * @throws PIRException - file could not be parsed
+   * @throws IOException
+   *           - failed to read input
+   * @throws PIRException
+   *           - file could not be parsed
    */
   private Document parseXMLDocument(InputStream stream) throws IOException, PIRException
   {
@@ -296,7 +300,8 @@ public class QuerySchemaLoader
    * @param doc
    *          An XML document specifying names upon which we will filter the query.
    * @return The set of names upon which we will filter the query.
-   * @throws PIRException - Filter lists not found
+   * @throws PIRException
+   *           - Filter lists not found
    */
   private Set<String> extractFilteredElementNames(Document doc) throws PIRException
   {
@@ -338,7 +343,8 @@ public class QuerySchemaLoader
    * @param tagName
    *          The name of the tag we wish to extract from the {@code doc}
    * @return The text content of the tag.
-   * @throws PIRException - XML Document is Empty
+   * @throws PIRException
+   *           - XML Document is Empty
    */
   private String extractValue(Document doc, String tagName) throws PIRException
   {
@@ -360,8 +366,10 @@ public class QuerySchemaLoader
    * @param filteredElementNames
    *          The set of names of elements of the data schema up which the filter will act.
    * @return An instantiation of the filter, set up to filter upon the specified names.
-   * @throws IOException - failed to read input
-   * @throws PIRException - File could not be instantiated
+   * @throws IOException
+   *           - failed to read input
+   * @throws PIRException
+   *           - File could not be instantiated
    */
   private DataFilter instantiateFilter(String filterTypeName, Set<String> filteredElementNames) throws IOException, PIRException
   {

http://git-wip-us.apache.org/repos/asf/incubator-pirk/blob/e99d2501/src/main/java/org/apache/pirk/test/utils/StandaloneQuery.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/pirk/test/utils/StandaloneQuery.java b/src/main/java/org/apache/pirk/test/utils/StandaloneQuery.java
index 1c26bdd..a931871 100644
--- a/src/main/java/org/apache/pirk/test/utils/StandaloneQuery.java
+++ b/src/main/java/org/apache/pirk/test/utils/StandaloneQuery.java
@@ -56,8 +56,8 @@ public class StandaloneQuery
   String testQuerySchemaName = "testQuerySchema";
 
   // Base method to perform the query
-  public static List<QueryResponseJSON> performStandaloneQuery(List<JSONObject> dataElements, String queryType, List<String> selectors,
-      int numThreads, boolean testFalsePositive) throws IOException, InterruptedException, PIRException
+  public static List<QueryResponseJSON> performStandaloneQuery(List<JSONObject> dataElements, String queryType, List<String> selectors, int numThreads,
+      boolean testFalsePositive) throws IOException, InterruptedException, PIRException
   {
     logger.info("Performing watchlisting: ");
 

http://git-wip-us.apache.org/repos/asf/incubator-pirk/blob/e99d2501/src/main/resources/log4j2.xml
----------------------------------------------------------------------
diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml
index 81549db..8f82f1c 100644
--- a/src/main/resources/log4j2.xml
+++ b/src/main/resources/log4j2.xml
@@ -41,8 +41,8 @@
 		<Logger name="org.apache.hadoop.hbase.zookeeper" level="warn" additivity="false"/>
 		<Logger name="org.apache.zookeeper" level="error" additivity="false"/>
 		<Root level="info">
-			<AppenderRef ref="STDOUT"/>
-			<AppenderRef ref="RollingFile"/>
+			<AppenderRef ref="STDOUT" level="info"/>
+			<AppenderRef ref="RollingFile" level="info"/>
 		</Root>
 	</Loggers>
 

http://git-wip-us.apache.org/repos/asf/incubator-pirk/blob/e99d2501/src/test/java/org/apache/pirk/general/PartitionUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/pirk/general/PartitionUtilsTest.java b/src/test/java/org/apache/pirk/general/PartitionUtilsTest.java
index 6f779cd..21d44b6 100644
--- a/src/test/java/org/apache/pirk/general/PartitionUtilsTest.java
+++ b/src/test/java/org/apache/pirk/general/PartitionUtilsTest.java
@@ -52,7 +52,7 @@ public class PartitionUtilsTest
     assertEquals(0b000000000001111, PrimitiveTypePartitioner.formBitMask(4).intValue());
     assertEquals(0b000000001111111, PrimitiveTypePartitioner.formBitMask(7).intValue());
     assertEquals(0b111111111111111, PrimitiveTypePartitioner.formBitMask(15).intValue());
-    
+
     assertEquals(new BigInteger("FFFFF", 16), PrimitiveTypePartitioner.formBitMask(20));
     assertEquals(new BigInteger("FFFFFFFF", 16), PrimitiveTypePartitioner.formBitMask(32));
     assertEquals(new BigInteger("3FFFFFFFFFF", 16), PrimitiveTypePartitioner.formBitMask(42));
@@ -79,7 +79,7 @@ public class PartitionUtilsTest
 
     partitions = PrimitiveTypePartitioner.partitionBits(value2, 4, mask4);
     assertEquals(3, partitions.size());
-    assertEquals(0b1111, partitions.get(0).intValue()); 
+    assertEquals(0b1111, partitions.get(0).intValue());
     assertEquals(0b0101, partitions.get(1).intValue());
     assertEquals(0b0011, partitions.get(2).intValue());