dlmarion commented on code in PR #3506:
URL: https://github.com/apache/accumulo/pull/3506#discussion_r1236993772


##########
server/base/src/test/java/org/apache/accumulo/server/constraints/MetadataConstraintsTest.java:
##########
@@ -202,60 +211,113 @@ public void testBulkFileCheck() {
 
     // two files w/ one active txid
     m = new Mutation(new Text("0;foo"));
-    m.put(BulkFileColumnFamily.NAME, new Text("/someFile"), new Value("5"));
-    m.put(DataFileColumnFamily.NAME, new Text("/someFile"),
+    m.put(BulkFileColumnFamily.NAME, new 
Text("hdfs://nn1/a/accumulo/tables/2b/t-001/someFile"),
+        new Value("5"));
+    m.put(DataFileColumnFamily.NAME, new 
Text("hdfs://nn1/a/accumulo/tables/2b/t-001/someFile"),
         new DataFileValue(1, 1).encodeAsValue());
-    m.put(BulkFileColumnFamily.NAME, new Text("/someFile2"), new Value("5"));
-    m.put(DataFileColumnFamily.NAME, new Text("/someFile2"),
+    m.put(BulkFileColumnFamily.NAME, new 
Text("hdfs://nn1/a/accumulo/tables/2b/t-001/someFile2"),
+        new Value("5"));
+    m.put(DataFileColumnFamily.NAME, new 
Text("hdfs://nn1/a/accumulo/tables/2b/t-001/someFile2"),
         new DataFileValue(1, 1).encodeAsValue());
     violations = mc.check(createEnv(), m);
     assertNull(violations);
 
     // two loaded w/ one active txid and one file
     m = new Mutation(new Text("0;foo"));
-    m.put(BulkFileColumnFamily.NAME, new Text("/someFile"), new Value("5"));
-    m.put(DataFileColumnFamily.NAME, new Text("/someFile"),
+    m.put(BulkFileColumnFamily.NAME, new 
Text("hdfs://nn1/a/accumulo/tables/2b/t-001/someFile"),
+        new Value("5"));
+    m.put(DataFileColumnFamily.NAME, new 
Text("hdfs://nn1/a/accumulo/tables/2b/t-001/someFile"),
         new DataFileValue(1, 1).encodeAsValue());
-    m.put(BulkFileColumnFamily.NAME, new Text("/someFile2"), new Value("5"));
+    m.put(BulkFileColumnFamily.NAME, new 
Text("hdfs://nn1/a/accumulo/tables/2b/t-001/someFile2"),
+        new Value("5"));
     violations = mc.check(createEnv(), m);
     assertNotNull(violations);
     assertEquals(1, violations.size());
     assertEquals(Short.valueOf((short) 8), violations.get(0));
 
     // active txid, mutation that looks like split
     m = new Mutation(new Text("0;foo"));
-    m.put(BulkFileColumnFamily.NAME, new Text("/someFile"), new Value("5"));
+    m.put(BulkFileColumnFamily.NAME, new 
Text("hdfs://nn1/a/accumulo/tables/2b/t-001/someFile"),
+        new Value("5"));
     ServerColumnFamily.DIRECTORY_COLUMN.put(m, new Value("/t1"));
     violations = mc.check(createEnv(), m);
     assertNull(violations);
 
     // inactive txid, mutation that looks like split
     m = new Mutation(new Text("0;foo"));
-    m.put(BulkFileColumnFamily.NAME, new Text("/someFile"), new 
Value("12345"));
+    m.put(BulkFileColumnFamily.NAME, new 
Text("hdfs://nn1/a/accumulo/tables/2b/t-001/someFile"),
+        new Value("12345"));
     ServerColumnFamily.DIRECTORY_COLUMN.put(m, new Value("/t1"));
     violations = mc.check(createEnv(), m);
     assertNull(violations);
 
     // active txid, mutation that looks like a load
     m = new Mutation(new Text("0;foo"));
-    m.put(BulkFileColumnFamily.NAME, new Text("/someFile"), new Value("5"));
+    m.put(BulkFileColumnFamily.NAME, new 
Text("hdfs://nn1/a/accumulo/tables/2b/t-001/someFile"),
+        new Value("5"));
     m.put(CurrentLocationColumnFamily.NAME, new Text("789"), new 
Value("127.0.0.1:9997"));
     violations = mc.check(createEnv(), m);
     assertNull(violations);
 
     // inactive txid, mutation that looks like a load
     m = new Mutation(new Text("0;foo"));
-    m.put(BulkFileColumnFamily.NAME, new Text("/someFile"), new 
Value("12345"));
+    m.put(BulkFileColumnFamily.NAME, new 
Text("hdfs://nn1/a/accumulo/tables/2b/t-001/someFile"),
+        new Value("12345"));
     m.put(CurrentLocationColumnFamily.NAME, new Text("789"), new 
Value("127.0.0.1:9997"));
     violations = mc.check(createEnv(), m);
     assertNull(violations);
 
     // deleting a load flag
     m = new Mutation(new Text("0;foo"));
-    m.putDelete(BulkFileColumnFamily.NAME, new Text("/someFile"));
+    m.putDelete(BulkFileColumnFamily.NAME,
+        new Text("hdfs://nn1/a/accumulo/tables/2b/t-001/someFile"));
+    violations = mc.check(createEnv(), m);
+    assertNull(violations);
+
+  }
+
+  @Test
+  public void testDataFileCheck() {
+    testFileMetadataValidation(DataFileColumnFamily.NAME);
+  }
+
+  @Test
+  public void testScanFileCheck() {
+    testFileMetadataValidation(ScanFileColumnFamily.NAME);
+  }
+
+  private void testFileMetadataValidation(Text columnFamily) {

Review Comment:
   you aren't using the input argument in the method body.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to