accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [01/11] accumulo git commit: ACCUMULO-3771 Improvements to autoformatting
Date Thu, 07 May 2015 18:54:05 GMT
Repository: accumulo
Updated Branches:
  refs/heads/1.7 931bf897e -> b932755e0
  refs/heads/master 6acfd4149 -> bc3dc3b8d


ACCUMULO-3771 Improvements to autoformatting

* Ensure line endings are consistent
* Eliminate whitespace in non-javadoc block comments
* Insert @formatter:off/on tags to prevent some reformatting
* Make eclipse ignore the plugin


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/a08dd851
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/a08dd851
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/a08dd851

Branch: refs/heads/1.7
Commit: a08dd851995526be5ed5280f298b75f3a92b2d2e
Parents: e4b27ce
Author: Christopher Tubbs <ctubbsii@apache.org>
Authored: Wed May 6 18:03:59 2015 -0400
Committer: Christopher Tubbs <ctubbsii@apache.org>
Committed: Thu May 7 14:40:15 2015 -0400

----------------------------------------------------------------------
 .../core/client/impl/ConditionalWriterImpl.java |  3 +-
 .../core/client/impl/ThriftTransportPool.java   | 10 ++---
 .../client/mapred/AccumuloOutputFormat.java     |  2 +-
 .../core/client/mapreduce/InputFormatBase.java  |  1 +
 .../accumulo/core/conf/ConfigurationDocGen.java |  8 ++--
 .../org/apache/accumulo/core/data/Mutation.java |  3 +-
 .../core/file/blockfile/cache/HeapSize.java     |  1 -
 .../file/blockfile/cache/LruBlockCache.java     | 17 +++++----
 .../lexicoder/impl/AbstractLexicoderTest.java   |  7 ++--
 .../core/client/mock/MockNamespacesTest.java    |  7 +---
 .../accumulo/fate/zookeeper/ZooCache.java       | 13 +++----
 pom.xml                                         | 21 +++++++++-
 .../server/problems/ProblemReports.java         |  2 +-
 .../accumulo/server/util/TabletIterator.java    |  9 -----
 .../gc/GarbageCollectWriteAheadLogs.java        | 40 ++++++++++----------
 .../CloseWriteAheadLogReferences.java           | 18 ++++-----
 .../accumulo/master/tableOps/CleanUp.java       |  9 ++---
 .../apache/accumulo/tserver/TabletServer.java   | 20 ++++------
 .../start/classloader/AccumuloClassLoader.java  |  4 +-
 .../test/continuous/ContinuousBatchWalker.java  | 10 -----
 .../accumulo/test/functional/ConcurrencyIT.java | 17 ++++++---
 21 files changed, 105 insertions(+), 117 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/a08dd851/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java
b/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java
index a2430d4..b8375dc 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java
@@ -657,10 +657,11 @@ class ConditionalWriterImpl implements ConditionalWriter {
     }
   }
 
-  /*
+  /**
    * The purpose of this code is to ensure that a conditional mutation will not execute when
its status is unknown. This allows a user to read the row when the
    * status is unknown and not have to worry about the tserver applying the mutation after
the scan.
    *
+   * <p>
    * If a conditional mutation is taking a long time to process, then this method will wait
for it to finish... unless this exceeds timeout.
    */
   private void invalidateSession(SessionID sessionId, HostAndPort location) throws AccumuloException,
AccumuloSecurityException, TableNotFoundException {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a08dd851/core/src/main/java/org/apache/accumulo/core/client/impl/ThriftTransportPool.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/ThriftTransportPool.java
b/core/src/main/java/org/apache/accumulo/core/client/impl/ThriftTransportPool.java
index 730fd73..2afbb83 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/ThriftTransportPool.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/ThriftTransportPool.java
@@ -190,12 +190,10 @@ public class ThriftTransportPool {
     }
 
     final void checkForStuckIO(long threshold) {
-      /*
-       * checking for stuck io needs to be light weight.
-       *
-       * Tried to call System.currentTimeMillis() and Thread.currentThread() before every
io operation.... this dramatically slowed things down. So switched to
-       * incrementing a counter before and after each io operation.
-       */
+      // checking for stuck io needs to be light weight.
+
+      // Tried to call System.currentTimeMillis() and Thread.currentThread() before every
io operation.... this dramatically slowed things down. So switched to
+      // incrementing a counter before and after each io operation.
 
       if ((ioCount & 1) == 1) {
         // when ioCount is odd, it means I/O is currently happening

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a08dd851/core/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormat.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormat.java
b/core/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormat.java
index 88ed184..c194cf6 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormat.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormat.java
@@ -83,7 +83,7 @@ public class AccumuloOutputFormat implements OutputFormat<Text,Mutation>
{
 
   /**
    * Sets the connector information needed to communicate with Accumulo in this job.
-
+   *
    * <p>
    * <b>WARNING:</b> Some tokens, when serialized, divulge sensitive information
in the configuration as a means to pass the token to MapReduce tasks. This
    * information is BASE64 encoded to provide a charset safe conversion to a string, but
this conversion is not intended to be secure. {@link PasswordToken} is

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a08dd851/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java
b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java
index dcc4fd5..16bc96e 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java
@@ -378,6 +378,7 @@ public abstract class InputFormatBase<K,V> extends AbstractInputFormat<K,V>
{
 
     /**
      * Initialize a scanner over the given input split using this task attempt configuration.
+     *
      * @deprecated since 1.7.0; Use {@link #contextIterators} instead.
      */
     @Deprecated

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a08dd851/core/src/main/java/org/apache/accumulo/core/conf/ConfigurationDocGen.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/conf/ConfigurationDocGen.java b/core/src/main/java/org/apache/accumulo/core/conf/ConfigurationDocGen.java
index ca7d81f..7357a9b 100644
--- a/core/src/main/java/org/apache/accumulo/core/conf/ConfigurationDocGen.java
+++ b/core/src/main/java/org/apache/accumulo/core/conf/ConfigurationDocGen.java
@@ -356,12 +356,14 @@ class ConfigurationDocGen {
     new Asciidoc().generate();
   }
 
-  /*
+  /**
    * Generates documentation for conf/accumulo-site.xml file usage. Arguments are: "--generate-doc",
file to write to.
    *
-   * @param args command-line arguments
+   * @param args
+   *          command-line arguments
    *
-   * @throws IllegalArgumentException if args is invalid
+   * @throws IllegalArgumentException
+   *           if args is invalid
    */
   public static void main(String[] args) throws FileNotFoundException, UnsupportedEncodingException
{
     if (args.length == 2 && args[0].equals("--generate-html")) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a08dd851/core/src/main/java/org/apache/accumulo/core/data/Mutation.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/data/Mutation.java b/core/src/main/java/org/apache/accumulo/core/data/Mutation.java
index 5a49341..31c02eb 100644
--- a/core/src/main/java/org/apache/accumulo/core/data/Mutation.java
+++ b/core/src/main/java/org/apache/accumulo/core/data/Mutation.java
@@ -101,8 +101,7 @@ public class Mutation implements Writable {
   /**
    * This is so hashCode and equals can be called without changing this object.
    *
-   * It will return a copy of the current data buffer if serialized has not been
-   * called previously. Otherwise, this.data will be returned since the buffer is
+   * It will return a copy of the current data buffer if serialized has not been called previously.
Otherwise, this.data will be returned since the buffer is
    * null and will not change.
    */
   private ByteBuffer serializedSnapshot() {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a08dd851/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/HeapSize.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/HeapSize.java
b/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/HeapSize.java
index 04db3cd..88d5b88 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/HeapSize.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/HeapSize.java
@@ -30,7 +30,6 @@ package org.apache.accumulo.core.file.blockfile.cache;
  *
  * <pre>
  * public class SampleObject implements HeapSize {
- *
  *   int[] numbers;
  *   int x;
  * }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a08dd851/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/LruBlockCache.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/LruBlockCache.java
b/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/LruBlockCache.java
index af2f6df..2a14b36 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/LruBlockCache.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/LruBlockCache.java
@@ -36,29 +36,29 @@ import org.apache.commons.logging.LogFactory;
 /**
  * A block cache implementation that is memory-aware using {@link HeapSize}, memory-bound
using an LRU eviction algorithm, and concurrent: backed by a
  * {@link ConcurrentHashMap} and with a non-blocking eviction thread giving constant-time
{@link #cacheBlock} and {@link #getBlock} operations.
- * <p>
  *
+ * <p>
  * Contains three levels of block priority to allow for scan-resistance and in-memory families.
A block is added with an inMemory flag if necessary, otherwise a
  * block becomes a single access priority. Once a blocked is accessed again, it changes to
multiple access. This is used to prevent scans from thrashing the
  * cache, adding a least-frequently-used element to the eviction algorithm.
- * <p>
  *
+ * <p>
  * Each priority is given its own chunk of the total cache to ensure fairness during eviction.
Each priority will retain close to its maximum size, however, if
  * any priority is not using its entire chunk the others are able to grow beyond their chunk
size.
- * <p>
  *
+ * <p>
  * Instantiated at a minimum with the total size and average block size. All sizes are in
bytes. The block size is not especially important as this cache is
  * fully dynamic in its sizing of blocks. It is only used for pre-allocating data structures
and in initial heap estimation of the map.
- * <p>
  *
+ * <p>
  * The detailed constructor defines the sizes for the three priorities (they should total
to the maximum size defined). It also sets the levels that trigger and
  * control the eviction thread.
- * <p>
  *
+ * <p>
  * The acceptable size is the cache size level which triggers the eviction process to start.
It evicts enough blocks to get the size below the minimum size
  * specified.
- * <p>
  *
+ * <p>
  * Eviction happens in a separate thread and involves a single full-scan of the map. It determines
how many bytes must be freed to reach the minimum size, and
  * then while scanning determines the fewest least-recently-used blocks necessary from each
of the three priorities (would be 3 times bytes to free). It then
  * uses the priority chunk sizes to evict fairly according to the relative sizes and usage.
@@ -511,9 +511,10 @@ public class LruBlockCache implements BlockCache, HeapSize {
     return this.stats.getEvictedCount();
   }
 
-  /*
-   * Eviction thread. Sits in waiting state until an eviction is triggered when the cache
size grows above the acceptable level.<p>
+  /**
+   * Eviction thread. Sits in waiting state until an eviction is triggered when the cache
size grows above the acceptable level.
    *
+   * <p>
    * Thread is triggered into action by {@link LruBlockCache#runEviction()}
    */
   private static class EvictionThread extends Thread {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a08dd851/core/src/test/java/org/apache/accumulo/core/client/lexicoder/impl/AbstractLexicoderTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/client/lexicoder/impl/AbstractLexicoderTest.java
b/core/src/test/java/org/apache/accumulo/core/client/lexicoder/impl/AbstractLexicoderTest.java
index 502d132..d695ce9 100644
--- a/core/src/test/java/org/apache/accumulo/core/client/lexicoder/impl/AbstractLexicoderTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/lexicoder/impl/AbstractLexicoderTest.java
@@ -20,8 +20,9 @@ import org.apache.accumulo.core.client.lexicoder.LexicoderTest;
 import org.apache.commons.lang.ArrayUtils;
 
 /**
- * Assists in Testing classes that extend {@link org.apache.accumulo.core.client.lexicoder.AbstractEncoder}.
 It
- * references methods not formally defined in the {@link org.apache.accumulo.core.client.lexicoder.Lexicoder}
interface.
+ * Assists in Testing classes that extend {@link org.apache.accumulo.core.client.lexicoder.AbstractEncoder}.
It references methods not formally defined in the
+ * {@link org.apache.accumulo.core.client.lexicoder.Lexicoder} interface.
+ *
  * @since 1.7.0
  */
 public abstract class AbstractLexicoderTest extends LexicoderTest {
@@ -91,4 +92,4 @@ public abstract class AbstractLexicoderTest extends LexicoderTest {
       fail("Should throw on negative length, even if (offset+len) is within bounds.");
     } catch (IllegalArgumentException e) {}
   }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a08dd851/core/src/test/java/org/apache/accumulo/core/client/mock/MockNamespacesTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/client/mock/MockNamespacesTest.java
b/core/src/test/java/org/apache/accumulo/core/client/mock/MockNamespacesTest.java
index 77b989f..308152e 100644
--- a/core/src/test/java/org/apache/accumulo/core/client/mock/MockNamespacesTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/mock/MockNamespacesTest.java
@@ -210,11 +210,8 @@ public class MockNamespacesTest {
     assertTrue(!c.tableOperations().exists(tableName));
 
     // TODO implement clone in mock
-    /*
-     * c.tableOperations().clone(tableName1, tableName2, false, null, null);
-     *
-     * assertTrue(c.tableOperations().exists(tableName1)); assertTrue(c.tableOperations().exists(tableName2));
-     */
+    // c.tableOperations().clone(tableName1, tableName2, false, null, null);
+    // assertTrue(c.tableOperations().exists(tableName1)); assertTrue(c.tableOperations().exists(tableName2));
     return;
   }
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a08dd851/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCache.java
----------------------------------------------------------------------
diff --git a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCache.java b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCache.java
index 5a4fb11..f043d83 100644
--- a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCache.java
+++ b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCache.java
@@ -256,14 +256,11 @@ public class ZooCache {
         if (cache.containsKey(zPath))
           return;
 
-        /*
-         * The following call to exists() is important, since we are caching that a node
does not exist. Once the node comes into existence, it will be added to
-         * the cache. But this notification of a node coming into existence will only be
given if exists() was previously called.
-         *
-         * If the call to exists() is bypassed and only getData() is called with a special
case that looks for Code.NONODE in the KeeperException, then
-         * non-existence can not be cached.
-         */
-
+        // The following call to exists() is important, since we are caching that a node
does not exist. Once the node comes into existence, it will be added to
+        // the cache. But this notification of a node coming into existence will only be
given if exists() was previously called.
+        //
+        // If the call to exists() is bypassed and only getData() is called with a special
case that looks for Code.NONODE in the KeeperException, then
+        // non-existence can not be cached.
         Stat stat = zooKeeper.exists(zPath, watcher);
 
         byte[] data = null;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a08dd851/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 3ff3372..cd20445 100644
--- a/pom.xml
+++ b/pom.xml
@@ -735,6 +735,19 @@
                 </pluginExecution>
                 <pluginExecution>
                   <pluginExecutionFilter>
+                    <groupId>com.googlecode.maven-java-formatter-plugin</groupId>
+                    <artifactId>maven-java-formatter-plugin</artifactId>
+                    <versionRange>[0.4,)</versionRange>
+                    <goals>
+                      <goal>format</goal>
+                    </goals>
+                  </pluginExecutionFilter>
+                  <action>
+                    <ignore />
+                  </action>
+                </pluginExecution>
+                <pluginExecution>
+                  <pluginExecutionFilter>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-checkstyle-plugin</artifactId>
                     <versionRange>[2.13,)</versionRange>
@@ -910,17 +923,21 @@
           <artifactId>maven-java-formatter-plugin</artifactId>
           <version>0.4</version>
           <configuration>
+            <compilerCompliance>${maven.compiler.source}</compilerCompliance>
+            <compilerSource>${maven.compiler.source}</compilerSource>
+            <compilerTargetPlatform>${maven.compiler.target}</compilerTargetPlatform>
             <excludes>
               <exclude>**/thrift/*.java</exclude>
               <exclude>**/proto/*.java</exclude>
             </excludes>
+            <lineEnding>LF</lineEnding>
+            <overrideConfigCompilerVersion>true</overrideConfigCompilerVersion>
           </configuration>
           <dependencies>
             <dependency>
               <groupId>org.eclipse.tycho</groupId>
               <artifactId>org.eclipse.jdt.core</artifactId>
               <version>3.10.0.v20140604-1726</version>
-              <scope>compile</scope>
             </dependency>
           </dependencies>
           <executions>
@@ -976,7 +993,7 @@
               <module name="TreeWalker">
                 <module name="OneTopLevelClass" />
                 <module name="RegexpSinglelineJava">
-                  <property name="format" value="[^*]\s+$" />
+                  <property name="format" value="\s+$" />
                   <property name="message" value="Line has trailing whitespace." />
                 </module>
                 <module name="RegexpSinglelineJava">

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a08dd851/server/base/src/main/java/org/apache/accumulo/server/problems/ProblemReports.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/problems/ProblemReports.java
b/server/base/src/main/java/org/apache/accumulo/server/problems/ProblemReports.java
index 960f9b3..d44efb1 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/problems/ProblemReports.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/problems/ProblemReports.java
@@ -62,7 +62,7 @@ public class ProblemReports implements Iterable<ProblemReport> {
 
   private final LRUMap problemReports = new LRUMap(1000);
 
-  /*
+  /**
    * use a thread pool so that reporting a problem never blocks
    *
    * make the thread pool use a bounded queue to avoid the case where problem reports are
not being processed because the whole system is in a really bad state

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a08dd851/server/base/src/main/java/org/apache/accumulo/server/util/TabletIterator.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/TabletIterator.java
b/server/base/src/main/java/org/apache/accumulo/server/util/TabletIterator.java
index a1fc9c5..2137999 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/TabletIterator.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/TabletIterator.java
@@ -48,8 +48,6 @@ import com.google.common.collect.Iterators;
  *
  * If a tablet that was returned by this iterator is subsequently deleted from the metadata
table, then this iterator will throw a TabletDeletedException. This
  * could occur when a table is merged.
- *
- *
  */
 public class TabletIterator implements Iterator<Map<Key,Value>> {
 
@@ -77,18 +75,11 @@ public class TabletIterator implements Iterator<Map<Key,Value>>
{
     }
   }
 
-  /*
-   * public TabletIterator(String table, boolean returnPrevEndRow){
-   *
-   * }
-   */
-
   /**
    *
    * @param s
    *          A scanner over the entire metadata table configure to fetch needed columns.
    */
-
   public TabletIterator(Scanner s, Range range, boolean returnPrevEndRow, boolean returnDir)
{
     this.scanner = s;
     this.range = range;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a08dd851/server/gc/src/main/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogs.java
----------------------------------------------------------------------
diff --git a/server/gc/src/main/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogs.java
b/server/gc/src/main/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogs.java
index c880fef..194d357 100644
--- a/server/gc/src/main/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogs.java
+++ b/server/gc/src/main/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogs.java
@@ -146,15 +146,13 @@ public class GarbageCollectWriteAheadLogs {
     try {
       Set<TServerInstance> currentServers = liveServers.getCurrentServers();
 
-
       status.currentLog.started = System.currentTimeMillis();
 
-      Map<TServerInstance, Set<Path> > candidates = new HashMap<>();
+      Map<TServerInstance,Set<Path>> candidates = new HashMap<>();
       long count = getCurrent(candidates, currentServers);
       long fileScanStop = System.currentTimeMillis();
 
-      log.info(String.format("Fetched %d files for %d servers in %.2f seconds", count, candidates.size(),
-          (fileScanStop - status.currentLog.started) / 1000.));
+      log.info(String.format("Fetched %d files for %d servers in %.2f seconds", count, candidates.size(),
(fileScanStop - status.currentLog.started) / 1000.));
       status.currentLog.candidates = count;
       span.stop();
 
@@ -198,7 +196,6 @@ public class GarbageCollectWriteAheadLogs {
       log.info(String.format("%d markers removed in %.2f seconds", count, (removeMarkersStop
- removeStop) / 1000.));
       span.stop();
 
-
       status.currentLog.finished = removeStop;
       status.lastLog = status.currentLog;
       status.currentLog = new GcCycleStats();
@@ -227,7 +224,7 @@ public class GarbageCollectWriteAheadLogs {
           root.addMutation(m);
           meta.addMutation(m);
         }
-      } finally  {
+      } finally {
         if (meta != null) {
           meta.close();
         }
@@ -241,7 +238,7 @@ public class GarbageCollectWriteAheadLogs {
     return result;
   }
 
-  private long removeFiles(Map<TServerInstance, Set<Path> > candidates, final
GCStatus status) {
+  private long removeFiles(Map<TServerInstance,Set<Path>> candidates, final GCStatus
status) {
     for (Entry<TServerInstance,Set<Path>> entry : candidates.entrySet()) {
       for (Path path : entry.getValue()) {
         log.debug("Removing unused WAL for server " + entry.getKey() + " log " + path);
@@ -263,12 +260,12 @@ public class GarbageCollectWriteAheadLogs {
     return UUID.fromString(path.getName());
   }
 
-  private long removeEntriesInUse(Map<TServerInstance, Set<Path> > candidates,
GCStatus status, Set<TServerInstance> liveServers) throws IOException, KeeperException,
-      InterruptedException {
+  private long removeEntriesInUse(Map<TServerInstance,Set<Path>> candidates,
GCStatus status, Set<TServerInstance> liveServers) throws IOException,
+      KeeperException, InterruptedException {
 
     // remove any entries if there's a log reference, or a tablet is still assigned to the
dead server
 
-    Map<UUID, TServerInstance> walToDeadServer = new HashMap<>();
+    Map<UUID,TServerInstance> walToDeadServer = new HashMap<>();
     for (Entry<TServerInstance,Set<Path>> entry : candidates.entrySet()) {
       for (Path file : entry.getValue()) {
         walToDeadServer.put(path2uuid(file), entry.getKey());
@@ -303,8 +300,7 @@ public class GarbageCollectWriteAheadLogs {
     return count;
   }
 
-  protected int removeReplicationEntries(Map<TServerInstance, Set<Path> > candidates,
GCStatus status) throws IOException, KeeperException,
-  InterruptedException {
+  protected int removeReplicationEntries(Map<TServerInstance,Set<Path>> candidates,
GCStatus status) throws IOException, KeeperException, InterruptedException {
     Connector conn;
     try {
       conn = context.getConnector();
@@ -341,7 +337,6 @@ public class GarbageCollectWriteAheadLogs {
     return count;
   }
 
-
   /**
    * Determine if the given WAL is needed for replication
    *
@@ -409,7 +404,7 @@ public class GarbageCollectWriteAheadLogs {
    *          map of dead server to log file entries
    * @return total number of log files
    */
-  private long getCurrent(Map<TServerInstance, Set<Path> > unusedLogs, Set<TServerInstance>
currentServers) throws Exception {
+  private long getCurrent(Map<TServerInstance,Set<Path>> unusedLogs, Set<TServerInstance>
currentServers) throws Exception {
     // Logs for the Root table are stored in ZooKeeper.
     Set<Path> rootWALs = getRootLogs(ZooReaderWriter.getInstance(), context.getInstance());
 
@@ -446,14 +441,15 @@ public class GarbageCollectWriteAheadLogs {
 
     // scan HDFS for logs for dead servers
     for (Volume volume : VolumeManagerImpl.get().getVolumes()) {
-      addUnusedWalsFromVolume(volume.getFileSystem().listFiles(volume.prefixChild(ServerConstants.WAL_DIR),
true), unusedLogs,
-          context.getConnector().getInstance().getZooKeepersSessionTimeOut());
+      addUnusedWalsFromVolume(volume.getFileSystem().listFiles(volume.prefixChild(ServerConstants.WAL_DIR),
true), unusedLogs, context.getConnector()
+          .getInstance().getZooKeepersSessionTimeOut());
     }
     return count;
   }
 
   /**
    * Fetch the WALs which are, or were, referenced by the Root Table
+   *
    * @return The Set of WALs which are needed by the Root Table
    */
   Set<Path> getRootLogs(final ZooReader zoo, Instance instance) throws Exception {
@@ -470,9 +466,13 @@ public class GarbageCollectWriteAheadLogs {
 
   /**
    * Read all WALs from the given path in ZooKeeper and add the paths to each WAL to the
provided <code>rootWALs</code>
-   * @param reader A reader to ZooKeeper
-   * @param zpath The base path to read in ZooKeeper
-   * @param rootWALs A Set to collect the WALs in
+   *
+   * @param reader
+   *          A reader to ZooKeeper
+   * @param zpath
+   *          The base path to read in ZooKeeper
+   * @param rootWALs
+   *          A Set to collect the WALs in
    */
   void addLogsForNode(ZooReader reader, String zpath, HashSet<Path> rootWALs) throws
Exception {
     // Get entries in zookeeper:
@@ -504,7 +504,7 @@ public class GarbageCollectWriteAheadLogs {
       // last modified is longer than the ZK timeout.
       // 1. If we think the server is alive, but it's actually dead, we'll grab it on a later
cycle. Which is OK.
       // 2. If we think the server is dead but it happened to be restarted it's possible
to have a server which would differ only by session.
-      //    This is also OK because the new TServer will create a new WAL.
+      // This is also OK because the new TServer will create a new WAL.
       if (System.currentTimeMillis() - next.getModificationTime() < zkTimeout) {
         continue;
       }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a08dd851/server/gc/src/main/java/org/apache/accumulo/gc/replication/CloseWriteAheadLogReferences.java
----------------------------------------------------------------------
diff --git a/server/gc/src/main/java/org/apache/accumulo/gc/replication/CloseWriteAheadLogReferences.java
b/server/gc/src/main/java/org/apache/accumulo/gc/replication/CloseWriteAheadLogReferences.java
index 455aaee..cb4b341 100644
--- a/server/gc/src/main/java/org/apache/accumulo/gc/replication/CloseWriteAheadLogReferences.java
+++ b/server/gc/src/main/java/org/apache/accumulo/gc/replication/CloseWriteAheadLogReferences.java
@@ -115,16 +115,14 @@ public class CloseWriteAheadLogReferences implements Runnable {
     log.debug("Referenced WALs: " + referencedWals);
     sw.reset();
 
-    /*
-     * ACCUMULO-3320 WALs cannot be closed while a TabletServer may still use it later.
-     *
-     * In addition to the WALs that are actively referenced in the metadata table, tservers
can also hold on to a WAL that is not presently referenced by any
-     * tablet. For example, a tablet could MinC which would end in all logs for that tablet
being removed. However, if more data was ingested into the table,
-     * the same WAL could be re-used again by that tserver.
-     *
-     * If this code happened to run after the compaction but before the log is again referenced
by a tabletserver, we might delete the WAL reference, only to
-     * have it recreated again which causes havoc with the replication status for a table.
-     */
+    // ACCUMULO-3320 WALs cannot be closed while a TabletServer may still use it later.
+    //
+    // In addition to the WALs that are actively referenced in the metadata table, tservers
can also hold on to a WAL that is not presently referenced by any
+    // tablet. For example, a tablet could MinC which would end in all logs for that tablet
being removed. However, if more data was ingested into the table,
+    // the same WAL could be re-used again by that tserver.
+    //
+    // If this code happened to run after the compaction but before the log is again referenced
by a tabletserver, we might delete the WAL reference, only to
+    // have it recreated again which causes havoc with the replication status for a table.
     final TInfo tinfo = Tracer.traceInfo();
     Set<String> activeWals;
     Span findActiveWalsSpan = Trace.start("findActiveWals");

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a08dd851/server/master/src/main/java/org/apache/accumulo/master/tableOps/CleanUp.java
----------------------------------------------------------------------
diff --git a/server/master/src/main/java/org/apache/accumulo/master/tableOps/CleanUp.java
b/server/master/src/main/java/org/apache/accumulo/master/tableOps/CleanUp.java
index f696198..f221775 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/tableOps/CleanUp.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/tableOps/CleanUp.java
@@ -69,11 +69,8 @@ class CleanUp extends MasterRepo {
   private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException
{
     in.defaultReadObject();
 
-    /*
-     * handle the case where we start executing on a new machine where the current time is
in the past relative to the previous machine
-     *
-     * if the new machine has time in the future, that will work ok w/ hasCycled
-     */
+    // handle the case where we start executing on a new machine where the current time is
in the past relative to the previous machine
+    // if the new machine has time in the future, that will work ok w/ hasCycled
     if (System.currentTimeMillis() < creationTime) {
       creationTime = System.currentTimeMillis();
     }
@@ -284,4 +281,4 @@ class CleanUp extends MasterRepo {
     // nothing to do
   }
 
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a08dd851/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
index 96f33aa..ada06b6 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
@@ -2108,19 +2108,13 @@ public class TabletServer extends AccumuloServerContext implements
Runnable {
         locationToOpen = VolumeUtil.switchRootTabletVolume(extent, locationToOpen);
 
         tablet = new Tablet(TabletServer.this, extent, locationToOpen, trm, tabletsKeyValues);
-        /*
-         * @formatter:off If a minor compaction starts after a tablet opens, this indicates
a log recovery occurred. This recovered data must be minor
-         * compacted.
-         *
-         * There are three reasons to wait for this minor compaction to finish before placing
the tablet in online tablets.
-         *
-         * 1) The log recovery code does not handle data written to the tablet on multiple
tablet servers. 2) The log recovery code does not block if memory is
-         * full. Therefore recovering lots of tablets that use a lot of memory could run
out of memory. 3) The minor compaction finish event did not make 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.
-         *
-         * @formatter:on
-         */
+        // If a minor compaction starts after a tablet opens, this indicates a log recovery
occurred. This recovered data must be minor compacted.
+        // There are three reasons to wait for this minor compaction to finish before placing
the tablet in online tablets.
+        //
+        // 1) The log recovery code does not handle data written to the tablet on multiple
tablet servers.
+        // 2) The log recovery code does not block if memory is full. Therefore recovering
lots of tablets that use a lot of memory could run out of memory.
+        // 3) The minor compaction finish event did not make 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(MinorCompactionReason.RECOVERY))
{
           throw new RuntimeException("Minor compaction after recovery fails for " + extent);
         }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a08dd851/start/src/main/java/org/apache/accumulo/start/classloader/AccumuloClassLoader.java
----------------------------------------------------------------------
diff --git a/start/src/main/java/org/apache/accumulo/start/classloader/AccumuloClassLoader.java
b/start/src/main/java/org/apache/accumulo/start/classloader/AccumuloClassLoader.java
index df4437d..53b36b4 100644
--- a/start/src/main/java/org/apache/accumulo/start/classloader/AccumuloClassLoader.java
+++ b/start/src/main/java/org/apache/accumulo/start/classloader/AccumuloClassLoader.java
@@ -102,8 +102,8 @@ public class AccumuloClassLoader {
   }
 
   /**
-   * Parses and XML Document for a property node for a &lt;name&gt; with the value
propertyName if it finds one the function return that property's value for its
-   * &lt;value&gt; node. If not found the function will return null
+   * Parses an XML Document for a property node for a &lt;name&gt; with the value
propertyName if it finds one the function return that property's value for its
+   * &lt;value&gt; node. If not found the function will return null.
    *
    * @param d
    *          XMLDocument to search through

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a08dd851/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousBatchWalker.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousBatchWalker.java
b/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousBatchWalker.java
index c8a1143..5c54b08 100644
--- a/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousBatchWalker.java
+++ b/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousBatchWalker.java
@@ -81,16 +81,6 @@ public class ContinuousBatchWalker {
 
   }
 
-  /*
-   * private static void runSequentialScan(Scanner scanner, List<Range> ranges) { Set<Text>
srowsSeen = new HashSet<Text>(); long st1 =
-   * System.currentTimeMillis(); int scount = 0; for (Range range : ranges) { scanner.setRange(range);
-   *
-   * for (Entry<Key,Value> entry : scanner) { srowsSeen.add(entry.getKey().getRow());
scount++; } }
-   *
-   *
-   * long st2 = System.currentTimeMillis(); System.out.println("SRQ "+(st2 - st1)+" "+srowsSeen.size()
+" "+scount); }
-   */
-
   private static void runBatchScan(int batchSize, BatchScanner bs, Set<Text> batch,
List<Range> ranges) {
     bs.setRanges(ranges);
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/a08dd851/test/src/test/java/org/apache/accumulo/test/functional/ConcurrencyIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/ConcurrencyIT.java b/test/src/test/java/org/apache/accumulo/test/functional/ConcurrencyIT.java
index 31437cc..859eafd 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/ConcurrencyIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/ConcurrencyIT.java
@@ -78,12 +78,17 @@ public class ConcurrencyIT extends AccumuloClusterIT {
     return 2 * 60;
   }
 
-  /*
-   * Below is a diagram of the operations in this test over time.
-   *
-   * Scan 0 |------------------------------| Scan 1 |----------| Minc 1 |-----| Scan 2 |----------|
Scan 3 |---------------| Minc 2 |-----| Majc 1 |-----|
-   */
-
+  // @formatter:off
+  // Below is a diagram of the operations in this test over time.
+  //
+  // Scan 0 |------------------------------|
+  // Scan 1 |----------|
+  // Minc 1  |-----|
+  // Scan 2   |----------|
+  // Scan 3               |---------------|
+  // Minc 2                |-----|
+  // Majc 1                       |-----|
+  // @formatter:on
   @Test
   public void run() throws Exception {
     Connector c = getConnector();


Mime
View raw message