minor style issues, update POM
diff --git a/pom.xml b/pom.xml
index 0322e13..f15a58e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -145,7 +145,7 @@
<dependency>
<groupId>com.yahoo.datasketches</groupId>
<artifactId>sketches-core</artifactId>
- <version>0.13.0</version>
+ <version>0.13.1</version>
</dependency>
<!-- Pig -->
diff --git a/src/main/java/com/yahoo/sketches/pig/cpc/AlgebraicFinal.java b/src/main/java/com/yahoo/sketches/pig/cpc/AlgebraicFinal.java
index aacc381..8b42a1f 100644
--- a/src/main/java/com/yahoo/sketches/pig/cpc/AlgebraicFinal.java
+++ b/src/main/java/com/yahoo/sketches/pig/cpc/AlgebraicFinal.java
@@ -21,7 +21,7 @@
* operation. It will receive a bag of values returned by either the <i>Intermediate</i>
* stage or the <i>Initial</i> stages, so it needs to be able to differentiate between and
* interpret both types.
- *
+ *
* @author Alexander Saydakov
*/
abstract class AlgebraicFinal extends EvalFunc<DataByteArray> {
@@ -55,8 +55,9 @@
return dba;
}
- static DataByteArray process(final Tuple inputTuple, final int lgK, final long seed, boolean isInputRaw) throws IOException {
- if (inputTuple == null || inputTuple.size() == 0) {
+ static DataByteArray process(final Tuple inputTuple, final int lgK, final long seed,
+ final boolean isInputRaw) throws IOException {
+ if ((inputTuple == null) || (inputTuple.size() == 0)) {
return null;
}
CpcSketch sketch = null;
@@ -102,7 +103,7 @@
+ f0.getClass().getName());
}
}
- if (sketch != null && union != null) {
+ if ((sketch != null) && (union != null)) {
union.update(sketch);
sketch = null;
}
diff --git a/src/main/java/com/yahoo/sketches/pig/cpc/AlgebraicIntermediate.java b/src/main/java/com/yahoo/sketches/pig/cpc/AlgebraicIntermediate.java
index 45473ad..a778df8 100644
--- a/src/main/java/com/yahoo/sketches/pig/cpc/AlgebraicIntermediate.java
+++ b/src/main/java/com/yahoo/sketches/pig/cpc/AlgebraicIntermediate.java
@@ -21,7 +21,7 @@
* and from a reducer). It will receive a bag of values returned by either <i>Intermediate</i>
* or <i>Initial</i> stages, so it needs to be able to differentiate between and
* interpret both types.
- *
+ *
* @author Alexander Saydakov
*/
abstract class AlgebraicIntermediate extends EvalFunc<Tuple> {
@@ -37,7 +37,7 @@
* Constructor with primitives for the intermediate pass of an Algebraic function.
*
* @param lgK parameter controlling the sketch size and accuracy
- * @param seed
+ * @param seed the given seed
*/
public AlgebraicIntermediate(final int lgK, final long seed) {
lgK_ = lgK;
diff --git a/src/main/java/com/yahoo/sketches/pig/kll/DataToSketch.java b/src/main/java/com/yahoo/sketches/pig/kll/DataToSketch.java
index dedf4ec..f9a5277 100644
--- a/src/main/java/com/yahoo/sketches/pig/kll/DataToSketch.java
+++ b/src/main/java/com/yahoo/sketches/pig/kll/DataToSketch.java
@@ -20,7 +20,8 @@
/**
* This UDF is to build sketches from data.
- * This class implements both the <i>Accumulator</i> and <i>Algebraic</i> interfaces for performance optimization.
+ * This class implements both the <i>Accumulator</i> and <i>Algebraic</i> interfaces for
+ * performance optimization.
*/
public class DataToSketch extends EvalFunc<DataByteArray> implements Accumulator<DataByteArray>, Algebraic {
@@ -111,7 +112,7 @@
public DataByteArray exec(final Tuple inputTuple) throws IOException {
//The exec is a stateless function. It operates on the input and returns a result.
final KllFloatsSketch sketch = new KllFloatsSketch(k_);
- if (inputTuple != null && inputTuple.size() > 0) {
+ if ((inputTuple != null) && (inputTuple.size() > 0)) {
final DataBag bag = (DataBag) inputTuple.get(0);
for (final Tuple innerTuple: bag) {
sketch.update((Float) innerTuple.get(0));
@@ -134,7 +135,7 @@
*/
@Override
public void accumulate(final Tuple inputTuple) throws IOException {
- if (inputTuple == null || inputTuple.size() == 0) { return; }
+ if ((inputTuple == null) || (inputTuple.size() == 0)) { return; }
final DataBag bag = (DataBag) inputTuple.get(0);
if (bag == null) { return; }
if (accumSketch_ == null) {
@@ -312,7 +313,7 @@
private static DataByteArray process(final Tuple inputTuple, final int k) throws IOException {
final KllFloatsSketch sketch = new KllFloatsSketch(k);
- if (inputTuple != null && inputTuple.size() > 0) {
+ if ((inputTuple != null) && (inputTuple.size() > 0)) {
final DataBag outerBag = (DataBag) inputTuple.get(0);
for (final Tuple dataTuple: outerBag) {
final Object f0 = dataTuple.get(0);
diff --git a/src/main/java/com/yahoo/sketches/pig/kll/UnionSketch.java b/src/main/java/com/yahoo/sketches/pig/kll/UnionSketch.java
index 1ce5425..e4db8d0 100644
--- a/src/main/java/com/yahoo/sketches/pig/kll/UnionSketch.java
+++ b/src/main/java/com/yahoo/sketches/pig/kll/UnionSketch.java
@@ -21,9 +21,11 @@
/**
* This UDF is to merge sketches.
- * This class implements both the <i>Accumulator</i> and <i>Algebraic</i> interfaces for performance optimization.
+ * This class implements both the <i>Accumulator</i> and <i>Algebraic</i> interfaces for
+ * performance optimization.
*/
-public class UnionSketch extends EvalFunc<DataByteArray> implements Accumulator<DataByteArray>, Algebraic {
+public class UnionSketch extends EvalFunc<DataByteArray>
+ implements Accumulator<DataByteArray>, Algebraic {
private static final TupleFactory TUPLE_FACTORY_ = TupleFactory.getInstance();
@@ -102,7 +104,7 @@
public DataByteArray exec(final Tuple inputTuple) throws IOException {
//The exec is a stateless function. It operates on the input and returns a result.
final KllFloatsSketch sketch = new KllFloatsSketch(k_);
- if (inputTuple != null && inputTuple.size() > 0) {
+ if ((inputTuple != null) && (inputTuple.size() > 0)) {
final DataBag bag = (DataBag) inputTuple.get(0);
updateUnion(bag, sketch);
}
@@ -113,8 +115,8 @@
/**
* An <i>Accumulator</i> version of the standard <i>exec()</i> method. Like <i>exec()</i>,
- * accumulator is called with a bag of Sketch Tuples. Unlike <i>exec()</i>, it doesn't serialize the
- * sketch at the end. Instead, it can be called multiple times, each time with another bag of
+ * accumulator is called with a bag of Sketch Tuples. Unlike <i>exec()</i>, it doesn't serialize
+ * the sketch at the end. Instead, it can be called multiple times, each time with another bag of
* Sketch Tuples to be input to the Union.
*
* @param inputTuple A tuple containing a single bag, containing Sketch Tuples.
@@ -124,7 +126,7 @@
*/
@Override
public void accumulate(final Tuple inputTuple) throws IOException {
- if (inputTuple == null || inputTuple.size() == 0) { return; }
+ if ((inputTuple == null) || (inputTuple.size() == 0)) { return; }
final DataBag bag = (DataBag) inputTuple.get(0);
if (bag == null) { return; }
if (accumSketch_ == null) {
@@ -183,7 +185,8 @@
* @param bag A bag of sketchTuples.
* @param union The union to update
*/
- private static void updateUnion(final DataBag bag, final KllFloatsSketch union) throws ExecException {
+ private static void updateUnion(final DataBag bag, final KllFloatsSketch union)
+ throws ExecException {
for (Tuple innerTuple: bag) {
final Object f0 = innerTuple.get(0);
if (f0 == null) { continue; }
@@ -193,7 +196,8 @@
union.merge(KllFloatsSketch.heapify(Memory.wrap(dba.get())));
}
} else {
- throw new IllegalArgumentException("Field type was not DataType.BYTEARRAY: " + innerTuple.getType(0));
+ throw new IllegalArgumentException("Field type was not DataType.BYTEARRAY: "
+ + innerTuple.getType(0));
}
}
}
@@ -322,7 +326,7 @@
private static DataByteArray process(final Tuple inputTuple, final int k) throws IOException {
final KllFloatsSketch union = new KllFloatsSketch(k);
- if (inputTuple != null && inputTuple.size() > 0) {
+ if ((inputTuple != null) && (inputTuple.size() > 0)) {
final DataBag outerBag = (DataBag) inputTuple.get(0);
for (final Tuple dataTuple: outerBag) {
final Object f0 = dataTuple.get(0);