accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1429942 [2/2] - in /accumulo/trunk: core/src/main/java/org/apache/accumulo/core/cli/ core/src/main/java/org/apache/accumulo/core/trace/ core/src/test/java/org/apache/accumulo/core/cli/ examples/simple/src/main/java/org/apache/accumulo/exam...
Date Mon, 07 Jan 2013 18:41:56 GMT
Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/AddFilesWithMissingEntries.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/AddFilesWithMissingEntries.java?rev=1429942&r1=1429941&r2=1429942&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/AddFilesWithMissingEntries.java
(original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/AddFilesWithMissingEntries.java
Mon Jan  7 18:41:55 2013
@@ -22,6 +22,7 @@ import java.util.Set;
 
 import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.server.cli.ClientOpts;
+import org.apache.accumulo.core.cli.BatchWriterOpts;
 import org.apache.accumulo.core.client.MultiTableBatchWriter;
 import org.apache.accumulo.core.client.Scanner;
 import org.apache.accumulo.core.data.Key;
@@ -59,7 +60,8 @@ public class AddFilesWithMissingEntries 
    */
   public static void main(String[] args) throws Exception {
     Opts opts = new Opts();
-    opts.parseArgs(AddFilesWithMissingEntries.class.getName(), args);
+    BatchWriterOpts bwOpts = new BatchWriterOpts();
+    opts.parseArgs(AddFilesWithMissingEntries.class.getName(), args, bwOpts);
     
     final Key rootTableEnd = new Key(Constants.ROOT_TABLET_EXTENT.getEndRow());
     final Range range = new Range(rootTableEnd.followingKey(PartialKey.ROW), true, Constants.METADATA_RESERVED_KEYSPACE_START_KEY,
false);
@@ -73,7 +75,7 @@ public class AddFilesWithMissingEntries 
     Set<String> knownFiles = new HashSet<String>();
     
     int count = 0;
-    final MultiTableBatchWriter writer = opts.getConnector().createMultiTableBatchWriter(opts.getBatchWriterConfig());
+    final MultiTableBatchWriter writer = opts.getConnector().createMultiTableBatchWriter(bwOpts.getBatchWriterConfig());
     
     // collect the list of known files and the directory for each extent
     for (Entry<Key,Value> entry : scanner) {

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/RandomWriter.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/RandomWriter.java?rev=1429942&r1=1429941&r2=1429942&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/RandomWriter.java
(original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/RandomWriter.java
Mon Jan  7 18:41:55 2013
@@ -20,6 +20,7 @@ import java.util.Iterator;
 import java.util.Random;
 
 import org.apache.accumulo.server.cli.ClientOnDefaultTable;
+import org.apache.accumulo.core.cli.BatchWriterOpts;
 import org.apache.accumulo.core.client.BatchWriter;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.data.Mutation;
@@ -83,13 +84,14 @@ public class RandomWriter {
   }
   public static void main(String[] args) throws Exception {
     Opts opts = new Opts(table_name);
-    opts.parseArgs(RandomWriter.class.getName(), args);
+    BatchWriterOpts bwOpts = new BatchWriterOpts();
+    opts.parseArgs(RandomWriter.class.getName(), args, bwOpts);
     
     long start = System.currentTimeMillis();
     log.info("starting at " + start + " for user " + opts.user);
     try {
       Connector connector = opts.getConnector();
-      BatchWriter bw = connector.createBatchWriter(opts.getTableName(), opts.getBatchWriterConfig());
+      BatchWriter bw = connector.createBatchWriter(opts.getTableName(), bwOpts.getBatchWriterConfig());
       log.info("Writing " + opts.count + " mutations...");
       bw.addMutations(new RandomMutationGenerator(opts.count));
       bw.close();

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/RemoveEntriesForMissingFiles.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/RemoveEntriesForMissingFiles.java?rev=1429942&r1=1429941&r2=1429942&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/RemoveEntriesForMissingFiles.java
(original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/RemoveEntriesForMissingFiles.java
Mon Jan  7 18:41:55 2013
@@ -20,6 +20,8 @@ import java.util.Map.Entry;
 
 import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.server.cli.ClientOpts;
+import org.apache.accumulo.core.cli.BatchWriterOpts;
+import org.apache.accumulo.core.cli.ScannerOpts;
 import org.apache.accumulo.core.client.BatchWriter;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.Scanner;
@@ -49,18 +51,20 @@ public class RemoveEntriesForMissingFile
   
   public static void main(String[] args) throws Exception {
     Opts opts = new Opts();
-    opts.parseArgs(RemoveEntriesForMissingFiles.class.getName(), args);
+    ScannerOpts scanOpts = new ScannerOpts();
+    BatchWriterOpts bwOpts = new BatchWriterOpts();
+    opts.parseArgs(RemoveEntriesForMissingFiles.class.getName(), args, scanOpts, bwOpts);
     FileSystem fs = FileSystem.get(CachedConfiguration.getInstance());
     Connector connector = opts.getConnector();
     Scanner metadata = connector.createScanner(Constants.METADATA_TABLE_NAME, opts.auths);
-    metadata.setBatchSize(opts.scanBatchSize);
+    metadata.setBatchSize(scanOpts.scanBatchSize);
     metadata.setRange(Constants.METADATA_KEYSPACE);
     metadata.fetchColumnFamily(Constants.METADATA_DATAFILE_COLUMN_FAMILY);
     int count = 0;
     int missing = 0;
     BatchWriter writer = null; 
     if (opts.fix)
-      writer = connector.createBatchWriter(Constants.METADATA_TABLE_NAME, opts.getBatchWriterConfig());
+      writer = connector.createBatchWriter(Constants.METADATA_TABLE_NAME, bwOpts.getBatchWriterConfig());
     for (Entry<Key,Value> entry : metadata) {
       count++;
       Key key = entry.getKey();



Mime
View raw message