You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gobblin.apache.org by GitBox <gi...@apache.org> on 2019/05/10 17:11:19 UTC

[GitHub] [incubator-gobblin] htran1 commented on a change in pull request #2630: [GOBBLIN-767] Support different time units in TimeBasedWriterPartitioner

htran1 commented on a change in pull request #2630: [GOBBLIN-767] Support different time units in TimeBasedWriterPartitioner
URL: https://github.com/apache/incubator-gobblin/pull/2630#discussion_r282966954
 
 

 ##########
 File path: gobblin-core/src/test/java/org/apache/gobblin/writer/partitioner/TimeBasedAvroWriterPartitionerTest.java
 ##########
 @@ -108,23 +114,31 @@ public void testWriter() throws IOException {
     // Write three records, each should be written to a different file
     GenericRecordBuilder genericRecordBuilder = new GenericRecordBuilder(this.schema);
 
+    State state = getBasicState();
+    DataWriter<GenericRecord> millisPartitionWriter = getWriter(state);
+
     // This timestamp corresponds to 2015/01/01
     genericRecordBuilder.set("timestamp", 1420099200000l);
-    this.writer.writeEnvelope(new RecordEnvelope<>(genericRecordBuilder.build()));
+    millisPartitionWriter.writeEnvelope(new RecordEnvelope<>(genericRecordBuilder.build()));
 
     // This timestamp corresponds to 2015/01/02
     genericRecordBuilder.set("timestamp", 1420185600000l);
-    this.writer.writeEnvelope(new RecordEnvelope<>(genericRecordBuilder.build()));
-
-    // This timestamp corresponds to 2015/01/03
-    genericRecordBuilder.set("timestamp", 1420272000000l);
-    this.writer.writeEnvelope(new RecordEnvelope<>(genericRecordBuilder.build()));
+    millisPartitionWriter.writeEnvelope(new RecordEnvelope<>(genericRecordBuilder.build()));
 
+    millisPartitionWriter.close();
+    millisPartitionWriter.commit();
     // Check that the writer reports that 3 records have been written
-    Assert.assertEquals(this.writer.recordsWritten(), 3);
+    Assert.assertEquals(millisPartitionWriter.recordsWritten(), 2);
 
 Review comment:
   Comment and assert do not match.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services