diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeDirectory.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeDirectory.java index dc474ef59d..699d665f7f 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeDirectory.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeDirectory.java @@ -902,7 +902,7 @@ void update_subtree(Set renameSet) { } try { if (strAttr.size() > 0) { - INodeKeyedObjects.setTxnId(DatabaseINode.batchUpdateINodes(longAttr, strAttr, fileIds, fileAttr)); + INodeKeyedObjects.setUniqueId(DatabaseINode.batchUpdateINodes(longAttr, strAttr, fileIds, fileAttr)); } } catch (Exception e) { e.printStackTrace(); @@ -981,8 +981,8 @@ public void remoteRename(INode node, String oldName, String oldParent, String ne // update_subtree_v2(renameSet, address); } - long start = INodeKeyedObjects.getTxnId(); - INodeKeyedObjects.setTxnId(DatabaseINode.updateSubtree(old_id, 40000000, + long start = INodeKeyedObjects.getUniqueId(); + INodeKeyedObjects.setUniqueId(DatabaseINode.updateSubtree(old_id, 40000000, oldParent, "/nnThroughputBenchmark/rename", node.getParentId()) ); try{ @@ -990,7 +990,7 @@ public void remoteRename(INode node, String oldName, String oldParent, String ne } catch (Exception e) { e.printStackTrace(); } - long end = INodeKeyedObjects.getTxnId(); + long end = INodeKeyedObjects.getUniqueId(); FSDirectory.getInstance() .getEditLog() .logRenameMP("/nnThroughputBenchmark/create", "/nnThroughputBenchmark/rename", diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeKeyedObjects.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeKeyedObjects.java index def233a689..352e2615db 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeKeyedObjects.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeKeyedObjects.java @@ -28,8 +28,8 @@ public class INodeKeyedObjects { private static long preRenameSize = 0; private static long preUpdateSize = 0; - // gloabal transaction ID (VoltDB) - private static AtomicLong txnId = new AtomicLong();; + // gloabal unique ID (VoltDB) + private static AtomicLong uniqueId = new AtomicLong(); private static ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1); @@ -37,12 +37,12 @@ public class INodeKeyedObjects { INodeKeyedObjects() {} - public static long getTxnId() { - return txnId.longValue(); + public static long getUniqueId() { + return uniqueId.longValue(); } - public static void setTxnId(long id) { - txnId.set(id); + public static void setUniqueId(long id) { + uniqueId.set(id); } public static Set getUpdateSet() { @@ -117,7 +117,7 @@ private static void insertToDB() { } try { if (strAttr.size() > 0) { - INodeKeyedObjects.setTxnId(DatabaseINode.batchUpdateINodes(longAttr, strAttr, fileIds, fileAttr)); + INodeKeyedObjects.setUniqueId(DatabaseINode.batchUpdateINodes(longAttr, strAttr, fileIds, fileAttr)); } } catch (Exception e) { e.printStackTrace(); @@ -161,7 +161,7 @@ private static void insertToDB() { iterator.remove(); } if (strAttr.size() > 0) { - INodeKeyedObjects.setTxnId(DatabaseINode.batchUpdateINodes(longAttr, strAttr, fileIds, fileAttr)); + INodeKeyedObjects.setUniqueId(DatabaseINode.batchUpdateINodes(longAttr, strAttr, fileIds, fileAttr)); } } catch (Exception e) { e.printStackTrace(); diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeWithAdditionalFields.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeWithAdditionalFields.java index 0aecddc6b8..97470cebe9 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeWithAdditionalFields.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeWithAdditionalFields.java @@ -407,7 +407,7 @@ private static void update_subtree(Set inodes) { } try { if (strAttr.size() > 0) { - INodeKeyedObjects.setTxnId(DatabaseINode.batchUpdateINodes(longAttr, strAttr, fileIds, fileAttr)); + INodeKeyedObjects.setUniqueId(DatabaseINode.batchUpdateINodes(longAttr, strAttr, fileIds, fileAttr)); } } catch (Exception e) { e.printStackTrace(); @@ -504,14 +504,14 @@ private final void remoteChmod(Set> mpoints) { // 2. execute distributed txn LOG.info("Execute dist txn for chmod"); - long start = INodeKeyedObjects.getTxnId(); - INodeKeyedObjects.setTxnId(DatabaseINode.setPermissions(parents, names, this.permission)); + long start = INodeKeyedObjects.getUniqueId(); + INodeKeyedObjects.setUniqueId(DatabaseINode.setPermissions(parents, names, this.permission)); try{ Thread.sleep(2); // 2 ms } catch (Exception e) { e.printStackTrace(); } - long end = INodeKeyedObjects.getTxnId(); + long end = INodeKeyedObjects.getUniqueId(); FSDirectory.getInstance() .getEditLog() .logSetPermissionsMP(getPath(), new FsPermission(getFsPermissionShort()), start, end); @@ -530,7 +530,7 @@ private final void updatePermissionStatus(PermissionStatusFormat f, long n) { e.printStackTrace(); } } else { - INodeKeyedObjects.setTxnId(DatabaseINode.setPermission(getId(), this.permission)); + INodeKeyedObjects.setUniqueId(DatabaseINode.setPermission(getId(), this.permission)); } } diff --git a/voltdb/BatchUpdateINodes.java b/voltdb/BatchUpdateINodes.java index b2261c82b5..6ef2bd63fb 100644 --- a/voltdb/BatchUpdateINodes.java +++ b/voltdb/BatchUpdateINodes.java @@ -38,6 +38,6 @@ public long run( } voltExecuteSQL(); - return getTxnId(); + return getUniqueId(); } } diff --git a/voltdb/SetPermission.java b/voltdb/SetPermission.java index 4bce6f30c1..46d3fabe9c 100644 --- a/voltdb/SetPermission.java +++ b/voltdb/SetPermission.java @@ -8,6 +8,6 @@ public class SetPermissions extends VoltProcedure { public long run(final long id, final long permission) throws VoltAbortException { voltQueueSQL(sql, permission, id); voltExecuteSQL(); - return getTxnId(); + return getUniqueId(); } } diff --git a/voltdb/SetPermissions.java b/voltdb/SetPermissions.java index 591555efcf..f7cb5c5ab4 100644 --- a/voltdb/SetPermissions.java +++ b/voltdb/SetPermissions.java @@ -10,6 +10,6 @@ public long run(final String[] parents, final String[] names, final long permiss voltQueueSQL(sql, permission, parents[i], names[i]); } voltExecuteSQL(); - return getTxnId(); + return getUniqueId(); } } diff --git a/voltdb/UpdateSubtree.java b/voltdb/UpdateSubtree.java index 2761770048..65d0e6718f 100644 --- a/voltdb/UpdateSubtree.java +++ b/voltdb/UpdateSubtree.java @@ -87,6 +87,6 @@ public long run(final long dir_id, final long dest_id, final String old_parent_n } voltExecuteSQL(); - return getTxnId(); + return getUniqueId(); } }