accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmil...@apache.org
Subject [01/10] accumulo git commit: ACCUMULO-3238 Table.ID Namespace.ID Refactor
Date Tue, 18 Jul 2017 20:48:05 GMT
Repository: accumulo
Updated Branches:
  refs/heads/master 87e5780d7 -> d6ea49e03


http://git-wip-us.apache.org/repos/asf/accumulo/blob/d6ea49e0/test/src/main/java/org/apache/accumulo/test/replication/UnusedWalDoesntCloseReplicationStatusIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/replication/UnusedWalDoesntCloseReplicationStatusIT.java
b/test/src/main/java/org/apache/accumulo/test/replication/UnusedWalDoesntCloseReplicationStatusIT.java
index 0eae4f3..5219d1a 100644
--- a/test/src/main/java/org/apache/accumulo/test/replication/UnusedWalDoesntCloseReplicationStatusIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/replication/UnusedWalDoesntCloseReplicationStatusIT.java
@@ -30,6 +30,7 @@ import org.apache.accumulo.core.client.BatchWriter;
 import org.apache.accumulo.core.client.BatchWriterConfig;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.Scanner;
+import org.apache.accumulo.core.client.impl.Table;
 import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Mutation;
@@ -77,8 +78,8 @@ public class UnusedWalDoesntCloseReplicationStatusIT extends ConfigurableMacBase
     conn.securityOperations().grantTablePermission("root", MetadataTable.NAME, TablePermission.WRITE);
     conn.tableOperations().create(tableName);
 
-    final String tableId = conn.tableOperations().tableIdMap().get(tableName);
-    final int numericTableId = Integer.parseInt(tableId);
+    final Table.ID tableId = new Table.ID(conn.tableOperations().tableIdMap().get(tableName));
+    final int numericTableId = Integer.parseInt(tableId.canonicalID());
     final int fakeTableId = numericTableId + 1;
 
     Assert.assertNotNull("Did not find table ID", tableId);
@@ -113,7 +114,7 @@ public class UnusedWalDoesntCloseReplicationStatusIT extends ConfigurableMacBase
     value.write(out);
 
     key.event = LogEvents.DEFINE_TABLET;
-    key.tablet = new KeyExtent(Integer.toString(fakeTableId), null, null);
+    key.tablet = new KeyExtent(new Table.ID(Integer.toString(fakeTableId)), null, null);
     key.seq = 1l;
     key.tid = 1;
 
@@ -177,7 +178,7 @@ public class UnusedWalDoesntCloseReplicationStatusIT extends ConfigurableMacBase
 
     // Add a replication entry for our fake WAL
     m = new Mutation(MetadataSchema.ReplicationSection.getRowPrefix() + new Path(walUri).toString());
-    m.put(MetadataSchema.ReplicationSection.COLF, new Text(tableId), new Value(StatusUtil.fileCreated(System.currentTimeMillis()).toByteArray()));
+    m.put(MetadataSchema.ReplicationSection.COLF, new Text(tableId.getUtf8()), new Value(StatusUtil.fileCreated(System.currentTimeMillis()).toByteArray()));
     bw.addMutation(m);
     bw.close();
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/d6ea49e0/test/src/main/java/org/apache/accumulo/test/replication/WorkMakerIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/replication/WorkMakerIT.java b/test/src/main/java/org/apache/accumulo/test/replication/WorkMakerIT.java
index 6e2c833..81fefd5 100644
--- a/test/src/main/java/org/apache/accumulo/test/replication/WorkMakerIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/replication/WorkMakerIT.java
@@ -24,6 +24,7 @@ import java.util.Set;
 import org.apache.accumulo.core.client.BatchWriter;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.Scanner;
+import org.apache.accumulo.core.client.impl.Table;
 import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Mutation;
@@ -62,7 +63,7 @@ public class WorkMakerIT extends ConfigurableMacBase {
     }
 
     @Override
-    public void addWorkRecord(Text file, Value v, Map<String,String> targets, String
sourceTableId) {
+    public void addWorkRecord(Text file, Value v, Map<String,String> targets, Table.ID
sourceTableId) {
       super.addWorkRecord(file, v, targets, sourceTableId);
     }
 
@@ -85,13 +86,13 @@ public class WorkMakerIT extends ConfigurableMacBase {
   public void singleUnitSingleTarget() throws Exception {
     String table = testName.getMethodName();
     conn.tableOperations().create(table);
-    String tableId = conn.tableOperations().tableIdMap().get(table);
+    Table.ID tableId = new Table.ID(conn.tableOperations().tableIdMap().get(table));
     String file = "hdfs://localhost:8020/accumulo/wal/123456-1234-1234-12345678";
 
     // Create a status record for a file
     long timeCreated = System.currentTimeMillis();
     Mutation m = new Mutation(new Path(file).toString());
-    m.put(StatusSection.NAME, new Text(tableId), StatusUtil.fileCreatedValue(timeCreated));
+    m.put(StatusSection.NAME, new Text(tableId.getUtf8()), StatusUtil.fileCreatedValue(timeCreated));
     BatchWriter bw = ReplicationTable.getBatchWriter(conn);
     bw.addMutation(m);
     bw.flush();
@@ -127,12 +128,12 @@ public class WorkMakerIT extends ConfigurableMacBase {
     String table = testName.getMethodName();
     conn.tableOperations().create(table);
 
-    String tableId = conn.tableOperations().tableIdMap().get(table);
+    Table.ID tableId = new Table.ID(conn.tableOperations().tableIdMap().get(table));
 
     String file = "hdfs://localhost:8020/accumulo/wal/123456-1234-1234-12345678";
 
     Mutation m = new Mutation(new Path(file).toString());
-    m.put(StatusSection.NAME, new Text(tableId), StatusUtil.fileCreatedValue(System.currentTimeMillis()));
+    m.put(StatusSection.NAME, new Text(tableId.getUtf8()), StatusUtil.fileCreatedValue(System.currentTimeMillis()));
     BatchWriter bw = ReplicationTable.getBatchWriter(conn);
     bw.addMutation(m);
     bw.flush();


Mime
View raw message