accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] ctubbsii commented on a change in pull request #880: Make new Bulk Import tableTime take boolean
Date Wed, 09 Jan 2019 17:15:09 GMT
ctubbsii commented on a change in pull request #880: Make new Bulk Import tableTime take boolean
URL: https://github.com/apache/accumulo/pull/880#discussion_r246466876
 
 

 ##########
 File path: test/src/main/java/org/apache/accumulo/test/functional/BulkLoadIT.java
 ##########
 @@ -127,27 +130,42 @@ private void testSingleTabletSingleFile(AccumuloClient c, boolean offline)
throw
 
     String h1 = writeData(dir + "/f1.", aconf, 0, 332);
 
-    c.tableOperations().importDirectory(dir).to(tableName).load();
+    c.tableOperations().importDirectory(dir).to(tableName).tableTime(setTime).load();
 
     if (offline)
       c.tableOperations().online(tableName);
 
-    verifyData(c, tableName, 0, 332);
+    verifyData(c, tableName, 0, 332, setTime);
     verifyMetadata(c, tableName,
         ImmutableMap.of("0333", ImmutableSet.of(h1), "null", ImmutableSet.of()));
   }
 
   @Test
   public void testSingleTabletSingleFile() throws Exception {
     try (AccumuloClient client = createAccumuloClient()) {
-      testSingleTabletSingleFile(client, false);
+      testSingleTabletSingleFile(client, false, false);
+    }
+  }
+
+  @Test
+  public void testSetTime() throws Exception {
+    try (AccumuloClient client = createAccumuloClient()) {
+      tableName = "testSetTime_table1";
+      NewTableConfiguration newTableConf = new NewTableConfiguration();
+      // set logical time type so we can set time on bulk import
+      newTableConf.setTimeType(TimeType.LOGICAL);
+      client.tableOperations().create(tableName, newTableConf);
+      aconf = getCluster().getServerContext().getConfiguration();
+      fs = getCluster().getFileSystem();
+      rootPath = cluster.getTemporaryPath().toString();
+      testSingleTabletSingleFile(client, false, true);
     }
   }
 
   @Test
   public void testSingleTabletSingleFileOffline() throws Exception {
     try (AccumuloClient client = createAccumuloClient()) {
-      testSingleTabletSingleFile(client, true);
+      testSingleTabletSingleFile(client, true, false);
 
 Review comment:
   Probably not worth a follow-up in this case. I only mention it to contrast a "good" use
of boolean in the fluent API, vs. (what I see as) a "bad" use here in this lots-of-flags-as-separate-params
method.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message