hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mberto...@apache.org
Subject [4/4] hbase git commit: HBASE-14843 TestWALProcedureStore.testLoad is flakey (addendum)
Date Tue, 24 Nov 2015 07:42:46 GMT
HBASE-14843 TestWALProcedureStore.testLoad is flakey (addendum)


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

Branch: refs/heads/branch-1.1
Commit: 7d3364b043d535e6cc70cdeeca730549c369344b
Parents: d4dea12
Author: Matteo Bertozzi <matteo.bertozzi@cloudera.com>
Authored: Mon Nov 23 23:35:10 2015 -0800
Committer: Matteo Bertozzi <matteo.bertozzi@cloudera.com>
Committed: Mon Nov 23 23:39:41 2015 -0800

----------------------------------------------------------------------
 .../hbase/procedure2/store/wal/WALProcedureStore.java   | 12 +++++++-----
 .../procedure2/store/wal/TestWALProcedureStore.java     |  5 ++++-
 2 files changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/7d3364b0/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java
----------------------------------------------------------------------
diff --git a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java
b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java
index decc83f..0dcdad9 100644
--- a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java
+++ b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java
@@ -116,13 +116,14 @@ public class WALProcedureStore implements ProcedureStore {
   private final FileSystem fs;
   private final Path logDir;
 
-  private AtomicBoolean loading = new AtomicBoolean(true);
-  private AtomicBoolean inSync = new AtomicBoolean(false);
-  private AtomicReference<Throwable> syncException = new AtomicReference<>();
+  private final AtomicReference<Throwable> syncException = new AtomicReference<Throwable>();
+  private final AtomicBoolean loading = new AtomicBoolean(true);
+  private final AtomicBoolean inSync = new AtomicBoolean(false);
+  private final AtomicLong totalSynced = new AtomicLong(0);
+  private final AtomicLong lastRollTs = new AtomicLong(0);
+
   private LinkedTransferQueue<ByteSlot> slotsCache = null;
   private Set<ProcedureWALFile> corruptedLogs = null;
-  private AtomicLong totalSynced = new AtomicLong(0);
-  private AtomicLong lastRollTs = new AtomicLong(0);
   private FSDataOutputStream stream = null;
   private long flushLogId = 0;
   private int slotIndex = 0;
@@ -153,6 +154,7 @@ public class WALProcedureStore implements ProcedureStore {
     }
 
     // Init buffer slots
+    loading.set(true);
     slots = new ByteSlot[numSlots];
     slotsCache = new LinkedTransferQueue();
     while (slotsCache.size() < numSlots) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/7d3364b0/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestWALProcedureStore.java
----------------------------------------------------------------------
diff --git a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestWALProcedureStore.java
b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestWALProcedureStore.java
index dc7c155..07c83d3 100644
--- a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestWALProcedureStore.java
+++ b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestWALProcedureStore.java
@@ -78,6 +78,7 @@ public class TestWALProcedureStore {
     procStore = ProcedureTestingUtility.createWalStore(htu.getConfiguration(), fs, logDir);
     procStore.start(PROCEDURE_STORE_SLOTS);
     procStore.recoverLease();
+    procStore.load();
   }
 
   @After
@@ -254,7 +255,9 @@ public class TestWALProcedureStore {
     InputStream in = fs.open(logFile.getPath());
     OutputStream out =  fs.create(tmpPath);
     IOUtils.copyBytes(in, out, logFile.getLen() - dropBytes, true);
-    fs.rename(tmpPath, logFile.getPath());
+    if (!fs.rename(tmpPath, logFile.getPath())) {
+      throw new IOException("Unable to rename");
+    }
   }
 
   private void verifyProcIdsOnRestart(final Set<Long> procIds) throws Exception {


Mime
View raw message