accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject git commit: ACCUMULO-2092 Make client view of table existence consistent
Date Thu, 06 Feb 2014 00:16:16 GMT
Updated Branches:
  refs/heads/1.6.0-SNAPSHOT a8f154e45 -> b0b2c4992


ACCUMULO-2092 Make client view of table existence consistent

  Clear the cache after exceptions, instead of just successful fate
  operations. This ensures that a failure as the result of a
  TableNotFoundException or TableExistsException will be consistent with
  the client's view, if they check it right after the failure.


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

Branch: refs/heads/1.6.0-SNAPSHOT
Commit: b0b2c49925735ca02019773e31c0ebee0e4a4260
Parents: a8f154e
Author: Christopher Tubbs <ctubbsii@apache.org>
Authored: Wed Feb 5 19:14:06 2014 -0500
Committer: Christopher Tubbs <ctubbsii@apache.org>
Committed: Wed Feb 5 19:14:06 2014 -0500

----------------------------------------------------------------------
 .../core/client/admin/TableOperationsImpl.java        | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/b0b2c499/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java
b/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java
index f459275..0245ef1 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java
@@ -309,7 +309,6 @@ public class TableOperationsImpl extends TableOperationsHelper {
         return null;
       }
       String ret = waitForFateOperation(opid);
-      Tables.clearCache(instance);
       return ret;
     } catch (ThriftSecurityException e) {
       String tableName = ByteBufferUtil.toString(args.get(0));
@@ -340,6 +339,7 @@ public class TableOperationsImpl extends TableOperationsHelper {
     } catch (Exception e) {
       throw new AccumuloException(e.getMessage(), e);
     } finally {
+      Tables.clearCache(instance);
       // always finish table op, even when exception
       if (opid != null)
         try {
@@ -528,8 +528,8 @@ public class TableOperationsImpl extends TableOperationsHelper {
 
     ArgumentChecker.notNull(tableName);
     ByteBuffer EMPTY = ByteBuffer.allocate(0);
-    List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(tableName.getBytes(Constants.UTF8)),
start == null ? EMPTY : TextUtil.getByteBuffer(start), end == null ? EMPTY
-        : TextUtil.getByteBuffer(end));
+    List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(tableName.getBytes(Constants.UTF8)),
start == null ? EMPTY : TextUtil.getByteBuffer(start),
+        end == null ? EMPTY : TextUtil.getByteBuffer(end));
     Map<String,String> opts = new HashMap<String,String>();
     try {
       doTableFateOperation(tableName, TableNotFoundException.class, FateOperation.TABLE_MERGE,
args, opts);
@@ -544,8 +544,8 @@ public class TableOperationsImpl extends TableOperationsHelper {
 
     ArgumentChecker.notNull(tableName);
     ByteBuffer EMPTY = ByteBuffer.allocate(0);
-    List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(tableName.getBytes(Constants.UTF8)),
start == null ? EMPTY : TextUtil.getByteBuffer(start), end == null ? EMPTY
-        : TextUtil.getByteBuffer(end));
+    List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(tableName.getBytes(Constants.UTF8)),
start == null ? EMPTY : TextUtil.getByteBuffer(start),
+        end == null ? EMPTY : TextUtil.getByteBuffer(end));
     Map<String,String> opts = new HashMap<String,String>();
     try {
       doTableFateOperation(tableName, TableNotFoundException.class, FateOperation.TABLE_DELETE_RANGE,
args, opts);
@@ -787,8 +787,8 @@ public class TableOperationsImpl extends TableOperationsHelper {
     if (flush)
       _flush(tableId, start, end, true);
 
-    List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(tableId.getBytes(Constants.UTF8)),
start == null ? EMPTY : TextUtil.getByteBuffer(start), end == null ? EMPTY
-        : TextUtil.getByteBuffer(end), ByteBuffer.wrap(IteratorUtil.encodeIteratorSettings(iterators)));
+    List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(tableId.getBytes(Constants.UTF8)),
start == null ? EMPTY : TextUtil.getByteBuffer(start),
+        end == null ? EMPTY : TextUtil.getByteBuffer(end), ByteBuffer.wrap(IteratorUtil.encodeIteratorSettings(iterators)));
 
     Map<String,String> opts = new HashMap<String,String>();
     try {


Mime
View raw message