You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@fluo.apache.org by GitBox <gi...@apache.org> on 2018/08/29 14:04:06 UTC

[GitHub] cjmctague closed pull request #149: Fluo recipes updates

cjmctague closed pull request #149: Fluo recipes updates
URL: https://github.com/apache/fluo-recipes/pull/149
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/.travis.yml b/.travis.yml
index 6c71b6b..a9745e7 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -29,6 +29,6 @@ before_script:
   - unset _JAVA_OPTIONS
 env:
   - ADDITIONAL_MAVEN_OPTS=
-  - ADDITIONAL_MAVEN_OPTS=-Daccumulo.version=1.8.1
+  - ADDITIONAL_MAVEN_OPTS=-Daccumulo.version=1.9.2
 script:
   - mvn clean verify javadoc:jar $ADDITIONAL_MAVEN_OPTS
diff --git a/contrib/create-release-candidate.sh b/contrib/create-release-candidate.sh
index 56a2f56..d444a18 100755
--- a/contrib/create-release-candidate.sh
+++ b/contrib/create-release-candidate.sh
@@ -68,7 +68,7 @@ gitCommit()  { gitCommits -n1 "$@"; }
 gitSubject() { pretty %s "$@"; }
 
 createEmail() {
-  # $1 version (optional); $2 rc seqence num (optional); $3 staging repo num (optional)
+  # $1 version (optional); $2 rc sequence num (optional); $3 staging repo num (optional)
   local ver; [[ -n $1 ]] && ver=$1 || ver=$(prompter 'version to be released (eg. x.y.z)' '[0-9]+[.][0-9]+[.][0-9]+')
   local rc; [[ -n $2 ]] && rc=$2 || rc=$(prompter 'release candidate sequence number (eg. 1, 2, etc.)' '[0-9]+')
   local stagingrepo; [[ -n $3 ]] && stagingrepo=$3 || stagingrepo=$(prompter 'staging repository number from https://repository.apache.org/#stagingRepositories' '[0-9]+')
diff --git a/modules/accumulo/src/main/java/org/apache/fluo/recipes/accumulo/export/function/AccumuloExporter.java b/modules/accumulo/src/main/java/org/apache/fluo/recipes/accumulo/export/function/AccumuloExporter.java
index 8a46ce2..21c995e 100644
--- a/modules/accumulo/src/main/java/org/apache/fluo/recipes/accumulo/export/function/AccumuloExporter.java
+++ b/modules/accumulo/src/main/java/org/apache/fluo/recipes/accumulo/export/function/AccumuloExporter.java
@@ -90,7 +90,7 @@ public AccumuloExporter(String configId, SimpleConfiguration appConfig,
   @Override
   public void export(Iterator<SequencedExport<K, V>> t) {
     ArrayList<Mutation> buffer = new ArrayList<>();
-    Consumer<Mutation> consumer = m -> buffer.add(m);
+    Consumer<Mutation> consumer = buffer::add;
 
     while (t.hasNext()) {
       translator.translate(t.next(), consumer);
diff --git a/modules/accumulo/src/test/java/org/apache/fluo/recipes/accumulo/export/AccumuloTranslatorTest.java b/modules/accumulo/src/test/java/org/apache/fluo/recipes/accumulo/export/AccumuloTranslatorTest.java
index d8a2836..36b0205 100644
--- a/modules/accumulo/src/test/java/org/apache/fluo/recipes/accumulo/export/AccumuloTranslatorTest.java
+++ b/modules/accumulo/src/test/java/org/apache/fluo/recipes/accumulo/export/AccumuloTranslatorTest.java
@@ -74,7 +74,7 @@ public static void addDel(Mutation m, String key, String val, long seq) {
   @Test
   public void testDifferenceExport() {
     final Collection<Mutation> mutations = new ArrayList<>();
-    Consumer<Mutation> consumer = m -> mutations.add(m);
+    Consumer<Mutation> consumer = mutations::add;
 
     genMutations("k1", 1, Optional.empty(), Optional.of("a"), consumer);
     Assert.assertEquals(1, mutations.size());
diff --git a/modules/core/src/main/java/org/apache/fluo/recipes/core/combine/CombineQueue.java b/modules/core/src/main/java/org/apache/fluo/recipes/core/combine/CombineQueue.java
index 265a0f9..39a9b7e 100644
--- a/modules/core/src/main/java/org/apache/fluo/recipes/core/combine/CombineQueue.java
+++ b/modules/core/src/main/java/org/apache/fluo/recipes/core/combine/CombineQueue.java
@@ -156,7 +156,7 @@ public static FluentArg1 configure(String combineQueueId) {
   /**
    * A {@link CombineQueue} stores data in its own data format in the Fluo table. When initializing
    * a Fluo table with something like Map Reduce or Spark, data will need to be written in this
-   * format. Thats the purpose of this method, it provides a simple class that can do this
+   * format. That's the purpose of this method, it provides a simple class that can do this
    * conversion.
    */
   public static <K2, V2> Initializer<K2, V2> getInitializer(String cqId, int numBuckets,
diff --git a/modules/core/src/main/java/org/apache/fluo/recipes/core/combine/InputImpl.java b/modules/core/src/main/java/org/apache/fluo/recipes/core/combine/InputImpl.java
index a5e8f9f..61ebaab 100644
--- a/modules/core/src/main/java/org/apache/fluo/recipes/core/combine/InputImpl.java
+++ b/modules/core/src/main/java/org/apache/fluo/recipes/core/combine/InputImpl.java
@@ -23,7 +23,7 @@
 import com.google.common.collect.Iterators;
 import org.apache.fluo.api.data.Bytes;
 
-// intentionally package priave
+// intentionally package private
 class InputImpl<K, V> implements Combiner.Input<K, V> {
   private K key;
   private Collection<Bytes> valuesCollection;
diff --git a/modules/core/src/main/java/org/apache/fluo/recipes/core/export/ExportBucket.java b/modules/core/src/main/java/org/apache/fluo/recipes/core/export/ExportBucket.java
index 68c8c8c..6893b10 100644
--- a/modules/core/src/main/java/org/apache/fluo/recipes/core/export/ExportBucket.java
+++ b/modules/core/src/main/java/org/apache/fluo/recipes/core/export/ExportBucket.java
@@ -118,7 +118,7 @@ public void add(long seq, byte[] key, byte[] value) {
   }
 
   /**
-   * Computes the minimial row for a bucket
+   * Computes the minimal row for a bucket
    */
   private Bytes getMinimalRow() {
     return Bytes.builder(bucketRow.length() + 1).append(bucketRow).append(':').toBytes();
diff --git a/modules/core/src/main/java/org/apache/fluo/recipes/core/export/ExportQueue.java b/modules/core/src/main/java/org/apache/fluo/recipes/core/export/ExportQueue.java
index b79c080..f66d92b 100644
--- a/modules/core/src/main/java/org/apache/fluo/recipes/core/export/ExportQueue.java
+++ b/modules/core/src/main/java/org/apache/fluo/recipes/core/export/ExportQueue.java
@@ -89,7 +89,7 @@ public void addAll(TransactionBase tx, Iterator<Export<K, V>> exports) {
     }
   }
 
-  // TODO maybe add for stream and interable
+  // TODO maybe add for stream and iterable
 
   public static <K2, V2> ExportQueue<K2, V2> getInstance(String exportQueueId,
       SimpleConfiguration appConfig) {
diff --git a/modules/core/src/main/java/org/apache/fluo/recipes/core/map/CollisionFreeMap.java b/modules/core/src/main/java/org/apache/fluo/recipes/core/map/CollisionFreeMap.java
index 14acf69..3ac92aa 100644
--- a/modules/core/src/main/java/org/apache/fluo/recipes/core/map/CollisionFreeMap.java
+++ b/modules/core/src/main/java/org/apache/fluo/recipes/core/map/CollisionFreeMap.java
@@ -224,7 +224,7 @@ static String genBucketId(int bucket, int maxBucket) {
   /**
    * A {@link CollisionFreeMap} stores data in its own data format in the Fluo table. When
    * initializing a Fluo table with something like Map Reduce or Spark, data will need to be written
-   * in this format. Thats the purpose of this method, it provide a simple class that can do this
+   * in this format. That's the purpose of this method, it provide a simple class that can do this
    * conversion.
    */
   public static <K2, V2> Initializer<K2, V2> getInitializer(String mapId, int numBuckets,
@@ -401,7 +401,7 @@ public static void configure(FluoConfiguration fluoConfig, Options opts) {
   public static class Optimizer implements TableOptimizationsFactory {
 
     /**
-     * Return suggested Fluo table optimizations for the specified collisiong free map.
+     * Return suggested Fluo table optimizations for the specified collision free map.
      *
      * @param appConfig Must pass in the application configuration obtained from
      *        {@code FluoClient.getAppConfiguration()} or
diff --git a/modules/core/src/main/java/org/apache/fluo/recipes/core/transaction/RecordingTransactionBase.java b/modules/core/src/main/java/org/apache/fluo/recipes/core/transaction/RecordingTransactionBase.java
index 6d72d49..7f1cae1 100644
--- a/modules/core/src/main/java/org/apache/fluo/recipes/core/transaction/RecordingTransactionBase.java
+++ b/modules/core/src/main/java/org/apache/fluo/recipes/core/transaction/RecordingTransactionBase.java
@@ -220,7 +220,7 @@ public RtxRowScanner(RowScanner scanner) {
 
     @Override
     public Iterator<ColumnScanner> iterator() {
-      return Iterators.transform(scanner.iterator(), cs -> new RtxColumnScanner(cs));
+      return Iterators.transform(scanner.iterator(), RtxColumnScanner::new);
     }
 
   }
diff --git a/modules/core/src/main/java/org/apache/fluo/recipes/core/types/TypedSnapshotBase.java b/modules/core/src/main/java/org/apache/fluo/recipes/core/types/TypedSnapshotBase.java
index 04d42cc..a5b17fc 100644
--- a/modules/core/src/main/java/org/apache/fluo/recipes/core/types/TypedSnapshotBase.java
+++ b/modules/core/src/main/java/org/apache/fluo/recipes/core/types/TypedSnapshotBase.java
@@ -524,7 +524,7 @@ public ScannerBuilder scanner() {
 
   @SuppressWarnings({"unchecked"})
   private Map<Column, Value> wrap(Map<Column, Bytes> map) {
-    Map<Column, Value> ret = Maps.transformValues(map, input -> new Value(input));
+    Map<Column, Value> ret = Maps.transformValues(map, Value::new);
     return Collections.unmodifiableMap(DefaultedMap.decorate(ret, new Value((Bytes) null)));
   }
 
diff --git a/modules/core/src/test/java/org/apache/fluo/recipes/core/transaction/RecordingTransactionTest.java b/modules/core/src/test/java/org/apache/fluo/recipes/core/transaction/RecordingTransactionTest.java
index e2f2de9..af291e1 100644
--- a/modules/core/src/test/java/org/apache/fluo/recipes/core/transaction/RecordingTransactionTest.java
+++ b/modules/core/src/test/java/org/apache/fluo/recipes/core/transaction/RecordingTransactionTest.java
@@ -161,13 +161,8 @@ public void testGetRows() {
   @Test
   public void testGetScanIter() {
     ScannerBuilder sb = mock(ScannerBuilder.class);
-    expect(sb.build()).andReturn(new CellScanner() {
-      @Override
-      public Iterator<RowColumnValue> iterator() {
-        return Iterators
-            .singletonIterator(new RowColumnValue("r7", new Column("cf7", "cq7"), "v7"));
-      }
-    });
+    expect(sb.build()).andReturn(() -> Iterators
+        .singletonIterator(new RowColumnValue("r7", new Column("cf7", "cq7"), "v7")));
 
     expect(tx.scanner()).andReturn(sb);
 
diff --git a/modules/kryo/src/main/java/org/apache/fluo/recipes/kryo/KryoSimplerSerializer.java b/modules/kryo/src/main/java/org/apache/fluo/recipes/kryo/KryoSimplerSerializer.java
index ca3deeb..cf49be4 100644
--- a/modules/kryo/src/main/java/org/apache/fluo/recipes/kryo/KryoSimplerSerializer.java
+++ b/modules/kryo/src/main/java/org/apache/fluo/recipes/kryo/KryoSimplerSerializer.java
@@ -77,27 +77,21 @@ public Kryo create() {
 
   @Override
   public <T> byte[] serialize(T obj) {
-    return getPool().run(new KryoCallback<byte[]>() {
-      @Override
-      public byte[] execute(Kryo kryo) {
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        Output output = new Output(baos);
-        kryo.writeClassAndObject(output, obj);
-        output.close();
-        return baos.toByteArray();
-      }
+    return getPool().run(kryo -> {
+      ByteArrayOutputStream baos = new ByteArrayOutputStream();
+      Output output = new Output(baos);
+      kryo.writeClassAndObject(output, obj);
+      output.close();
+      return baos.toByteArray();
     });
   }
 
   @Override
   public <T> T deserialize(byte[] serObj, Class<T> clazz) {
-    return getPool().run(new KryoCallback<T>() {
-      @Override
-      public T execute(Kryo kryo) {
-        ByteArrayInputStream bais = new ByteArrayInputStream(serObj);
-        Input input = new Input(bais);
-        return clazz.cast(kryo.readClassAndObject(input));
-      }
+    return getPool().run(kryo -> {
+      ByteArrayInputStream bais = new ByteArrayInputStream(serObj);
+      Input input = new Input(bais);
+      return clazz.cast(kryo.readClassAndObject(input));
     });
   }
 
diff --git a/modules/test/src/main/java/org/apache/fluo/recipes/test/AccumuloExportITBase.java b/modules/test/src/main/java/org/apache/fluo/recipes/test/AccumuloExportITBase.java
index acc13b7..2eb856e 100644
--- a/modules/test/src/main/java/org/apache/fluo/recipes/test/AccumuloExportITBase.java
+++ b/modules/test/src/main/java/org/apache/fluo/recipes/test/AccumuloExportITBase.java
@@ -39,7 +39,7 @@
 /**
  * This class is intended to be extended by classes testing exporting from Fluo to Accumulo. Using
  * MiniFluo by itself is easy. However, using MiniAccumulo and MiniFluo together involves writing a
- * lot of boiler plate code. Thats why this class exists, its a place to put that boiler plate code.
+ * lot of boilerplate code. That's why this class exists: it's a place to put that boilerplate code.
  *
  * <p>
  * Below is some example code showing how to use this class to write a test.


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services