accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] milleruntime commented on a change in pull request #11: Fixes #10 - Update helloworld example to new Connector builder
Date Sat, 24 Mar 2018 21:45:03 GMT
milleruntime commented on a change in pull request #11: Fixes #10 - Update helloworld example
to new Connector builder
URL: https://github.com/apache/accumulo-examples/pull/11#discussion_r176920910
 
 

 ##########
 File path: src/main/java/org/apache/accumulo/examples/helloworld/InsertWithBatchWriter.java
 ##########
 @@ -20,46 +20,42 @@
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.BatchWriter;
 import org.apache.accumulo.core.client.Connector;
-import org.apache.accumulo.core.client.MultiTableBatchWriter;
-import org.apache.accumulo.core.client.MutationsRejectedException;
 import org.apache.accumulo.core.client.TableExistsException;
 import org.apache.accumulo.core.client.TableNotFoundException;
 import org.apache.accumulo.core.data.Mutation;
 import org.apache.accumulo.core.data.Value;
-import org.apache.accumulo.examples.cli.BatchWriterOpts;
-import org.apache.accumulo.examples.cli.ClientOnRequiredTable;
 import org.apache.hadoop.io.Text;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Inserts 10K rows (50K entries) into accumulo with each row having 5 entries.
  */
 public class InsertWithBatchWriter {
 
-  public static void main(String[] args) throws AccumuloException, AccumuloSecurityException,
MutationsRejectedException, TableExistsException,
+  private static final Logger log = LoggerFactory.getLogger(InsertWithBatchWriter.class);
+
+  public static void main(String[] args) throws AccumuloException, AccumuloSecurityException,
TableExistsException,
       TableNotFoundException {
-    ClientOnRequiredTable opts = new ClientOnRequiredTable();
-    BatchWriterOpts bwOpts = new BatchWriterOpts();
-    opts.parseArgs(InsertWithBatchWriter.class.getName(), args, bwOpts);
 
-    Connector connector = opts.getConnector();
-    MultiTableBatchWriter mtbw = connector.createMultiTableBatchWriter(bwOpts.getBatchWriterConfig());
+    Connector connector = Connector.builder().usingProperties("conf/accumulo-client.properties").build();
 
 Review comment:
   +1 Not only using the new API but using a more realistic example of how to connect.

----------------------------------------------------------------
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

Mime
View raw message