You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2019/03/22 03:45:16 UTC

[GitHub] [incubator-hudi] ambition119 commented on a change in pull request #608: [HUDI-63] Removed unused BucketedIndex code

ambition119 commented on a change in pull request #608: [HUDI-63] Removed unused BucketedIndex code
URL: https://github.com/apache/incubator-hudi/pull/608#discussion_r268030187
 
 

 ##########
 File path: hoodie-common/src/main/java/com/uber/hoodie/common/table/log/block/HoodieAvroDataBlock.java
 ##########
 @@ -115,26 +115,7 @@ public static HoodieLogBlock getBlock(HoodieLogFile logFile,
 
     // 3. Write the records
     Iterator<IndexedRecord> itr = records.iterator();
-    while (itr.hasNext()) {
-      IndexedRecord s = itr.next();
-      ByteArrayOutputStream temp = new ByteArrayOutputStream();
-      Encoder encoder = EncoderFactory.get().binaryEncoder(temp, null);
-      try {
-        // Encode the record into bytes
-        writer.write(s, encoder);
-        encoder.flush();
-
-        // Get the size of the bytes
-        int size = temp.toByteArray().length;
-        // Write the record size
-        output.writeInt(size);
-        // Write the content
-        output.write(temp.toByteArray());
-        itr.remove();
-      } catch (IOException e) {
-        throw new HoodieIOException("IOException converting HoodieAvroDataBlock to bytes", e);
-      }
-    }
+    writerIndexedRecord(writer, output, itr);
 
 Review comment:
   > same here.. please just limit this PR to BucketedIndex removal
   
   ok, I fix this content.

----------------------------------------------------------------
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