You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ct...@apache.org on 2015/05/07 20:54:09 UTC

[05/11] accumulo git commit: ACCUMULO-3771 Configure automatic Java code style formatting

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b932755e/test/src/test/java/org/apache/accumulo/harness/AccumuloClusterIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/harness/AccumuloClusterIT.java b/test/src/test/java/org/apache/accumulo/harness/AccumuloClusterIT.java
index df0ddf0..a0cca46 100644
--- a/test/src/test/java/org/apache/accumulo/harness/AccumuloClusterIT.java
+++ b/test/src/test/java/org/apache/accumulo/harness/AccumuloClusterIT.java
@@ -129,7 +129,8 @@ public abstract class AccumuloClusterIT extends AccumuloIT implements MiniCluste
       case STANDALONE:
         StandaloneAccumuloClusterConfiguration conf = (StandaloneAccumuloClusterConfiguration) clusterConf;
         ClientConfiguration clientConf = conf.getClientConf();
-        StandaloneAccumuloCluster standaloneCluster = new StandaloneAccumuloCluster(conf.getInstance(), clientConf, conf.getTmpDirectory(), conf.getUsers(), conf.getAccumuloServerUser());
+        StandaloneAccumuloCluster standaloneCluster = new StandaloneAccumuloCluster(conf.getInstance(), clientConf, conf.getTmpDirectory(), conf.getUsers(),
+            conf.getAccumuloServerUser());
         // If these are provided in the configuration, pass them into the cluster
         standaloneCluster.setAccumuloHome(conf.getAccumuloHome());
         standaloneCluster.setAccumuloConfDir(conf.getAccumuloConfDir());

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b932755e/test/src/test/java/org/apache/accumulo/proxy/SimpleProxyBase.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/proxy/SimpleProxyBase.java b/test/src/test/java/org/apache/accumulo/proxy/SimpleProxyBase.java
index 67f51be..e221081 100644
--- a/test/src/test/java/org/apache/accumulo/proxy/SimpleProxyBase.java
+++ b/test/src/test/java/org/apache/accumulo/proxy/SimpleProxyBase.java
@@ -118,7 +118,7 @@ public abstract class SimpleProxyBase extends SharedMiniClusterIT {
 
   @Override
   protected int defaultTimeoutSeconds() {
-    return 10*60;
+    return 10 * 60;
   }
 
   private static final long ZOOKEEPER_PROPAGATION_TIME = 10 * 1000;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b932755e/test/src/test/java/org/apache/accumulo/test/BalanceWithOfflineTableIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/BalanceWithOfflineTableIT.java b/test/src/test/java/org/apache/accumulo/test/BalanceWithOfflineTableIT.java
index 86468c5..2d79dd8 100644
--- a/test/src/test/java/org/apache/accumulo/test/BalanceWithOfflineTableIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/BalanceWithOfflineTableIT.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
- package org.apache.accumulo.test;
+package org.apache.accumulo.test;
 
 import java.util.SortedSet;
 import java.util.TreeSet;
@@ -39,8 +39,7 @@ public class BalanceWithOfflineTableIT extends ConfigurableMacIT {
   }
 
   @Override
-  protected void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) {
-  }
+  protected void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) {}
 
   @Test
   public void test() throws Exception {
@@ -50,7 +49,8 @@ public class BalanceWithOfflineTableIT extends ConfigurableMacIT {
 
     final Connector c = getConnector();
     log.info("Creating table " + tableName);
-    c.tableOperations().create(tableName);;
+    c.tableOperations().create(tableName);
+    ;
     final SortedSet<Text> splits = new TreeSet<>();
     for (String split : "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z".split(",")) {
       splits.add(new Text(split));

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b932755e/test/src/test/java/org/apache/accumulo/test/GarbageCollectWALIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/GarbageCollectWALIT.java b/test/src/test/java/org/apache/accumulo/test/GarbageCollectWALIT.java
index 0324e4a..96ae579 100644
--- a/test/src/test/java/org/apache/accumulo/test/GarbageCollectWALIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/GarbageCollectWALIT.java
@@ -78,4 +78,4 @@ public class GarbageCollectWALIT extends ConfigurableMacIT {
     }
     return result;
   }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b932755e/test/src/test/java/org/apache/accumulo/test/TableOperationsIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/TableOperationsIT.java b/test/src/test/java/org/apache/accumulo/test/TableOperationsIT.java
index 0127e6e..ced9d69 100644
--- a/test/src/test/java/org/apache/accumulo/test/TableOperationsIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/TableOperationsIT.java
@@ -305,8 +305,8 @@ public class TableOperationsIT extends AccumuloClusterIT {
     Map<Key,Value> actual = new TreeMap<>(COMPARE_KEY_TO_COLQ); // only compare row, colF, colQ
     for (Map.Entry<Key,Value> entry : scanner)
       actual.put(entry.getKey(), entry.getValue());
-    Assume.assumeFalse("Compaction successfully occurred due to weird timing but we hoped it would cancel.",
-        HardListIterator.allEntriesToInject.equals(actual));
+    Assume
+        .assumeFalse("Compaction successfully occurred due to weird timing but we hoped it would cancel.", HardListIterator.allEntriesToInject.equals(actual));
     assertTrue("Scan should be empty if compaction canceled. " + "Actual is " + actual, actual.isEmpty());
     connector.tableOperations().delete(tableName);
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b932755e/test/src/test/java/org/apache/accumulo/test/VolumeIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/VolumeIT.java b/test/src/test/java/org/apache/accumulo/test/VolumeIT.java
index e2a0e03..2b24219 100644
--- a/test/src/test/java/org/apache/accumulo/test/VolumeIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/VolumeIT.java
@@ -427,7 +427,7 @@ public class VolumeIT extends ConfigurableMacIT {
     }
 
     Text path = new Text();
-    for (String table : new String[]{RootTable.NAME, MetadataTable.NAME}) {
+    for (String table : new String[] {RootTable.NAME, MetadataTable.NAME}) {
       Scanner meta = conn.createScanner(table, Authorizations.EMPTY);
       meta.setRange(MetadataSchema.CurrentLogsSection.getRange());
       outer: for (Entry<Key,Value> entry : meta) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b932755e/test/src/test/java/org/apache/accumulo/test/functional/AccumuloInputFormatIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/AccumuloInputFormatIT.java b/test/src/test/java/org/apache/accumulo/test/functional/AccumuloInputFormatIT.java
index afbcffe..054f9a4 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/AccumuloInputFormatIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/AccumuloInputFormatIT.java
@@ -147,7 +147,7 @@ public class AccumuloInputFormatIT extends AccumuloClusterIT {
     splits = inputFormat.getSplits(job);
     assertEquals(ranges.size(), splits.size());
 
-    //BatchScan not available for offline scans
+    // BatchScan not available for offline scans
     AccumuloInputFormat.setBatchScan(job, true);
     // Reset auto-adjust ranges too
     AccumuloInputFormat.setAutoAdjustRanges(job, true);
@@ -165,7 +165,7 @@ public class AccumuloInputFormatIT extends AccumuloClusterIT {
     splits = inputFormat.getSplits(job);
     assertEquals(2, splits.size());
 
-    //BatchScan not available with isolated iterators
+    // BatchScan not available with isolated iterators
     AccumuloInputFormat.setScanIsolation(job, true);
     try {
       inputFormat.getSplits(job);
@@ -177,7 +177,7 @@ public class AccumuloInputFormatIT extends AccumuloClusterIT {
     splits = inputFormat.getSplits(job);
     assertEquals(2, splits.size());
 
-    //BatchScan not available with local iterators
+    // BatchScan not available with local iterators
     AccumuloInputFormat.setLocalIterators(job, true);
     try {
       inputFormat.getSplits(job);
@@ -185,13 +185,13 @@ public class AccumuloInputFormatIT extends AccumuloClusterIT {
     } catch (IllegalArgumentException e) {}
     AccumuloInputFormat.setLocalIterators(job, false);
 
-    //Check we are getting back correct type pf split
+    // Check we are getting back correct type pf split
     conn.tableOperations().online(table);
     splits = inputFormat.getSplits(job);
-    for (InputSplit split: splits)
-      assert(split instanceof BatchInputSplit);
+    for (InputSplit split : splits)
+      assert (split instanceof BatchInputSplit);
 
-    //We should divide along the tablet lines similar to when using `setAutoAdjustRanges(job, true)`
+    // We should divide along the tablet lines similar to when using `setAutoAdjustRanges(job, true)`
     assertEquals(2, splits.size());
   }
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b932755e/test/src/test/java/org/apache/accumulo/test/functional/KerberosIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/KerberosIT.java b/test/src/test/java/org/apache/accumulo/test/functional/KerberosIT.java
index 2c1dddf..596676a 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/KerberosIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/KerberosIT.java
@@ -499,8 +499,8 @@ public class KerberosIT extends AccumuloIT {
     });
 
     // A restarted master should reuse the same secret key after a restart if the secret key hasn't expired (1day by default)
-    DelegationTokenImpl dt1 = (DelegationTokenImpl)delegationToken1;
-    DelegationTokenImpl dt2 = (DelegationTokenImpl)delegationToken2;
+    DelegationTokenImpl dt1 = (DelegationTokenImpl) delegationToken1;
+    DelegationTokenImpl dt2 = (DelegationTokenImpl) delegationToken2;
     assertEquals(dt1.getIdentifier().getKeyId(), dt2.getIdentifier().getKeyId());
   }
 
@@ -551,7 +551,7 @@ public class KerberosIT extends AccumuloIT {
       }
     });
 
-    AuthenticationTokenIdentifier identifier = ((DelegationTokenImpl)dt).getIdentifier();
+    AuthenticationTokenIdentifier identifier = ((DelegationTokenImpl) dt).getIdentifier();
     assertTrue("Expected identifier to expire in no more than 5 minutes: " + identifier,
         identifier.getExpirationDate() - identifier.getIssueDate() <= (5 * 60 * 1000));
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b932755e/test/src/test/java/org/apache/accumulo/test/functional/KerberosProxyIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/KerberosProxyIT.java b/test/src/test/java/org/apache/accumulo/test/functional/KerberosProxyIT.java
index fda3586..dbfe730 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/KerberosProxyIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/KerberosProxyIT.java
@@ -241,8 +241,8 @@ public class KerberosProxyIT extends AccumuloIT {
 
     TSocket socket = new TSocket(hostname, proxyPort);
     log.info("Connecting to proxy with server primary '" + proxyPrimary + "' running on " + hostname);
-    TSaslClientTransport transport = new TSaslClientTransport("GSSAPI", null, proxyPrimary, hostname, Collections.singletonMap(
-        "javax.security.sasl.qop", "auth"), null, socket);
+    TSaslClientTransport transport = new TSaslClientTransport("GSSAPI", null, proxyPrimary, hostname, Collections.singletonMap("javax.security.sasl.qop",
+        "auth"), null, socket);
 
     final UGIAssumingTransport ugiTransport = new UGIAssumingTransport(transport, ugi);
 
@@ -336,8 +336,8 @@ public class KerberosProxyIT extends AccumuloIT {
     log.info("Connecting to proxy with server primary '" + proxyPrimary + "' running on " + hostname);
 
     // Should fail to open the tran
-    TSaslClientTransport transport = new TSaslClientTransport("GSSAPI", null, proxyPrimary, hostname, Collections.singletonMap(
-        "javax.security.sasl.qop", "auth"), null, socket);
+    TSaslClientTransport transport = new TSaslClientTransport("GSSAPI", null, proxyPrimary, hostname, Collections.singletonMap("javax.security.sasl.qop",
+        "auth"), null, socket);
 
     final UGIAssumingTransport ugiTransport = new UGIAssumingTransport(transport, ugi);
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b932755e/test/src/test/java/org/apache/accumulo/test/functional/WALSunnyDayIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/WALSunnyDayIT.java b/test/src/test/java/org/apache/accumulo/test/functional/WALSunnyDayIT.java
index 74c79a1..f2ceb2c 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/WALSunnyDayIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/WALSunnyDayIT.java
@@ -85,7 +85,7 @@ public class WALSunnyDayIT extends ConfigurableMacIT {
     int result = 0;
     for (Boolean b : bools) {
       if (b.booleanValue())
-        result ++;
+        result++;
     }
     return result;
   }
@@ -121,7 +121,7 @@ public class WALSunnyDayIT extends ConfigurableMacIT {
     assertEquals("all WALs should be in use", 2, countTrue(walsAfterRoll.values()));
 
     // flush the tables
-    for (String table: new String[] { tableName, MetadataTable.NAME, RootTable.NAME} ) {
+    for (String table : new String[] {tableName, MetadataTable.NAME, RootTable.NAME}) {
       c.tableOperations().flush(table, null, null, true);
     }
     UtilWaitThread.sleep(1000);
@@ -148,7 +148,7 @@ public class WALSunnyDayIT extends ConfigurableMacIT {
     // allow a little time for the master to notice ASSIGNED_TO_DEAD_SERVER tablets
     UtilWaitThread.sleep(5 * 1000);
     Map<KeyExtent,List<String>> markers = getRecoveryMarkers(c);
-    //log.debug("markers " + markers);
+    // log.debug("markers " + markers);
     assertEquals("one tablet should have markers", 1, markers.keySet().size());
     assertEquals("tableId of the keyExtent should be 1", markers.keySet().iterator().next().getTableId(), new Text("1"));
 
@@ -158,7 +158,7 @@ public class WALSunnyDayIT extends ConfigurableMacIT {
     writeSomeData(c, tableName, 100, 100);
 
     Map<String,Boolean> walsAfterRestart = getWals(c, zoo);
-    //log.debug("wals after " + walsAfterRestart);
+    // log.debug("wals after " + walsAfterRestart);
     assertEquals("used WALs after restart should be 1", 1, countTrue(walsAfterRestart.values()));
     control.start(GARBAGE_COLLECTOR);
     UtilWaitThread.sleep(5 * 1000);
@@ -197,8 +197,8 @@ public class WALSunnyDayIT extends ConfigurableMacIT {
     bw.close();
   }
 
-  private Map<String, Boolean> getWals(Connector c, ZooKeeper zoo) throws Exception {
-    Map<String, Boolean> result = new HashMap<>();
+  private Map<String,Boolean> getWals(Connector c, ZooKeeper zoo) throws Exception {
+    Map<String,Boolean> result = new HashMap<>();
     Scanner root = c.createScanner(RootTable.NAME, EMPTY);
     root.setRange(CurrentLogsSection.getRange());
     Scanner meta = c.createScanner(MetadataTable.NAME, EMPTY);
@@ -220,8 +220,8 @@ public class WALSunnyDayIT extends ConfigurableMacIT {
     return result;
   }
 
-  private Map<KeyExtent, List<String>> getRecoveryMarkers(Connector c) throws Exception {
-    Map<KeyExtent, List<String>> result = new HashMap<>();
+  private Map<KeyExtent,List<String>> getRecoveryMarkers(Connector c) throws Exception {
+    Map<KeyExtent,List<String>> result = new HashMap<>();
     Scanner root = c.createScanner(RootTable.NAME, EMPTY);
     root.setRange(TabletsSection.getRange());
     root.fetchColumnFamily(TabletsSection.LogColumnFamily.NAME);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b932755e/test/src/test/java/org/apache/accumulo/test/performance/RollWALPerformanceIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/performance/RollWALPerformanceIT.java b/test/src/test/java/org/apache/accumulo/test/performance/RollWALPerformanceIT.java
index fcd1fd7..5418e1c 100644
--- a/test/src/test/java/org/apache/accumulo/test/performance/RollWALPerformanceIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/performance/RollWALPerformanceIT.java
@@ -71,14 +71,8 @@ public class RollWALPerformanceIT extends ConfigurableMacIT {
 
     log.info("Starting ingest");
     final long start = System.currentTimeMillis();
-    final String args[] = {
-        "-i", inst.getInstanceName(),
-        "-z", inst.getZooKeepers(),
-        "-u", "root",
-        "-p", ROOT_PASSWORD,
-        "--batchThreads", "2",
-        "--table", tableName,
-        "--num", Long.toString(1000*1000),  // 1M 100 byte entries
+    final String args[] = {"-i", inst.getInstanceName(), "-z", inst.getZooKeepers(), "-u", "root", "-p", ROOT_PASSWORD, "--batchThreads", "2", "--table",
+        tableName, "--num", Long.toString(1000 * 1000), // 1M 100 byte entries
     };
 
     ContinuousIngest.main(args);
@@ -106,7 +100,7 @@ public class RollWALPerformanceIT extends ConfigurableMacIT {
     c.instanceOperations().setProperty(Property.TSERV_WALOG_MAX_SIZE.getKey(), "1G");
     c.tableOperations().flush(MetadataTable.NAME, null, null, true);
     c.tableOperations().flush(RootTable.NAME, null, null, true);
-    for (ProcessReference  tserver : getCluster().getProcesses().get(ServerType.TABLET_SERVER)) {
+    for (ProcessReference tserver : getCluster().getProcesses().get(ServerType.TABLET_SERVER)) {
       getCluster().killProcess(ServerType.TABLET_SERVER, tserver);
     }
     getCluster().start();
@@ -118,7 +112,7 @@ public class RollWALPerformanceIT extends ConfigurableMacIT {
     assertTrue(percent < 125.);
   }
 
-  @Test(timeout= 20 * 60 * 1000)
+  @Test(timeout = 20 * 60 * 1000)
   public void testWalPerformance() throws Exception {
     testWalPerformanceOnce();
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b932755e/test/src/test/java/org/apache/accumulo/test/replication/ReplicationIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/replication/ReplicationIT.java b/test/src/test/java/org/apache/accumulo/test/replication/ReplicationIT.java
index 768d857..54b42f4 100644
--- a/test/src/test/java/org/apache/accumulo/test/replication/ReplicationIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/replication/ReplicationIT.java
@@ -133,7 +133,7 @@ public class ReplicationIT extends ConfigurableMacIT {
 
   private Multimap<String,String> getLogs(Connector conn) throws TableNotFoundException {
     // Map of server to tableId
-    Multimap<TServerInstance, String> serverToTableID = HashMultimap.create();
+    Multimap<TServerInstance,String> serverToTableID = HashMultimap.create();
     Scanner scanner = conn.createScanner(MetadataTable.NAME, Authorizations.EMPTY);
     scanner.setRange(MetadataSchema.TabletsSection.getRange());
     scanner.fetchColumnFamily(MetadataSchema.TabletsSection.CurrentLocationColumnFamily.NAME);
@@ -154,7 +154,7 @@ public class ReplicationIT extends ConfigurableMacIT {
       MetadataSchema.CurrentLogsSection.getPath(entry.getKey(), path);
       Text session = new Text();
       Text hostPort = new Text();
-      MetadataSchema.CurrentLogsSection.getTabletServer(entry.getKey(), hostPort , session);
+      MetadataSchema.CurrentLogsSection.getTabletServer(entry.getKey(), hostPort, session);
       TServerInstance server = new TServerInstance(AddressUtil.parseAddress(hostPort.toString(), false), session.toString());
       for (String tableId : serverToTableID.get(server)) {
         logs.put(new Path(path.toString()).toString(), tableId);