accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject [1/2] accumulo git commit: ACCUMULO-3980 was getting warnings on single-host dev system, so get the expectedReplication after the first sync
Date Wed, 02 Sep 2015 18:48:53 GMT
Repository: accumulo
Updated Branches:
  refs/heads/master 5350dbc11 -> 159712baa


ACCUMULO-3980 was getting warnings on single-host dev system, so get the expectedReplication
after the first sync


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

Branch: refs/heads/master
Commit: f8b7a352b291463f199339b579d1051a9f8c5079
Parents: 9d25381
Author: Eric C. Newton <eric.newton@gmail.com>
Authored: Wed Sep 2 14:47:15 2015 -0400
Committer: Eric C. Newton <eric.newton@gmail.com>
Committed: Wed Sep 2 14:47:15 2015 -0400

----------------------------------------------------------------------
 .../org/apache/accumulo/tserver/log/DfsLogger.java     | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/f8b7a352/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 131c61d..4c388b9 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
@@ -145,6 +145,7 @@ public class DfsLogger implements Comparable<DfsLogger> {
   private boolean closed = false;
 
   private class LogSyncingTask implements Runnable {
+    private int expectedReplication = 0;
 
     @Override
     public void run() {
@@ -209,6 +210,13 @@ public class DfsLogger implements Comparable<DfsLogger> {
             }
           }
         }
+        if (expectedReplication == 0 && logFile.getWrappedStream() instanceof DFSOutputStream)
{
+          try {
+            expectedReplication = ((DFSOutputStream) logFile.getWrappedStream()).getCurrentBlockReplication();
+          } catch (IOException e) {
+            fail(work, e, "getting replication level");
+          }
+        }
 
         for (DfsLogger.LogWork logWork : work)
           if (logWork == CLOSED_MARKER)
@@ -291,7 +299,6 @@ public class DfsLogger implements Comparable<DfsLogger> {
   private AtomicLong syncCounter;
   private AtomicLong flushCounter;
   private final long slowFlushMillis;
-  private int expectedReplication = 0;
 
   private DfsLogger(ServerResources conf) {
     this.conf = conf;
@@ -433,10 +440,6 @@ public class DfsLogger implements Comparable<DfsLogger> {
         logFile = fs.createSyncable(new Path(logPath), 0, replication, blockSize);
       else
         logFile = fs.create(new Path(logPath), true, 0, replication, blockSize);
-      if (logFile.getWrappedStream() instanceof DFSOutputStream) {
-        expectedReplication = ((DFSOutputStream) logFile.getWrappedStream()).getCurrentBlockReplication();
-      }
-
       sync = logFile.getClass().getMethod("hsync");
       flush = logFile.getClass().getMethod("hflush");
 


Mime
View raw message