accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject [3/3] accumulo git commit: Merge branch '1.8'
Date Fri, 27 Jan 2017 01:07:52 GMT
Merge branch '1.8'


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

Branch: refs/heads/master
Commit: adb26259e5077e6b4f4a8150ccb94c5c6493b5fb
Parents: 1efc828 bf5b6e0
Author: Keith Turner <kturner@apache.org>
Authored: Thu Jan 26 20:05:11 2017 -0500
Committer: Keith Turner <kturner@apache.org>
Committed: Thu Jan 26 20:05:11 2017 -0500

----------------------------------------------------------------------
 .../accumulo/master/FateServiceHandler.java     |  15 +-
 .../master/tableOps/CancelCompactions.java      |  13 +-
 .../master/tableOps/ChangeTableState.java       |  10 +-
 .../accumulo/master/tableOps/CompactRange.java  |  22 +--
 .../master/tableOps/CompactionDriver.java       |  10 +-
 .../accumulo/master/tableOps/DeleteTable.java   |  10 +-
 .../accumulo/master/tableOps/RenameTable.java   |   9 +-
 .../accumulo/master/tableOps/TableRangeOp.java  |  12 +-
 .../master/tableOps/TableRangeOpWait.java       |   8 +-
 .../functional/ConcurrentDeleteTableIT.java     | 167 ++++++++++++++++++-
 10 files changed, 211 insertions(+), 65 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/adb26259/server/master/src/main/java/org/apache/accumulo/master/FateServiceHandler.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/accumulo/blob/adb26259/server/master/src/main/java/org/apache/accumulo/master/tableOps/CancelCompactions.java
----------------------------------------------------------------------
diff --cc server/master/src/main/java/org/apache/accumulo/master/tableOps/CancelCompactions.java
index e268f17,c98174e..0377de6
--- a/server/master/src/main/java/org/apache/accumulo/master/tableOps/CancelCompactions.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/tableOps/CancelCompactions.java
@@@ -31,15 -30,20 +30,16 @@@ public class CancelCompactions extends 
  
    private static final long serialVersionUID = 1L;
    private String tableId;
+   private String namespaceId;
  
-   public CancelCompactions(String tableId) {
 -  private String getNamespaceId(Master env) throws Exception {
 -    return Utils.getNamespaceId(env.getInstance(), tableId, TableOperation.COMPACT_CANCEL,
this.namespaceId);
 -  }
 -
+   public CancelCompactions(String namespaceId, String tableId) {
      this.tableId = tableId;
+     this.namespaceId = namespaceId;
    }
  
    @Override
-   public long isReady(long tid, Master environment) throws Exception {
-     String namespaceId = Tables.getNamespaceId(environment.getInstance(), tableId);
+   public long isReady(long tid, Master env) throws Exception {
 -    return Utils.reserveNamespace(getNamespaceId(env), tid, false, true, TableOperation.COMPACT_CANCEL)
 +    return Utils.reserveNamespace(namespaceId, tid, false, true, TableOperation.COMPACT_CANCEL)
          + Utils.reserveTable(tableId, tid, false, true, TableOperation.COMPACT_CANCEL);
    }
  
@@@ -73,9 -77,8 +73,8 @@@
    }
  
    @Override
-   public void undo(long tid, Master environment) throws Exception {
-     String namespaceId = Tables.getNamespaceId(environment.getInstance(), tableId);
-     Utils.unreserveNamespace(namespaceId, tid, false);
+   public void undo(long tid, Master env) throws Exception {
      Utils.unreserveTable(tableId, tid, false);
 -    Utils.unreserveNamespace(getNamespaceId(env), tid, false);
++    Utils.unreserveNamespace(namespaceId, tid, false);
    }
  }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/adb26259/server/master/src/main/java/org/apache/accumulo/master/tableOps/ChangeTableState.java
----------------------------------------------------------------------
diff --cc server/master/src/main/java/org/apache/accumulo/master/tableOps/ChangeTableState.java
index 8649570,ee6efa4..a99fcf7
--- a/server/master/src/main/java/org/apache/accumulo/master/tableOps/ChangeTableState.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/tableOps/ChangeTableState.java
@@@ -28,10 -27,16 +27,12 @@@ public class ChangeTableState extends M
  
    private static final long serialVersionUID = 1L;
    private String tableId;
+   private String namespaceId;
    private TableOperation top;
  
-   public ChangeTableState(String tableId, TableOperation top) {
 -  private String getNamespaceId(Master env) throws Exception {
 -    return Utils.getNamespaceId(env.getInstance(), tableId, top, this.namespaceId);
 -  }
 -
+   public ChangeTableState(String namespaceId, String tableId, TableOperation top) {
      this.tableId = tableId;
+     this.namespaceId = namespaceId;
      this.top = top;
  
      if (top != TableOperation.ONLINE && top != TableOperation.OFFLINE)
@@@ -39,10 -44,9 +40,9 @@@
    }
  
    @Override
-   public long isReady(long tid, Master environment) throws Exception {
-     String namespaceId = Tables.getNamespaceId(environment.getInstance(), tableId);
+   public long isReady(long tid, Master env) throws Exception {
      // reserve the table so that this op does not run concurrently with create, clone, or
delete table
 -    return Utils.reserveNamespace(getNamespaceId(env), tid, false, true, top) + Utils.reserveTable(tableId,
tid, true, true, top);
 +    return Utils.reserveNamespace(namespaceId, tid, false, true, top) + Utils.reserveTable(tableId,
tid, true, true, top);
    }
  
    @Override
@@@ -62,8 -65,7 +61,7 @@@
  
    @Override
    public void undo(long tid, Master env) throws Exception {
-     String namespaceId = Tables.getNamespaceId(env.getInstance(), tableId);
 -    Utils.unreserveNamespace(getNamespaceId(env), tid, false);
 +    Utils.unreserveNamespace(namespaceId, tid, false);
      Utils.unreserveTable(tableId, tid, true);
    }
  }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/adb26259/server/master/src/main/java/org/apache/accumulo/master/tableOps/CompactRange.java
----------------------------------------------------------------------
diff --cc server/master/src/main/java/org/apache/accumulo/master/tableOps/CompactRange.java
index d7d5b14,f3d53a7..5fc37ec
--- a/server/master/src/main/java/org/apache/accumulo/master/tableOps/CompactRange.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/tableOps/CompactRange.java
@@@ -51,9 -51,14 +51,10 @@@ public class CompactRange extends Maste
    private byte[] endRow;
    private byte[] config;
  
-   public CompactRange(String tableId, byte[] startRow, byte[] endRow, List<IteratorSetting>
iterators, CompactionStrategyConfig compactionStrategy)
-       throws AcceptableThriftTableOperationException {
 -  private String getNamespaceId(Master env) throws Exception {
 -    return Utils.getNamespaceId(env.getInstance(), tableId, TableOperation.COMPACT, this.namespaceId);
 -  }
 -
+   public CompactRange(String namespaceId, String tableId, byte[] startRow, byte[] endRow,
List<IteratorSetting> iterators,
+       CompactionStrategyConfig compactionStrategy) throws AcceptableThriftTableOperationException
{
  
+     requireNonNull(namespaceId, "Invalid argument: null namespaceId");
      requireNonNull(tableId, "Invalid argument: null tableId");
      requireNonNull(iterators, "Invalid argument: null iterator list");
      requireNonNull(compactionStrategy, "Invalid argument: null compactionStrategy");
@@@ -74,9 -80,8 +76,8 @@@
    }
  
    @Override
-   public long isReady(long tid, Master environment) throws Exception {
-     String namespaceId = Tables.getNamespaceId(environment.getInstance(), tableId);
+   public long isReady(long tid, Master env) throws Exception {
 -    return Utils.reserveNamespace(getNamespaceId(env), tid, false, true, TableOperation.COMPACT)
 +    return Utils.reserveNamespace(namespaceId, tid, false, true, TableOperation.COMPACT)
          + Utils.reserveTable(tableId, tid, false, true, TableOperation.COMPACT);
    }
  
@@@ -122,7 -127,7 +123,7 @@@
          }
        });
  
-       return new CompactionDriver(Long.parseLong(new String(cid, UTF_8).split(",")[0]),
tableId, startRow, endRow);
 -      return new CompactionDriver(Long.parseLong(new String(cid, UTF_8).split(",")[0]),
getNamespaceId(env), tableId, startRow, endRow);
++      return new CompactionDriver(Long.parseLong(new String(cid, UTF_8).split(",")[0]),
namespaceId, tableId, startRow, endRow);
      } catch (NoNodeException nne) {
        throw new AcceptableThriftTableOperationException(tableId, null, TableOperation.COMPACT,
TableOperationExceptionType.NOTFOUND, null);
      }
@@@ -158,12 -163,11 +159,11 @@@
    }
  
    @Override
-   public void undo(long tid, Master environment) throws Exception {
-     String namespaceId = Tables.getNamespaceId(environment.getInstance(), tableId);
+   public void undo(long tid, Master env) throws Exception {
      try {
-       removeIterators(environment, tid, tableId);
+       removeIterators(env, tid, tableId);
      } finally {
 -      Utils.unreserveNamespace(getNamespaceId(env), tid, false);
 +      Utils.unreserveNamespace(namespaceId, tid, false);
        Utils.unreserveTable(tableId, tid, false);
      }
    }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/adb26259/server/master/src/main/java/org/apache/accumulo/master/tableOps/CompactionDriver.java
----------------------------------------------------------------------
diff --cc server/master/src/main/java/org/apache/accumulo/master/tableOps/CompactionDriver.java
index 4653472,50d9eaa..bfecdd5
--- a/server/master/src/main/java/org/apache/accumulo/master/tableOps/CompactionDriver.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/tableOps/CompactionDriver.java
@@@ -60,10 -61,14 +61,10 @@@ class CompactionDriver extends MasterRe
    private byte[] startRow;
    private byte[] endRow;
  
-   public CompactionDriver(long compactId, String tableId, byte[] startRow, byte[] endRow)
{
 -  private String getNamespaceId(Master env) throws Exception {
 -    return Utils.getNamespaceId(env.getInstance(), tableId, TableOperation.COMPACT, this.namespaceId);
 -  }
--
+   public CompactionDriver(long compactId, String namespaceId, String tableId, byte[] startRow,
byte[] endRow) {
      this.compactId = compactId;
      this.tableId = tableId;
+     this.namespaceId = namespaceId;
      this.startRow = startRow;
      this.endRow = endRow;
    }
@@@ -172,11 -177,10 +173,10 @@@
    }
  
    @Override
-   public Repo<Master> call(long tid, Master environment) throws Exception {
-     String namespaceId = Tables.getNamespaceId(environment.getInstance(), tableId);
-     CompactRange.removeIterators(environment, tid, tableId);
+   public Repo<Master> call(long tid, Master env) throws Exception {
+     CompactRange.removeIterators(env, tid, tableId);
      Utils.getReadLock(tableId, tid).unlock();
 -    Utils.getReadLock(getNamespaceId(env), tid).unlock();
 +    Utils.getReadLock(namespaceId, tid).unlock();
      return null;
    }
  

http://git-wip-us.apache.org/repos/asf/accumulo/blob/adb26259/server/master/src/main/java/org/apache/accumulo/master/tableOps/DeleteTable.java
----------------------------------------------------------------------
diff --cc server/master/src/main/java/org/apache/accumulo/master/tableOps/DeleteTable.java
index c0bf48b,e6267df..34d2772
--- a/server/master/src/main/java/org/apache/accumulo/master/tableOps/DeleteTable.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/tableOps/DeleteTable.java
@@@ -35,20 -39,21 +35,20 @@@ public class DeleteTable extends Master
    }
  
    @Override
-   public long isReady(long tid, Master environment) throws Exception {
+   public long isReady(long tid, Master env) throws Exception {
 -    return Utils.reserveNamespace(getNamespaceId(env), tid, false, false, TableOperation.DELETE)
 -        + Utils.reserveTable(tableId, tid, true, true, TableOperation.DELETE);
 +    return Utils.reserveNamespace(namespaceId, tid, false, false, TableOperation.DELETE)
+ Utils.reserveTable(tableId, tid, true, true, TableOperation.DELETE);
    }
  
    @Override
-   public Repo<Master> call(long tid, Master environment) throws Exception {
+   public Repo<Master> call(long tid, Master env) throws Exception {
      TableManager.getInstance().transitionTableState(tableId, TableState.DELETING);
-     environment.getEventCoordinator().event("deleting table %s ", tableId);
+     env.getEventCoordinator().event("deleting table %s ", tableId);
 -    return new CleanUp(tableId, getNamespaceId(env));
 +    return new CleanUp(tableId, namespaceId);
    }
  
    @Override
-   public void undo(long tid, Master environment) throws Exception {
-     Utils.unreserveNamespace(namespaceId, tid, false);
+   public void undo(long tid, Master env) throws Exception {
      Utils.unreserveTable(tableId, tid, true);
 -    Utils.unreserveNamespace(getNamespaceId(env), tid, false);
++    Utils.unreserveNamespace(namespaceId, tid, false);
    }
  }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/adb26259/server/master/src/main/java/org/apache/accumulo/master/tableOps/RenameTable.java
----------------------------------------------------------------------
diff --cc server/master/src/main/java/org/apache/accumulo/master/tableOps/RenameTable.java
index f85d411,3ef2dc9..ebd424f
--- a/server/master/src/main/java/org/apache/accumulo/master/tableOps/RenameTable.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/tableOps/RenameTable.java
@@@ -42,13 -43,18 +43,13 @@@ public class RenameTable extends Master
    private String oldTableName;
    private String newTableName;
  
 -  private String getNamespaceId(Master env) throws Exception {
 -    return Utils.getNamespaceId(env.getInstance(), tableId, TableOperation.RENAME, this.namespaceId);
 -  }
 -
    @Override
-   public long isReady(long tid, Master environment) throws Exception {
-     String namespaceId = Tables.getNamespaceId(environment.getInstance(), tableId);
+   public long isReady(long tid, Master env) throws Exception {
 -    return Utils.reserveNamespace(getNamespaceId(env), tid, false, true, TableOperation.RENAME)
 -        + Utils.reserveTable(tableId, tid, true, true, TableOperation.RENAME);
 +    return Utils.reserveNamespace(namespaceId, tid, false, true, TableOperation.RENAME)
+ Utils.reserveTable(tableId, tid, true, true, TableOperation.RENAME);
    }
  
-   public RenameTable(String tableId, String oldTableName, String newTableName) throws NamespaceNotFoundException
{
+   public RenameTable(String namespaceId, String tableId, String oldTableName, String newTableName)
throws NamespaceNotFoundException {
+     this.namespaceId = namespaceId;
      this.tableId = tableId;
      this.oldTableName = oldTableName;
      this.newTableName = newTableName;
@@@ -57,7 -63,7 +58,6 @@@
    @Override
    public Repo<Master> call(long tid, Master master) throws Exception {
      Instance instance = master.getInstance();
-     String namespaceId = Tables.getNamespaceId(instance, tableId);
 -    String namespaceId = getNamespaceId(master);
      Pair<String,String> qualifiedOldTableName = Tables.qualify(oldTableName);
      Pair<String,String> qualifiedNewTableName = Tables.qualify(newTableName);
  
@@@ -104,9 -110,8 +104,8 @@@
  
    @Override
    public void undo(long tid, Master env) throws Exception {
-     String namespaceId = Tables.getNamespaceId(env.getInstance(), tableId);
      Utils.unreserveTable(tableId, tid, true);
 -    Utils.unreserveNamespace(getNamespaceId(env), tid, false);
 +    Utils.unreserveNamespace(namespaceId, tid, false);
    }
  
  }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/adb26259/server/master/src/main/java/org/apache/accumulo/master/tableOps/TableRangeOp.java
----------------------------------------------------------------------
diff --cc server/master/src/main/java/org/apache/accumulo/master/tableOps/TableRangeOp.java
index e2e7018,d91755d..2577a13
--- a/server/master/src/main/java/org/apache/accumulo/master/tableOps/TableRangeOp.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/tableOps/TableRangeOp.java
@@@ -42,15 -42,19 +42,14 @@@ public class TableRangeOp extends Maste
    private byte[] endRow;
    private Operation op;
  
 -  private String getNamespaceId(Master env) throws Exception {
 -    return Utils.getNamespaceId(env.getInstance(), tableId, TableOperation.MERGE, this.namespaceId);
 -  }
 -
    @Override
-   public long isReady(long tid, Master environment) throws Exception {
-     String namespaceId = Tables.getNamespaceId(environment.getInstance(), tableId);
+   public long isReady(long tid, Master env) throws Exception {
 -    return Utils.reserveNamespace(getNamespaceId(env), tid, false, true, TableOperation.MERGE)
 -        + Utils.reserveTable(tableId, tid, true, true, TableOperation.MERGE);
 +    return Utils.reserveNamespace(namespaceId, tid, false, true, TableOperation.MERGE) +
Utils.reserveTable(tableId, tid, true, true, TableOperation.MERGE);
    }
  
-   public TableRangeOp(MergeInfo.Operation op, String tableId, Text startRow, Text endRow)
throws AcceptableThriftTableOperationException {
- 
+   public TableRangeOp(MergeInfo.Operation op, String namespaceId, String tableId, Text startRow,
Text endRow) throws AcceptableThriftTableOperationException {
      this.tableId = tableId;
+     this.namespaceId = namespaceId;
      this.startRow = TextUtil.getBytes(startRow);
      this.endRow = TextUtil.getBytes(endRow);
      this.op = op;
@@@ -80,7 -84,7 +79,7 @@@
        env.setMergeState(new MergeInfo(range, op), MergeState.STARTED);
      }
  
-     return new TableRangeOpWait(tableId);
 -    return new TableRangeOpWait(getNamespaceId(env), tableId);
++    return new TableRangeOpWait(namespaceId, tableId);
    }
  
    @Override

http://git-wip-us.apache.org/repos/asf/accumulo/blob/adb26259/server/master/src/main/java/org/apache/accumulo/master/tableOps/TableRangeOpWait.java
----------------------------------------------------------------------
diff --cc server/master/src/main/java/org/apache/accumulo/master/tableOps/TableRangeOpWait.java
index a7c82b1,1194c67..0992b5f
--- a/server/master/src/main/java/org/apache/accumulo/master/tableOps/TableRangeOpWait.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/tableOps/TableRangeOpWait.java
@@@ -16,7 -16,7 +16,6 @@@
   */
  package org.apache.accumulo.master.tableOps;
  
- import org.apache.accumulo.core.client.impl.Tables;
 -import org.apache.accumulo.core.client.impl.thrift.TableOperation;
  import org.apache.accumulo.fate.Repo;
  import org.apache.accumulo.master.Master;
  import org.apache.accumulo.server.master.state.MergeInfo;
@@@ -60,9 -62,8 +61,8 @@@ class TableRangeOpWait extends MasterRe
      MergeInfo mergeInfo = master.getMergeInfo(tableId);
      log.info("removing merge information " + mergeInfo);
      master.clearMergeState(tableId);
-     Utils.unreserveNamespace(namespaceId, tid, false);
      Utils.unreserveTable(tableId, tid, true);
 -    Utils.unreserveNamespace(Utils.getNamespaceId(master.getInstance(), tableId, TableOperation.MERGE,
this.namespaceId), tid, false);
++    Utils.unreserveNamespace(namespaceId, tid, false);
      return null;
    }
  


Mime
View raw message