[PIRK-54]: Log Levels not Functioning, source formatting - closes apache/incubator-pirk#71
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 @@
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<>();
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 @@
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 @@
}
// 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 @@
{
throw new PIRException("Exception in decryption threads.", e);
}
-
+
es.shutdown();
}
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 @@
/**
* 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<>();
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 @@
* 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<>();
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 @@
/**
* 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 @@
* 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 @@
* @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 @@
* 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 @@
*
* @param typeName
* The type name to check.
- * @throws PIRException -
+ * @throws PIRException
+ * -
*/
private void validateIsPrimitiveType(String typeName) throws PIRException
{
@@ -311,7 +317,8 @@
* @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
{
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 @@
/**
* 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 @@
* 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 @@
* @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 @@
* @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 @@
* @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 @@
* @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
{
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 @@
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: ");
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>
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 @@
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 @@
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());