accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r1437726 [10/10] - in /accumulo/branches/ACCUMULO-259: ./ assemble/ conf/examples/1GB/native-standalone/ conf/examples/1GB/standalone/ conf/examples/2GB/native-standalone/ conf/examples/2GB/standalone/ conf/examples/3GB/native-standalone/ c...
Date Wed, 23 Jan 2013 20:52:04 GMT
Modified: accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java?rev=1437726&r1=1437725&r2=1437726&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java (original)
+++ accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java Wed Jan 23 20:51:59 2013
@@ -110,6 +110,7 @@ import org.apache.accumulo.core.security
 import org.apache.accumulo.core.security.thrift.ThriftInstanceTokenWrapper;
 import org.apache.accumulo.core.security.thrift.ThriftSecurityException;
 import org.apache.accumulo.core.security.tokens.InstanceTokenWrapper;
+import org.apache.accumulo.core.tabletserver.thrift.ActiveCompaction;
 import org.apache.accumulo.core.tabletserver.thrift.ActiveScan;
 import org.apache.accumulo.core.tabletserver.thrift.ConstraintViolationException;
 import org.apache.accumulo.core.tabletserver.thrift.NoSuchScanIDException;
@@ -159,10 +160,12 @@ import org.apache.accumulo.server.securi
 import org.apache.accumulo.server.security.SecurityConstants;
 import org.apache.accumulo.server.security.SecurityOperation;
 import org.apache.accumulo.server.security.SecurityUtil;
+import org.apache.accumulo.server.tabletserver.Compactor.CompactionInfo;
 import org.apache.accumulo.server.tabletserver.Tablet.CommitSession;
 import org.apache.accumulo.server.tabletserver.Tablet.KVEntry;
 import org.apache.accumulo.server.tabletserver.Tablet.LookupResult;
 import org.apache.accumulo.server.tabletserver.Tablet.MajorCompactionReason;
+import org.apache.accumulo.server.tabletserver.Tablet.MinorCompactionReason;
 import org.apache.accumulo.server.tabletserver.Tablet.ScanBatch;
 import org.apache.accumulo.server.tabletserver.Tablet.Scanner;
 import org.apache.accumulo.server.tabletserver.Tablet.SplitInfo;
@@ -2103,6 +2106,24 @@ public class TabletServer extends Abstra
       }
     }
     
+    @Override
+    public List<ActiveCompaction> getActiveCompactions(TInfo tinfo, ThriftInstanceTokenWrapper credentials) throws ThriftSecurityException, TException {
+      try {
+        checkPermission(new InstanceTokenWrapper(credentials), null, true, "getActiveCompactions");
+      } catch (ThriftSecurityException e) {
+        log.error(e, e);
+        throw new RuntimeException(e);
+      }
+      
+      List<CompactionInfo> compactions = Compactor.getRunningCompactions();
+      List<ActiveCompaction> ret = new ArrayList<ActiveCompaction>(compactions.size());
+      
+      for (CompactionInfo compactionInfo : compactions) {
+        ret.add(compactionInfo.toThrift());
+      }
+      
+      return ret;
+    }
   }
   
   private class SplitRunner implements Runnable {
@@ -2174,7 +2195,7 @@ public class TabletServer extends Abstra
             
             if (tablet.getLogCount() >= maxLogEntriesPerTablet) {
               log.debug("Initiating minor compaction for " + tablet.getExtent() + " because it has " + tablet.getLogCount() + " write ahead logs");
-              tablet.initiateMinorCompaction();
+              tablet.initiateMinorCompaction(MinorCompactionReason.SYSTEM);
             }
             
             synchronized (tablet) {
@@ -2500,7 +2521,7 @@ public class TabletServer extends Abstra
            * it to the logs (the file will be in !METADATA, preventing replay of compacted data)... but do not want a majc to wipe the file out from !METADATA
            * and then have another process failure... this could cause duplicate data to replay
            */
-          if (tablet.getNumEntriesInMemory() > 0 && !tablet.minorCompactNow()) {
+          if (tablet.getNumEntriesInMemory() > 0 && !tablet.minorCompactNow(MinorCompactionReason.SYSTEM)) {
             throw new RuntimeException("Minor compaction after recovery fails for " + extentToOpen);
           }
           

Modified: accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServerResourceManager.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServerResourceManager.java?rev=1437726&r1=1437725&r2=1437726&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServerResourceManager.java (original)
+++ accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServerResourceManager.java Wed Jan 23 20:51:59 2013
@@ -51,6 +51,7 @@ import org.apache.accumulo.core.util.Uti
 import org.apache.accumulo.server.conf.ServerConfiguration;
 import org.apache.accumulo.server.tabletserver.FileManager.ScanFileManager;
 import org.apache.accumulo.server.tabletserver.Tablet.MajorCompactionReason;
+import org.apache.accumulo.server.tabletserver.Tablet.MinorCompactionReason;
 import org.apache.accumulo.server.util.time.SimpleTimer;
 import org.apache.accumulo.start.classloader.vfs.AccumuloVFSClassLoader;
 import org.apache.hadoop.fs.FileSystem;
@@ -349,7 +350,7 @@ public class TabletServerResourceManager
                 continue;
               }
               
-              if (!tabletReport.getTablet().initiateMinorCompaction()) {
+              if (!tabletReport.getTablet().initiateMinorCompaction(MinorCompactionReason.SYSTEM)) {
                 if (tabletReport.getTablet().isClosed()) {
                   tabletReports.remove(tabletReport.getExtent());
                   log.debug("Ignoring memory manager recommendation: not minor compacting closed tablet " + keyExtent);
@@ -545,7 +546,7 @@ public class TabletServerResourceManager
     // when too many files are open, we may want tablets to compact down
     // to one map file
     Map<String,Long> findMapFilesToCompact(SortedMap<String,DataFileValue> tabletFiles, MajorCompactionReason reason) {
-      if (reason == MajorCompactionReason.ALL) {
+      if (reason == MajorCompactionReason.USER) {
         Map<String,Long> files = new HashMap<String,Long>();
         for (Entry<String,DataFileValue> entry : tabletFiles.entrySet()) {
           files.put(entry.getKey(), entry.getValue().getSize());
@@ -634,7 +635,7 @@ public class TabletServerResourceManager
         
       // int threshold;
       
-      if (reason == MajorCompactionReason.ALL)
+      if (reason == MajorCompactionReason.USER)
         return true;
       
       if (reason == MajorCompactionReason.IDLE) {

Modified: accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/test/continuous/ContinuousMoru.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/test/continuous/ContinuousMoru.java?rev=1437726&r1=1437725&r2=1437726&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/test/continuous/ContinuousMoru.java (original)
+++ accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/test/continuous/ContinuousMoru.java Wed Jan 23 20:51:59 2013
@@ -44,8 +44,8 @@ import com.beust.jcommander.Parameter;
 import com.beust.jcommander.validators.PositiveInteger;
 
 /**
- * A map only job that reads a table created by continuous ingest and creates doubly linked list. This map reduce job tests the ability of a map only job to read and
- * write to accumulo at the same time. This map reduce job mutates the table in such a way that it should not create any undefined nodes.
+ * A map only job that reads a table created by continuous ingest and creates doubly linked list. This map reduce job tests the ability of a map only job to
+ * read and write to accumulo at the same time. This map reduce job mutates the table in such a way that it should not create any undefined nodes.
  * 
  */
 public class ContinuousMoru extends Configured implements Tool {
@@ -70,7 +70,8 @@ public class ContinuousMoru extends Conf
     private long count;
     
     private static final ColumnVisibility EMPTY_VIS = new ColumnVisibility();
-
+    
+    @Override
     public void setup(Context context) throws IOException, InterruptedException {
       int max_cf = context.getConfiguration().getInt(MAX_CF, -1);
       int max_cq = context.getConfiguration().getInt(MAX_CQ, -1);
@@ -88,6 +89,7 @@ public class ContinuousMoru extends Conf
       count = 0;
     }
     
+    @Override
     public void map(Key key, Value data, Context context) throws IOException, InterruptedException {
       
       ContinuousWalk.validate(key, data);
@@ -100,8 +102,7 @@ public class ContinuousMoru extends Conf
         if (offset > 0) {
           long rowLong = Long.parseLong(new String(val, offset, 16), 16);
           Mutation m = ContinuousIngest.genMutation(rowLong, random.nextInt(max_cf), random.nextInt(max_cq), EMPTY_VIS, iiId, count++, key.getRowData()
-              .toArray(), random,
-              true);
+              .toArray(), random, true);
           context.write(null, m);
         }
         
@@ -112,13 +113,13 @@ public class ContinuousMoru extends Conf
   }
   
   static class Opts extends BaseOpts {
-    @Parameter(names="--maxColF", description="maximum column family value to use")
+    @Parameter(names = "--maxColF", description = "maximum column family value to use")
     short maxColF = Short.MAX_VALUE;
     
-    @Parameter(names="--maxColQ", description="maximum column qualifier value to use")
+    @Parameter(names = "--maxColQ", description = "maximum column qualifier value to use")
     short maxColQ = Short.MAX_VALUE;
- 
-    @Parameter(names="--maxMappers", description="the maximum number of mappers to use", required=true, validateWith=PositiveInteger.class)
+    
+    @Parameter(names = "--maxMappers", description = "the maximum number of mappers to use", required = true, validateWith = PositiveInteger.class)
     int maxMaps = 0;
   }
   
@@ -137,8 +138,8 @@ public class ContinuousMoru extends Conf
     // set up ranges
     try {
       Set<Range> ranges = opts.getConnector().tableOperations().splitRangeByTablets(opts.getTableName(), new Range(), opts.maxMaps);
-      AccumuloInputFormat.setRanges(job.getConfiguration(), ranges);
-      AccumuloInputFormat.disableAutoAdjustRanges(job.getConfiguration());
+      AccumuloInputFormat.setRanges(job, ranges);
+      AccumuloInputFormat.setAutoAdjustRanges(job, false);
     } catch (Exception e) {
       throw new IOException(e);
     }
@@ -148,9 +149,7 @@ public class ContinuousMoru extends Conf
     job.setNumReduceTasks(0);
     
     job.setOutputFormatClass(AccumuloOutputFormat.class);
-    AccumuloOutputFormat.setMaxLatency(job.getConfiguration(), (int) (bwOpts.batchLatency / 1000.0));
-    AccumuloOutputFormat.setMaxMutationBufferSize(job.getConfiguration(), bwOpts.batchMemory);
-    AccumuloOutputFormat.setMaxWriteThreads(job.getConfiguration(), bwOpts.batchThreads);
+    AccumuloOutputFormat.setBatchWriterOptions(job, bwOpts.getBatchWriterConfig());
     
     Configuration conf = job.getConfiguration();
     conf.setLong(MIN, opts.min);

Modified: accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/test/continuous/ContinuousVerify.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/test/continuous/ContinuousVerify.java?rev=1437726&r1=1437725&r2=1437726&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/test/continuous/ContinuousVerify.java (original)
+++ accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/test/continuous/ContinuousVerify.java Wed Jan 23 20:51:59 2013
@@ -62,6 +62,7 @@ public class ContinuousVerify extends Co
     
     private long corrupt = 0;
     
+    @Override
     public void map(Key key, Value data, Context context) throws IOException, InterruptedException {
       long r = Long.parseLong(key.getRow().toString(), 16);
       if (r < 0)
@@ -101,6 +102,7 @@ public class ContinuousVerify extends Co
   public static class CReducer extends Reducer<LongWritable,VLongWritable,Text,Text> {
     private ArrayList<Long> refs = new ArrayList<Long>();
     
+    @Override
     public void reduce(LongWritable key, Iterable<VLongWritable> values, Context context) throws IOException, InterruptedException {
       
       int defCount = 0;
@@ -136,19 +138,21 @@ public class ContinuousVerify extends Co
   }
   
   static class Opts extends ClientOnDefaultTable {
-    @Parameter(names="--output", description="location in HDFS to store the results; must not exist", required=true)
+    @Parameter(names = "--output", description = "location in HDFS to store the results; must not exist", required = true)
     String outputDir = "/tmp/continuousVerify";
     
-    @Parameter(names="--maxMappers", description="the maximum number of mappers to use", required=true, validateWith=PositiveInteger.class)
+    @Parameter(names = "--maxMappers", description = "the maximum number of mappers to use", required = true, validateWith = PositiveInteger.class)
     int maxMaps = 0;
     
-    @Parameter(names="--reducers", description="the number of reducers to use", required=true, validateWith=PositiveInteger.class)
+    @Parameter(names = "--reducers", description = "the number of reducers to use", required = true, validateWith = PositiveInteger.class)
     int reducers = 0;
     
-    @Parameter(names="--offline", description="perform the verification directly on the files while the table is offline")
+    @Parameter(names = "--offline", description = "perform the verification directly on the files while the table is offline")
     boolean scanOffline = false;
     
-    public Opts() { super("ci"); }
+    public Opts() {
+      super("ci");
+    }
   }
   
   @Override
@@ -168,17 +172,17 @@ public class ContinuousVerify extends Co
       conn.tableOperations().clone(opts.getTableName(), clone, true, new HashMap<String,String>(), new HashSet<String>());
       conn.tableOperations().offline(clone);
     }
-
+    
     job.setInputFormatClass(AccumuloInputFormat.class);
-
+    
     opts.setAccumuloConfigs(job);
-    AccumuloInputFormat.setScanOffline(job.getConfiguration(), opts.scanOffline);
-
+    AccumuloInputFormat.setOfflineTableScan(job, opts.scanOffline);
+    
     // set up ranges
     try {
       Set<Range> ranges = opts.getConnector().tableOperations().splitRangeByTablets(opts.getTableName(), new Range(), opts.maxMaps);
-      AccumuloInputFormat.setRanges(job.getConfiguration(), ranges);
-      AccumuloInputFormat.disableAutoAdjustRanges(job.getConfiguration());
+      AccumuloInputFormat.setRanges(job, ranges);
+      AccumuloInputFormat.setAutoAdjustRanges(job, false);
     } catch (Exception e) {
       throw new IOException(e);
     }
@@ -193,7 +197,7 @@ public class ContinuousVerify extends Co
     job.setOutputFormatClass(TextOutputFormat.class);
     
     job.getConfiguration().setBoolean("mapred.map.tasks.speculative.execution", opts.scanOffline);
-
+    
     TextOutputFormat.setOutputPath(job, new Path(opts.outputDir));
     
     job.waitForCompletion(true);

Modified: accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/test/continuous/GenSplits.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/test/continuous/GenSplits.java?rev=1437726&r1=1437725&r2=1437726&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/test/continuous/GenSplits.java (original)
+++ accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/test/continuous/GenSplits.java Wed Jan 23 20:51:59 2013
@@ -16,30 +16,65 @@
  */
 package org.apache.accumulo.server.test.continuous;
 
+import java.util.List;
+
+import com.beust.jcommander.JCommander;
+import com.beust.jcommander.Parameter;
+import com.beust.jcommander.ParameterException;
+
 /**
  * 
  */
 public class GenSplits {
+  
+  static class Opts {
+    @Parameter(names = "--min", description = "minimum row")
+    long minRow = 0;
+    
+    @Parameter(names = "--max", description = "maximum row")
+    long maxRow = Long.MAX_VALUE;
+    
+    @Parameter(description = "<num tablets>")
+    List<String> args = null;
+  }
+
   public static void main(String[] args) {
     
-    if (args.length != 1) {
-      System.err.println("Usage: " + GenSplits.class.getName() + " <num tablets>");
+    Opts opts = new Opts();
+    JCommander jcommander = new JCommander(opts);
+    jcommander.setProgramName(GenSplits.class.getSimpleName());
+    
+    try {
+      jcommander.parse(args);
+    } catch (ParameterException pe) {
+      System.err.println(pe.getMessage());
+      jcommander.usage();
+      System.exit(-1);
+    }
+
+    if (opts.args == null || opts.args.size() != 1) {
+      jcommander.usage();
       System.exit(-1);
     }
     
-    int numTablets = Integer.parseInt(args[0]);
+    int numTablets = Integer.parseInt(opts.args.get(0));
     
     if (numTablets < 1) {
       System.err.println("ERROR: numTablets < 1");
       System.exit(-1);
     }
     
+    if (opts.minRow >= opts.maxRow) {
+      System.err.println("ERROR: min >= max");
+      System.exit(-1);
+    }
+
     int numSplits = numTablets - 1;
-    long distance = (Long.MAX_VALUE / numTablets) + 1;
+    long distance = ((opts.maxRow - opts.minRow) / numTablets) + 1;
     long split = distance;
     for (int i = 0; i < numSplits; i++) {
       
-      String s = String.format("%016x", split);
+      String s = String.format("%016x", split + opts.minRow);
       
       while (s.charAt(s.length() - 1) == '0') {
         s = s.substring(0, s.length() - 1);

Modified: accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/test/functional/FunctionalTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/test/functional/FunctionalTest.java?rev=1437726&r1=1437725&r2=1437726&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/test/functional/FunctionalTest.java (original)
+++ accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/test/functional/FunctionalTest.java Wed Jan 23 20:51:59 2013
@@ -16,7 +16,6 @@
  */
 package org.apache.accumulo.server.test.functional;
 
-import java.nio.ByteBuffer;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
@@ -40,6 +39,7 @@ import org.apache.accumulo.core.data.Key
 import org.apache.accumulo.core.data.Mutation;
 import org.apache.accumulo.core.data.Range;
 import org.apache.accumulo.core.data.Value;
+import org.apache.accumulo.core.security.tokens.AccumuloToken;
 import org.apache.accumulo.core.security.tokens.InstanceTokenWrapper;
 import org.apache.accumulo.core.security.tokens.UserPassToken;
 import org.apache.accumulo.server.cli.ClientOpts;
@@ -106,28 +106,19 @@ public abstract class FunctionalTest {
     
   }
   
-  private String username = "";
-  private String password = "";
+  private AccumuloToken<?,?> token = new UserPassToken("", "");
   private String instanceName = "";
   
-  protected void setUsername(String username) {
-    this.username = username;
+  protected void setToken(AccumuloToken<?,?> token) {
+    this.token = token;
   }
   
-  protected String getUsername() {
-    return username;
-  }
-  
-  protected void setPassword(String password) {
-    this.password = password;
-  }
-  
-  protected String getPassword() {
-    return password;
+  protected AccumuloToken<?,?> getToken() {
+    return token;
   }
   
   protected Connector getConnector() throws AccumuloException, AccumuloSecurityException {
-    return getInstance().getConnector(username, password.getBytes());
+    return getInstance().getConnector(getToken());
   }
   
   protected Instance getInstance() {
@@ -143,7 +134,7 @@ public abstract class FunctionalTest {
   }
   
   protected InstanceTokenWrapper getCredentials() {
-    return new InstanceTokenWrapper(new UserPassToken(getUsername(), ByteBuffer.wrap(getPassword().getBytes())), getInstance().getInstanceID());
+    return new InstanceTokenWrapper(getToken(), getInstance().getInstanceID());
   }
   
   public abstract Map<String,String> getInitialConfig();
@@ -258,8 +249,7 @@ public abstract class FunctionalTest {
     FunctionalTest fTest = testClass.newInstance();
     
     //fTest.setMaster(master);
-    fTest.setUsername(opts.user);
-    fTest.setPassword(new String(opts.getPassword()));
+    fTest.setToken(opts.getAccumuloToken());
     fTest.setInstanceName(opts.instance);
     
     if (opts.opt.equals("getConfig")) {

Modified: accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/test/functional/VisibilityTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/test/functional/VisibilityTest.java?rev=1437726&r1=1437725&r2=1437726&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/test/functional/VisibilityTest.java (original)
+++ accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/test/functional/VisibilityTest.java Wed Jan 23 20:51:59 2013
@@ -205,7 +205,7 @@ public class VisibilityTest extends Func
   
   private void queryData(Set<String> allAuths, Set<String> userAuths, Map<Set<String>,Set<String>> expected) throws Exception {
     
-    getConnector().securityOperations().changeUserAuthorizations(getUsername(), new Authorizations(nbas(userAuths)));
+    getConnector().securityOperations().changeUserAuthorizations(getToken().getPrincipal(), new Authorizations(nbas(userAuths)));
     
     ArrayList<Set<String>> combos = new ArrayList<Set<String>>();
     uniqueCombos(combos, nss(), allAuths);
@@ -232,7 +232,7 @@ public class VisibilityTest extends Func
     Scanner scanner;
     
     // should return no records
-    getConnector().securityOperations().changeUserAuthorizations(getUsername(), new Authorizations("BASE", "DEFLABEL"));
+    getConnector().securityOperations().changeUserAuthorizations(getToken().getPrincipal(), new Authorizations("BASE", "DEFLABEL"));
     scanner = getConnector().createScanner("vt2", new Authorizations());
     verifyDefault(scanner, 0);
     

Modified: accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/test/performance/thrift/NullTserver.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/test/performance/thrift/NullTserver.java?rev=1437726&r1=1437725&r2=1437726&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/test/performance/thrift/NullTserver.java (original)
+++ accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/test/performance/thrift/NullTserver.java Wed Jan 23 20:51:59 2013
@@ -49,6 +49,7 @@ import org.apache.accumulo.core.master.t
 import org.apache.accumulo.core.security.thrift.ThriftInstanceTokenWrapper;
 import org.apache.accumulo.core.security.thrift.SecurityErrorCode;
 import org.apache.accumulo.core.security.thrift.ThriftSecurityException;
+import org.apache.accumulo.core.tabletserver.thrift.ActiveCompaction;
 import org.apache.accumulo.core.tabletserver.thrift.ActiveScan;
 import org.apache.accumulo.core.tabletserver.thrift.TabletClientService;
 import org.apache.accumulo.core.tabletserver.thrift.TabletClientService.Iface;
@@ -202,6 +203,11 @@ public class NullTserver {
     @Override
     public void removeLogs(TInfo tinfo, ThriftInstanceTokenWrapper credentials, List<String> filenames) throws TException {
     }
+    
+    @Override
+    public List<ActiveCompaction> getActiveCompactions(TInfo tinfo, ThriftInstanceTokenWrapper credentials) throws ThriftSecurityException, TException {
+      return new ArrayList<ActiveCompaction>();
+    }
   }
   
   static class Opts extends Help {

Modified: accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/test/randomwalk/multitable/CopyTool.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/test/randomwalk/multitable/CopyTool.java?rev=1437726&r1=1437725&r2=1437726&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/test/randomwalk/multitable/CopyTool.java (original)
+++ accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/test/randomwalk/multitable/CopyTool.java Wed Jan 23 20:51:59 2013
@@ -18,12 +18,13 @@ package org.apache.accumulo.server.test.
 
 import java.io.IOException;
 
+import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.mapreduce.AccumuloInputFormat;
 import org.apache.accumulo.core.client.mapreduce.AccumuloOutputFormat;
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Mutation;
 import org.apache.accumulo.core.data.Value;
-import org.apache.accumulo.core.security.Authorizations;
+import org.apache.accumulo.core.security.tokens.UserPassToken;
 import org.apache.hadoop.conf.Configured;
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.mapreduce.Job;
@@ -35,6 +36,7 @@ public class CopyTool extends Configured
   protected final Logger log = Logger.getLogger(this.getClass());
   
   public static class SeqMapClass extends Mapper<Key,Value,Text,Mutation> {
+    @Override
     public void map(Key key, Value val, Context output) throws IOException, InterruptedException {
       Mutation m = new Mutation(key.getRow());
       m.put(key.getColumnFamily(), key.getColumnQualifier(), val);
@@ -42,6 +44,7 @@ public class CopyTool extends Configured
     }
   }
   
+  @Override
   public int run(String[] args) throws Exception {
     Job job = new Job(getConf(), this.getClass().getSimpleName());
     job.setJarByClass(this.getClass());
@@ -52,8 +55,10 @@ public class CopyTool extends Configured
     }
     
     job.setInputFormatClass(AccumuloInputFormat.class);
-    AccumuloInputFormat.setInputInfo(job.getConfiguration(), args[0], args[1].getBytes(), args[2], new Authorizations());
-    AccumuloInputFormat.setZooKeeperInstance(job.getConfiguration(), args[3], args[4]);
+    AccumuloInputFormat.setConnectorInfo(job, new UserPassToken(args[0], args[1]));
+    AccumuloInputFormat.setInputTableName(job, args[2]);
+    AccumuloInputFormat.setScanAuthorizations(job, Constants.NO_AUTHS);
+    AccumuloInputFormat.setZooKeeperInstance(job, args[3], args[4]);
     
     job.setMapperClass(SeqMapClass.class);
     job.setMapOutputKeyClass(Text.class);
@@ -62,8 +67,10 @@ public class CopyTool extends Configured
     job.setNumReduceTasks(0);
     
     job.setOutputFormatClass(AccumuloOutputFormat.class);
-    AccumuloOutputFormat.setOutputInfo(job.getConfiguration(), args[0], args[1].getBytes(), true, args[5]);
-    AccumuloOutputFormat.setZooKeeperInstance(job.getConfiguration(), args[3], args[4]);
+    AccumuloOutputFormat.setConnectorInfo(job, new UserPassToken(args[0], args[1]));
+    AccumuloOutputFormat.setCreateTables(job, true);
+    AccumuloOutputFormat.setDefaultTableName(job, args[5]);
+    AccumuloOutputFormat.setZooKeeperInstance(job, args[3], args[4]);
     
     job.waitForCompletion(true);
     return job.isSuccessful() ? 0 : 1;

Modified: accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/test/randomwalk/sequential/MapRedVerifyTool.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/test/randomwalk/sequential/MapRedVerifyTool.java?rev=1437726&r1=1437725&r2=1437726&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/test/randomwalk/sequential/MapRedVerifyTool.java (original)
+++ accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/test/randomwalk/sequential/MapRedVerifyTool.java Wed Jan 23 20:51:59 2013
@@ -24,7 +24,7 @@ import org.apache.accumulo.core.client.m
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Mutation;
 import org.apache.accumulo.core.data.Value;
-import org.apache.accumulo.core.security.Authorizations;
+import org.apache.accumulo.core.security.tokens.UserPassToken;
 import org.apache.hadoop.conf.Configured;
 import org.apache.hadoop.io.IntWritable;
 import org.apache.hadoop.io.NullWritable;
@@ -39,6 +39,7 @@ public class MapRedVerifyTool extends Co
   protected final Logger log = Logger.getLogger(this.getClass());
   
   public static class SeqMapClass extends Mapper<Key,Value,NullWritable,IntWritable> {
+    @Override
     public void map(Key row, Value data, Context output) throws IOException, InterruptedException {
       Integer num = Integer.valueOf(row.getRow().toString());
       output.write(NullWritable.get(), new IntWritable(num.intValue()));
@@ -74,6 +75,7 @@ public class MapRedVerifyTool extends Co
     }
   }
   
+  @Override
   public int run(String[] args) throws Exception {
     Job job = new Job(getConf(), this.getClass().getSimpleName());
     job.setJarByClass(this.getClass());
@@ -84,8 +86,9 @@ public class MapRedVerifyTool extends Co
     }
     
     job.setInputFormatClass(AccumuloInputFormat.class);
-    AccumuloInputFormat.setInputInfo(job.getConfiguration(), args[0], args[1].getBytes(), args[2], new Authorizations());
-    AccumuloInputFormat.setZooKeeperInstance(job.getConfiguration(), args[3], args[4]);
+    AccumuloInputFormat.setConnectorInfo(job, new UserPassToken(args[0], args[1]));
+    AccumuloInputFormat.setInputTableName(job, args[2]);
+    AccumuloInputFormat.setZooKeeperInstance(job, args[3], args[4]);
     
     job.setMapperClass(SeqMapClass.class);
     job.setMapOutputKeyClass(NullWritable.class);
@@ -95,8 +98,10 @@ public class MapRedVerifyTool extends Co
     job.setNumReduceTasks(1);
     
     job.setOutputFormatClass(AccumuloOutputFormat.class);
-    AccumuloOutputFormat.setOutputInfo(job.getConfiguration(), args[0], args[1].getBytes(), true, args[5]);
-    AccumuloOutputFormat.setZooKeeperInstance(job.getConfiguration(), args[3], args[4]);
+    AccumuloOutputFormat.setConnectorInfo(job, new UserPassToken(args[0], args[1]));
+    AccumuloOutputFormat.setCreateTables(job, true);
+    AccumuloOutputFormat.setDefaultTableName(job, args[5]);
+    AccumuloOutputFormat.setZooKeeperInstance(job, args[3], args[4]);
     
     job.waitForCompletion(true);
     return job.isSuccessful() ? 0 : 1;

Modified: accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/util/Admin.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/util/Admin.java?rev=1437726&r1=1437725&r2=1437726&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/util/Admin.java (original)
+++ accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/util/Admin.java Wed Jan 23 20:51:59 2013
@@ -82,7 +82,7 @@ public class Admin {
       
     try {
       InstanceTokenWrapper creds;
-      if (opts.getPassword() == null) {
+      if (opts.getAccumuloToken() == null) {
         creds = SecurityConstants.getSystemCredentials();
       } else {
         creds = opts.getWrappedToken();

Modified: accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/util/VerifyTabletAssignments.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/util/VerifyTabletAssignments.java?rev=1437726&r1=1437725&r2=1437726&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/util/VerifyTabletAssignments.java (original)
+++ accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/util/VerifyTabletAssignments.java Wed Jan 23 20:51:59 2013
@@ -16,7 +16,6 @@
  */
 package org.apache.accumulo.server.util;
 
-import java.nio.ByteBuffer;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashSet;
@@ -48,8 +47,8 @@ import org.apache.accumulo.core.data.thr
 import org.apache.accumulo.core.data.thrift.TKeyExtent;
 import org.apache.accumulo.core.data.thrift.TRange;
 import org.apache.accumulo.core.security.thrift.ThriftSecurityException;
+import org.apache.accumulo.core.security.tokens.AccumuloToken;
 import org.apache.accumulo.core.security.tokens.InstanceTokenWrapper;
-import org.apache.accumulo.core.security.tokens.UserPassToken;
 import org.apache.accumulo.core.tabletserver.thrift.NoSuchScanIDException;
 import org.apache.accumulo.core.tabletserver.thrift.TabletClientService;
 import org.apache.accumulo.core.util.ThriftUtil;
@@ -93,7 +92,7 @@ public class VerifyTabletAssignments {
     
     Connector conn = opts.getConnector();
     Instance inst = conn.getInstance();
-    MetadataTable.getEntries(conn.getInstance(), new InstanceTokenWrapper(new UserPassToken(opts.user, ByteBuffer.wrap(opts.getPassword())), inst.getInstanceID()), tableName, false, locations, tablets);
+    MetadataTable.getEntries(conn.getInstance(), new InstanceTokenWrapper(opts.getWrappedToken().toThrift()), tableName, false, locations, tablets);
     
     final HashSet<KeyExtent> failures = new HashSet<KeyExtent>();
     
@@ -124,7 +123,7 @@ public class VerifyTabletAssignments {
         @Override
         public void run() {
           try {
-            checkTabletServer(conf.getConfiguration(), opts.user, ByteBuffer.wrap(opts.getPassword()), entry, failures);
+            checkTabletServer(conf.getConfiguration(), opts.getAccumuloToken(), entry, failures);
           } catch (Exception e) {
             System.err.println("Failure on ts " + entry.getKey() + " " + e.getMessage());
             e.printStackTrace();
@@ -153,12 +152,12 @@ public class VerifyTabletAssignments {
     }
   }
   
-  private static void checkTabletServer(AccumuloConfiguration conf, final String user, final ByteBuffer pass, Entry<String,List<KeyExtent>> entry,
+  private static void checkTabletServer(AccumuloConfiguration conf, final AccumuloToken<?,?> token, Entry<String,List<KeyExtent>> entry,
       HashSet<KeyExtent> failures)
       throws ThriftSecurityException, TException, NoSuchScanIDException {
     TabletClientService.Iface client = ThriftUtil.getTServerClient(entry.getKey(), conf);
     
-    InstanceTokenWrapper st = new InstanceTokenWrapper(new UserPassToken(user, pass), HdfsZooInstance.getInstance().getInstanceID());
+    InstanceTokenWrapper st = new InstanceTokenWrapper(token, HdfsZooInstance.getInstance().getInstanceID());
     Map<TKeyExtent,List<TRange>> batch = new TreeMap<TKeyExtent,List<TRange>>();
     
     for (KeyExtent keyExtent : entry.getValue()) {

Propchange: accumulo/branches/ACCUMULO-259/src/
------------------------------------------------------------------------------
  Merged /accumulo/trunk/src:r1433135-1437607

Modified: accumulo/branches/ACCUMULO-259/start/src/main/java/org/apache/accumulo/start/Main.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/start/src/main/java/org/apache/accumulo/start/Main.java?rev=1437726&r1=1437725&r2=1437726&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/start/src/main/java/org/apache/accumulo/start/Main.java (original)
+++ accumulo/branches/ACCUMULO-259/start/src/main/java/org/apache/accumulo/start/Main.java Wed Jan 23 20:51:59 2013
@@ -60,6 +60,8 @@ public class Main {
         runTMP = cl.loadClass("org.apache.accumulo.server.monitor.Monitor");
       } else if (args[0].equals("tracer")) {
         runTMP = cl.loadClass("org.apache.accumulo.server.trace.TraceServer");
+      } else if (args[0].equals("proxy")) {
+        runTMP = cl.loadClass("org.apache.accumulo.proxy.Proxy");
       } else if (args[0].equals("classpath")) {
         vfsClassLoader.getMethod("printClassPath", new Class[] {}).invoke(vfsClassLoader, new Object[] {});
         return;

Modified: accumulo/branches/ACCUMULO-259/start/src/main/java/org/apache/accumulo/start/classloader/AccumuloClassLoader.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/start/src/main/java/org/apache/accumulo/start/classloader/AccumuloClassLoader.java?rev=1437726&r1=1437725&r2=1437726&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/start/src/main/java/org/apache/accumulo/start/classloader/AccumuloClassLoader.java (original)
+++ accumulo/branches/ACCUMULO-259/start/src/main/java/org/apache/accumulo/start/classloader/AccumuloClassLoader.java Wed Jan 23 20:51:59 2013
@@ -44,19 +44,16 @@ import org.w3c.dom.NodeList;
 public class AccumuloClassLoader {
   
   public static final String CLASSPATH_PROPERTY_NAME = "general.classpaths";
-
-  public static final String ACCUMULO_CLASSPATH_VALUE = "$ACCUMULO_HOME/conf,\n" 
-      + "$ACCUMULO_HOME/lib/[^.].*.jar,\n" 
-      + "$ZOOKEEPER_HOME/zookeeper[^.].*.jar,\n" 
-      + "$HADOOP_PREFIX/[^.].*.jar,\n" + "$HADOOP_CONF_DIR,\n"
-      + "$HADOOP_PREFIX/lib/[^.].*.jar,\n";
+  
+  public static final String ACCUMULO_CLASSPATH_VALUE = "$ACCUMULO_HOME/conf,\n" + "$ACCUMULO_HOME/lib/[^.].*.jar,\n"
+      + "$ZOOKEEPER_HOME/zookeeper[^.].*.jar,\n" + "$HADOOP_PREFIX/[^.].*.jar,\n" + "$HADOOP_CONF_DIR,\n" + "$HADOOP_PREFIX/lib/[^.].*.jar,\n";
   
   private static String SITE_CONF;
   
   private static URLClassLoader classloader;
-
+  
   private static Logger log = Logger.getLogger(AccumuloClassLoader.class);
-
+  
   static {
     String configFile = System.getProperty("org.apache.accumulo.config.file", "accumulo-site.xml");
     if (System.getenv("ACCUMULO_HOME") != null) {
@@ -65,12 +62,12 @@ public class AccumuloClassLoader {
     } else {
       SITE_CONF = null;
     }
-
-    //Register the shutdown hook
+    
+    // Register the shutdown hook
     // TODO
     // Runtime.getRuntime().addShutdownHook(new Thread(new AccumuloVFSClassLoaderShutdownThread()));
   }
-
+  
   /**
    * Parses and XML Document for a property node for a <name> with the value propertyName if it finds one the function return that property's value for its
    * <value> node. If not found the function will return null
@@ -93,7 +90,7 @@ public class AccumuloClassLoader {
     }
     return null;
   }
-
+  
   /**
    * Looks for the site configuration file for Accumulo and if it has a property for propertyName return it otherwise returns defaultValue Should throw an
    * exception if the default configuration can not be read;
@@ -130,7 +127,6 @@ public class AccumuloClassLoader {
    * 
    * @param classpath
    * @param env
-   * @return
    */
   public static String replaceEnvVars(String classpath, Map<String,String> env) {
     Pattern envPat = Pattern.compile("\\$[A-Za-z][a-zA-Z0-9_]*");
@@ -147,7 +143,7 @@ public class AccumuloClassLoader {
     }
     return classpath;
   }
-
+  
   /**
    * Populate the list of URLs with the items in the classpath string
    * 
@@ -179,6 +175,7 @@ public class AccumuloClassLoader {
       else {
         if (extDir.getParentFile() != null) {
           File[] extJars = extDir.getParentFile().listFiles(new FilenameFilter() {
+            @Override
             public boolean accept(File dir, String name) {
               return name.matches("^" + extDir.getName());
             }
@@ -198,7 +195,7 @@ public class AccumuloClassLoader {
     }
     
   }
-    
+  
   private static ArrayList<URL> findAccumuloURLs() throws IOException {
     String cp = getAccumuloString(AccumuloClassLoader.CLASSPATH_PROPERTY_NAME, AccumuloClassLoader.ACCUMULO_CLASSPATH_VALUE);
     if (cp == null)
@@ -218,11 +215,12 @@ public class AccumuloClassLoader {
       ArrayList<URL> urls = findAccumuloURLs();
       
       ClassLoader parentClassLoader = ClassLoader.getSystemClassLoader();
-
+      
       log.debug("Create 2nd tier ClassLoader using URLs: " + urls.toString());
       URLClassLoader aClassLoader = new URLClassLoader(urls.toArray(new URL[urls.size()]), parentClassLoader) {
+        @Override
         protected synchronized Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
-
+          
           if (name.startsWith("org.apache.accumulo.start.classloader.vfs")) {
             Class<?> c = findLoadedClass(name);
             if (c == null) {

Modified: accumulo/branches/ACCUMULO-259/start/src/main/java/org/apache/accumulo/start/classloader/vfs/ContextManager.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/start/src/main/java/org/apache/accumulo/start/classloader/vfs/ContextManager.java?rev=1437726&r1=1437725&r2=1437726&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/start/src/main/java/org/apache/accumulo/start/classloader/vfs/ContextManager.java (original)
+++ accumulo/branches/ACCUMULO-259/start/src/main/java/org/apache/accumulo/start/classloader/vfs/ContextManager.java Wed Jan 23 20:51:59 2013
@@ -53,9 +53,9 @@ public class ContextManager {
       loader = null;
     }
   }
-
+  
   private Map<String,Context> contexts = new HashMap<String,Context>();
-
+  
   private volatile ContextsConfig config;
   private FileSystemManager vfs;
   private ReloadingClassLoader parent;
@@ -74,6 +74,7 @@ public class ContextManager {
       this.preDelegation = preDelegation;
     }
     
+    @Override
     public boolean equals(Object o) {
       if (o instanceof ContextConfig) {
         ContextConfig oc = (ContextConfig) o;
@@ -83,6 +84,11 @@ public class ContextManager {
       
       return false;
     }
+    
+    @Override
+    public int hashCode() {
+      return uris.hashCode() + (preDelegation ? Boolean.TRUE : Boolean.FALSE).hashCode();
+    }
   }
   
   public interface ContextsConfig {
@@ -101,7 +107,7 @@ public class ContextManager {
   }
   
   public ClassLoader getClassLoader(String contextName) throws FileSystemException {
-
+    
     ContextConfig cconfig = config.getContextConfig(contextName);
     
     if (cconfig == null)
@@ -127,7 +133,7 @@ public class ContextManager {
     
     if (contextToClose != null)
       contextToClose.close();
-
+    
     ClassLoader loader = context.getClassLoader();
     if (loader == null) {
       // ooppss, context was closed by another thread, try again
@@ -135,12 +141,12 @@ public class ContextManager {
     }
     
     return loader;
-
+    
   }
   
   public <U> Class<? extends U> loadClass(String context, String classname, Class<U> extension) throws ClassNotFoundException {
     try {
-      return (Class<? extends U>) getClassLoader(context).loadClass(classname).asSubclass(extension);
+      return getClassLoader(context).loadClass(classname).asSubclass(extension);
     } catch (IOException e) {
       throw new ClassNotFoundException("IO Error loading class " + classname, e);
     }

Modified: accumulo/branches/ACCUMULO-259/test/src/main/java/org/apache/accumulo/test/MiniAccumuloCluster.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/test/src/main/java/org/apache/accumulo/test/MiniAccumuloCluster.java?rev=1437726&r1=1437725&r2=1437726&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/test/src/main/java/org/apache/accumulo/test/MiniAccumuloCluster.java (original)
+++ accumulo/branches/ACCUMULO-259/test/src/main/java/org/apache/accumulo/test/MiniAccumuloCluster.java Wed Jan 23 20:51:59 2013
@@ -50,14 +50,12 @@ public class MiniAccumuloCluster {
   
   private static final String INSTANCE_SECRET = "DONTTELL";
   private static final String INSTANCE_NAME = "miniInstance";
-
+  
   private static class LogWriter extends Thread {
     private BufferedReader in;
     private BufferedWriter out;
     
     /**
-     * @param errorStream
-     * @param logDir
      * @throws IOException
      */
     public LogWriter(InputStream stream, File logFile) throws IOException {
@@ -81,7 +79,8 @@ public class MiniAccumuloCluster {
       if (out != null)
         out.flush();
     }
-
+    
+    @Override
     public void run() {
       String line;
       
@@ -96,13 +95,13 @@ public class MiniAccumuloCluster {
           out = null;
           in.close();
         }
-
+        
       } catch (IOException e) {
         e.printStackTrace();
       }
     }
   }
-
+  
   private File libDir;
   private File confDir;
   private File zooKeeperDir;
@@ -113,14 +112,14 @@ public class MiniAccumuloCluster {
   
   private Process zooKeeperProcess;
   private Process masterProcess;
-
+  
   private int zooKeeperPort;
   
   private List<LogWriter> logWriters = new ArrayList<MiniAccumuloCluster.LogWriter>();
-
-  private MacConfig config;
+  
+  private MiniAccumuloConfig config;
   private Process[] tabletServerProcesses;
-
+  
   private int getRandomFreePort() {
     Random r = new Random();
     int count = 0;
@@ -146,29 +145,28 @@ public class MiniAccumuloCluster {
     
     throw new RuntimeException("Unable to find port");
   }
-
+  
   private Process exec(Class<? extends Object> clazz, String... args) throws IOException {
     String javaHome = System.getProperty("java.home");
     String javaBin = javaHome + File.separator + "bin" + File.separator + "java";
     String classpath = System.getProperty("java.class.path");
     
     classpath = confDir.getAbsolutePath() + File.pathSeparator + classpath;
-
+    
     String className = clazz.getCanonicalName();
     
     ArrayList<String> argList = new ArrayList<String>();
     
-    argList.addAll(Arrays.asList(javaBin, "-cp", classpath, "-Xmx128m", "-XX:+UseConcMarkSweepGC", "-XX:CMSInitiatingOccupancyFraction=75",
-        className));
+    argList.addAll(Arrays.asList(javaBin, "-cp", classpath, "-Xmx128m", "-XX:+UseConcMarkSweepGC", "-XX:CMSInitiatingOccupancyFraction=75", className));
     argList.addAll(Arrays.asList(args));
     
     ProcessBuilder builder = new ProcessBuilder(argList);
     
     builder.environment().put("ACCUMULO_HOME", config.getDir().getAbsolutePath());
     builder.environment().put("ACCUMULO_LOG_DIR", logDir.getAbsolutePath());
-
+    
     Process process = builder.start();
-
+    
     LogWriter lw;
     lw = new LogWriter(process.getErrorStream(), new File(logDir, clazz.getSimpleName() + "_" + process.hashCode() + ".err"));
     logWriters.add(lw);
@@ -176,19 +174,19 @@ public class MiniAccumuloCluster {
     lw = new LogWriter(process.getInputStream(), new File(logDir, clazz.getSimpleName() + "_" + process.hashCode() + ".out"));
     logWriters.add(lw);
     lw.start();
-
+    
     return process;
   }
-
+  
   private void appendProp(FileWriter fileWriter, Property key, String value, Map<String,String> siteConfig) throws IOException {
     appendProp(fileWriter, key.getKey(), value, siteConfig);
   }
-
+  
   private void appendProp(FileWriter fileWriter, String key, String value, Map<String,String> siteConfig) throws IOException {
     if (!siteConfig.containsKey(key))
       fileWriter.append("<property><name>" + key + "</name><value>" + value + "</value></property>\n");
   }
-
+  
   /**
    * 
    * @param dir
@@ -196,14 +194,20 @@ public class MiniAccumuloCluster {
    *          and Junit provide methods for creating temporary directories.
    * @param rootPassword
    *          Initial root password for instance.
-   * @param siteConfig
-   *          Any system properties that needs to be set before Accumulo processes are started. These are properties that would normally be placed in
-   *          accumulo-site.xml
    * @throws IOException
    */
-
-  public MiniAccumuloCluster(MacConfig config) throws IOException {
-
+  public MiniAccumuloCluster(File dir, String rootPassword) throws IOException {
+    this(new MiniAccumuloConfig(dir, rootPassword));
+  }
+  
+  /**
+   * @param config
+   *          initial configuration
+   * @throws IOException
+   */
+  
+  public MiniAccumuloCluster(MiniAccumuloConfig config) throws IOException {
+    
     if (config.getDir().exists() && !config.getDir().isDirectory())
       throw new IllegalArgumentException("Must pass in directory, " + config.getDir() + " is a file");
     
@@ -211,7 +215,7 @@ public class MiniAccumuloCluster {
       throw new IllegalArgumentException("Directory " + config.getDir() + " is not empty");
     
     this.config = config;
-
+    
     libDir = new File(config.getDir(), "lib");
     confDir = new File(config.getDir(), "conf");
     accumuloDir = new File(config.getDir(), "accumulo");
@@ -227,14 +231,14 @@ public class MiniAccumuloCluster {
     libDir.mkdirs();
     
     zooKeeperPort = getRandomFreePort();
-
+    
     File siteFile = new File(confDir, "accumulo-site.xml");
     
     FileWriter fileWriter = new FileWriter(siteFile);
     fileWriter.append("<configuration>\n");
     
     HashMap<String,String> siteConfig = new HashMap<String,String>(config.getSiteConfig());
-
+    
     appendProp(fileWriter, Property.INSTANCE_DFS_URI, "file:///", siteConfig);
     appendProp(fileWriter, Property.INSTANCE_DFS_DIR, accumuloDir.getAbsolutePath(), siteConfig);
     appendProp(fileWriter, Property.INSTANCE_ZK_HOST, "localhost:" + zooKeeperPort, siteConfig);
@@ -252,7 +256,7 @@ public class MiniAccumuloCluster {
     appendProp(fileWriter, Property.TSERV_MAJC_DELAY, "3", siteConfig);
     appendProp(fileWriter, Property.GENERAL_CLASSPATHS, libDir.getAbsolutePath(), siteConfig);
     appendProp(fileWriter, Property.GENERAL_DYNAMIC_CLASSPATHS, libDir.getAbsolutePath(), siteConfig);
-
+    
     for (Entry<String,String> entry : siteConfig.entrySet())
       fileWriter.append("<property><name>" + entry.getKey() + "</name><value>" + entry.getValue() + "</value></property>\n");
     fileWriter.append("</configuration>\n");
@@ -270,11 +274,11 @@ public class MiniAccumuloCluster {
     zooCfg.setProperty("maxClientCnxns", "100");
     zooCfg.setProperty("dataDir", zooKeeperDir.getAbsolutePath());
     zooCfg.store(fileWriter, null);
-
+    
     fileWriter.close();
     
   }
-
+  
   /**
    * Starts Accumulo and Zookeeper processes. Can only be called once.
    * 
@@ -283,12 +287,13 @@ public class MiniAccumuloCluster {
    * @throws IllegalStateException
    *           if already started
    */
-
+  
   public void start() throws IOException, InterruptedException {
     if (zooKeeperProcess != null)
       throw new IllegalStateException("Already started");
-
+    
     Runtime.getRuntime().addShutdownHook(new Thread() {
+      @Override
       public void run() {
         try {
           MiniAccumuloCluster.this.stop();
@@ -299,12 +304,12 @@ public class MiniAccumuloCluster {
         }
       }
     });
-
+    
     zooKeeperProcess = exec(ZooKeeperServerMain.class, zooCfgFile.getAbsolutePath());
-   
+    
     // sleep a little bit to let zookeeper come up before calling init, seems to work better
     UtilWaitThread.sleep(250);
-
+    
     Process initProcess = exec(Initialize.class, "--instance-name", INSTANCE_NAME, "--password", config.getRootPassword());
     int ret = initProcess.waitFor();
     if (ret != 0) {
@@ -315,14 +320,14 @@ public class MiniAccumuloCluster {
     for (int i = 0; i < config.getNumTservers(); i++) {
       tabletServerProcesses[i] = exec(TabletServer.class);
     }
-
+    
     masterProcess = exec(Master.class);
   }
-
+  
   /**
    * @return Accumulo instance name
    */
-
+  
   public String getInstanceName() {
     return INSTANCE_NAME;
   }
@@ -330,11 +335,11 @@ public class MiniAccumuloCluster {
   /**
    * @return zookeeper connection string
    */
-
+  
   public String getZookeepers() {
     return "localhost:" + zooKeeperPort;
   }
-
+  
   /**
    * Stops Accumulo and Zookeeper processes. If stop is not called, there is a shutdown hook that is setup to kill the processes. Howerver its probably best to
    * call stop in a finally block as soon as possible.
@@ -342,7 +347,7 @@ public class MiniAccumuloCluster {
    * @throws IOException
    * @throws InterruptedException
    */
-
+  
   public void stop() throws IOException, InterruptedException {
     if (zooKeeperProcess != null)
       zooKeeperProcess.destroy();

Modified: accumulo/branches/ACCUMULO-259/test/src/test/java/org/apache/accumulo/test/MiniAccumuloClusterTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/test/src/test/java/org/apache/accumulo/test/MiniAccumuloClusterTest.java?rev=1437726&r1=1437725&r2=1437726&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/test/src/test/java/org/apache/accumulo/test/MiniAccumuloClusterTest.java (original)
+++ accumulo/branches/ACCUMULO-259/test/src/test/java/org/apache/accumulo/test/MiniAccumuloClusterTest.java Wed Jan 23 20:51:59 2013
@@ -60,7 +60,7 @@ public class MiniAccumuloClusterTest {
     
     Logger.getLogger("org.apache.zookeeper").setLevel(Level.WARN);
 
-    accumulo = new MiniAccumuloCluster(new MacConfig(folder.getRoot(), "superSecret").setNumTservers(2));
+    accumulo = new MiniAccumuloCluster(folder.getRoot(), "superSecret");
     
     accumulo.start();
     

Modified: accumulo/branches/ACCUMULO-259/test/system/auto/simple/examples.py
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/test/system/auto/simple/examples.py?rev=1437726&r1=1437725&r2=1437726&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/test/system/auto/simple/examples.py (original)
+++ accumulo/branches/ACCUMULO-259/test/system/auto/simple/examples.py Wed Jan 23 20:51:59 2013
@@ -253,13 +253,6 @@ class Examples(TestUtilsMixin, unittest.
                         '-p', ROOT_PASSWORD,
                          '-t', 'itest2',
                          '--iterations', 100000])
-        self.comment("Inserting data using a map/reduce job")
-        self.runExample(['org.apache.accumulo.simple.examples.helloworld.InsertWithOutputFormat',
-                        '-i', INSTANCE_NAME,
-                        '-z', ZOOKEEPERS,
-                        '-t', 'helloOutputFormat',
-                        '-u', ROOT,
-                        '-p', ROOT_PASSWORD ])
         self.comment("Using some example constraints")
         self.ashell('\n'.join([
             'createtable testConstraints',

Modified: accumulo/branches/ACCUMULO-259/trace/pom.xml
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/trace/pom.xml?rev=1437726&r1=1437725&r2=1437726&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/trace/pom.xml (original)
+++ accumulo/branches/ACCUMULO-259/trace/pom.xml Wed Jan 23 20:51:59 2013
@@ -43,7 +43,7 @@
         <artifactId>exec-maven-plugin</artifactId>
         <executions>
           <execution>
-            <id>generate-core-thrift</id>
+            <id>generate-thrift</id>
             <phase>generate-sources</phase>
             <goals>
               <goal>exec</goal>



Mime
View raw message