autumnust commented on a change in pull request #2856: [GOBBLIN-1011] adjust 
compaction flow to work with virtual partition
URL: https://github.com/apache/incubator-gobblin/pull/2856#discussion_r360973628
 
 

 ##########
 File path: 
gobblin-compaction/src/test/java/org/apache/gobblin/compaction/mapreduce/AvroCompactionTaskTest.java
 ##########
 @@ -103,6 +105,41 @@ public void testNonDedup() throws Exception {
     Assert.assertTrue(result.isSuccessful());
   }
 
+  @Test
+  public void testCompactVirtualDataset() throws Exception {
+
+    File basePath = Files.createTempDir();
+    basePath.deleteOnExit();
+
+    File jobDir = new File(basePath, "PageViewEvent");
+    Assert.assertTrue(jobDir.mkdirs());
+
+    String pattern = new Path(basePath.getAbsolutePath(), "*").toString();
+    String jobName = "compaction-virtual";
+
+    EmbeddedGobblin embeddedGobblin = new EmbeddedGobblin(jobName)
+        .setConfiguration(ConfigurationKeys.SOURCE_CLASS_KEY, 
CompactionSource.class.getName())
+        
.setConfiguration(ConfigurableGlobDatasetFinder.DATASET_FINDER_PATTERN_KEY, 
pattern)
+        .setConfiguration(MRCompactor.COMPACTION_INPUT_DIR, 
basePath.toString())
+        .setConfiguration(MRCompactor.COMPACTION_INPUT_SUBDIR, "hourly")
+        .setConfiguration(MRCompactor.COMPACTION_DEST_DIR, basePath.toString())
+        .setConfiguration(MRCompactor.COMPACTION_DEST_SUBDIR, "daily")
+        .setConfiguration(MRCompactor.COMPACTION_TMP_DEST_DIR, 
"/tmp/compaction/" + jobName)
+        
.setConfiguration(TimeBasedSubDirDatasetsFinder.COMPACTION_TIMEBASED_MAX_TIME_AGO,
 "3d")
+        
.setConfiguration(TimeBasedSubDirDatasetsFinder.COMPACTION_TIMEBASED_MIN_TIME_AGO,
 "1d")
+        .setConfiguration(ConfigurationKeys.MAX_TASK_RETRIES_KEY, "0")
+        .setConfiguration(DatasetUtils.DATASET_PROFILE_CLASS_KEY,
+            
"org.apache.gobblin.data.management.dataset.TimePartitionGlobFinder")
+        .setConfiguration(TimePartitionGlobFinder.PARTITION_PREFIX, "hourly/")
+        .setConfiguration(TimePartitionGlobFinder.TIME_FORMAT, "yyyy/MM/dd")
+        .setConfiguration(TimePartitionGlobFinder.GRANULARITY, "DAY")
+        .setConfiguration(TimePartitionGlobFinder.LOOKBACK_SPEC, "P3D")
+        .setConfiguration(TimePartitionGlobFinder.ENABLE_VIRTUAL_PARTITION, 
"true");
+
+    JobExecutionResult result = embeddedGobblin.run();
+    Assert.assertTrue(result.isSuccessful());
 
 Review comment:
   Shall we need to verify the contents of execution beyond simply verifying if 
the exception is successful ? 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to