ACCUMULO-3981 Consolidate DfsLogger constructor logic.

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

Branch: refs/heads/master
Commit: a50f80225c97b902c004b1ae4c691d8172c3524e
Parents: 77922c5
Author: Josh Elser <[email protected]>
Authored: Sat Aug 29 16:06:18 2015 -0400
Committer: Josh Elser <[email protected]>
Committed: Sat Aug 29 16:06:18 2015 -0400

----------------------------------------------------------------------
 .../java/org/apache/accumulo/tserver/log/DfsLogger.java  | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/a50f8022/server/tserver/src/main/java/org/apache/accumulo/tserver/log/DfsLogger.java
----------------------------------------------------------------------
diff --git 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/log/DfsLogger.java 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/log/DfsLogger.java
index 33a640d..be3c605 100644
--- 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/log/DfsLogger.java
+++ 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/log/DfsLogger.java
@@ -277,11 +277,15 @@ public class DfsLogger implements Comparable<DfsLogger> {
   private AtomicLong flushCounter;
   private final long slowFlushMillis;
 
-  public DfsLogger(ServerResources conf, AtomicLong syncCounter, AtomicLong 
flushCounter) throws IOException {
+  private DfsLogger(ServerResources conf) {
     this.conf = conf;
+    this.slowFlushMillis = 
conf.getConfiguration().getTimeInMillis(Property.TSERV_SLOW_FLUSH_MILLIS);
+  }
+
+  public DfsLogger(ServerResources conf, AtomicLong syncCounter, AtomicLong 
flushCounter) throws IOException {
+    this(conf);
     this.syncCounter = syncCounter;
     this.flushCounter = flushCounter;
-    this.slowFlushMillis = 
conf.getConfiguration().getTimeInMillis(Property.TSERV_SLOW_FLUSH_MILLIS);
   }
 
   /**
@@ -291,10 +295,9 @@ public class DfsLogger implements Comparable<DfsLogger> {
    *          the cq for the "log" entry in +r/!0
    */
   public DfsLogger(ServerResources conf, String filename, String meta) throws 
IOException {
-    this.conf = conf;
+    this(conf);
     this.logPath = filename;
     metaReference = meta;
-    this.slowFlushMillis = 
conf.getConfiguration().getTimeInMillis(Property.TSERV_SLOW_FLUSH_MILLIS);
   }
 
   public static DFSLoggerInputStreams readHeaderAndReturnStream(VolumeManager 
fs, Path path, AccumuloConfiguration conf) throws IOException {

Reply via email to