accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mwa...@apache.org
Subject [accumulo] branch master updated: #939 - use default methods (#940)
Date Wed, 06 Feb 2019 23:34:05 GMT
This is an automated email from the ASF dual-hosted git repository.

mwalch pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/master by this push:
     new 234df09  #939 - use default methods (#940)
234df09 is described below

commit 234df09997454fe6519136c3ce00bb17956b1458
Author: Mike Walch <mwalch@apache.org>
AuthorDate: Wed Feb 6 18:34:00 2019 -0500

    #939 - use default methods (#940)
---
 .../java/org/apache/accumulo/core/client/ScannerBase.java | 12 ++++++++++--
 .../apache/accumulo/core/clientImpl/ScannerOptions.java   | 15 ---------------
 2 files changed, 10 insertions(+), 17 deletions(-)

diff --git a/core/src/main/java/org/apache/accumulo/core/client/ScannerBase.java b/core/src/main/java/org/apache/accumulo/core/client/ScannerBase.java
index a490f16..328c066 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/ScannerBase.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/ScannerBase.java
@@ -19,6 +19,7 @@ package org.apache.accumulo.core.client;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Map.Entry;
+import java.util.Objects;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.accumulo.core.client.IteratorSetting.Column;
@@ -107,7 +108,10 @@ public interface ScannerBase extends Iterable<Entry<Key,Value>>,
AutoCloseable {
    *          the column family to be fetched
    * @since 2.0.0
    */
-  void fetchColumnFamily(CharSequence colFam);
+  default void fetchColumnFamily(CharSequence colFam) {
+    Objects.requireNonNull(colFam);
+    fetchColumnFamily(new Text(colFam.toString()));
+  }
 
   /**
    * Adds a column to the list of columns that will be fetched by this scanner. The column
is
@@ -152,7 +156,11 @@ public interface ScannerBase extends Iterable<Entry<Key,Value>>,
AutoCloseable {
    *          the column qualifier of the column to be fetched
    * @since 2.0.0
    */
-  void fetchColumn(CharSequence colFam, CharSequence colQual);
+  default void fetchColumn(CharSequence colFam, CharSequence colQual) {
+    Objects.requireNonNull(colFam);
+    Objects.requireNonNull(colQual);
+    fetchColumn(new Text(colFam.toString()), new Text(colQual.toString()));
+  }
 
   /**
    * Adds a column to the list of columns that will be fetch by this scanner.
diff --git a/core/src/main/java/org/apache/accumulo/core/clientImpl/ScannerOptions.java b/core/src/main/java/org/apache/accumulo/core/clientImpl/ScannerOptions.java
index a9d45f2..71c7900 100644
--- a/core/src/main/java/org/apache/accumulo/core/clientImpl/ScannerOptions.java
+++ b/core/src/main/java/org/apache/accumulo/core/clientImpl/ScannerOptions.java
@@ -140,13 +140,6 @@ public class ScannerOptions implements ScannerBase {
   }
 
   @Override
-  public void fetchColumnFamily(CharSequence colFam) {
-    checkArgument(colFam != null, "colFam is null");
-    Column c = new Column(colFam.toString().getBytes(), null, null);
-    fetchedColumns.add(c);
-  }
-
-  @Override
   public synchronized void fetchColumn(Text colFam, Text colQual) {
     checkArgument(colFam != null, "colFam is null");
     checkArgument(colQual != null, "colQual is null");
@@ -155,14 +148,6 @@ public class ScannerOptions implements ScannerBase {
   }
 
   @Override
-  public void fetchColumn(CharSequence colFam, CharSequence colQual) {
-    checkArgument(colFam != null, "colFam is null");
-    checkArgument(colQual != null, "colQual is null");
-    Column c = new Column(colFam.toString().getBytes(), colQual.toString().getBytes(), null);
-    fetchedColumns.add(c);
-  }
-
-  @Override
   public void fetchColumn(IteratorSetting.Column column) {
     checkArgument(column != null, "Column is null");
     fetchColumn(column.getColumnFamily(), column.getColumnQualifier());


Mime
View raw message