bvaradar commented on a change in pull request #726: Introduce HoodieReadHandle
abstraction into index
URL: https://github.com/apache/incubator-hudi/pull/726#discussion_r293005031
##########
File path:
hoodie-client/src/main/java/com/uber/hoodie/io/HoodieMergeHandle.java
##########
@@ -85,6 +87,64 @@ public HoodieMergeHandle(HoodieWriteConfig config, String
commitTime, HoodieTabl
.getPartitionPath(), dataFileToBeMerged);
}
+
+ public static Schema createHoodieWriteSchema(Schema originalSchema) {
+ return HoodieAvroUtils.addMetadataFields(originalSchema);
+ }
+
+ public Path makeNewPath(String partitionPath) {
+ Path path = FSUtils.getPartitionPath(config.getBasePath(), partitionPath);
+ try {
+ fs.mkdirs(path); // create a new partition as needed.
+ } catch (IOException e) {
+ throw new HoodieIOException("Failed to make dir " + path, e);
+ }
+
+ return new Path(path.toString(), FSUtils.makeDataFileName(instantTime,
writeToken, fileId));
+ }
+
+ public Schema getWriterSchema() {
+ return writerSchema;
+ }
+
+ /**
+ * Determines whether we can accept the incoming records, into the current
file, depending on
+ * <p>
+ * - Whether it belongs to the same partitionPath as existing records -
Whether the current file written bytes lt max
+ * file size
+ */
+ public boolean canWrite(HoodieRecord record) {
Review comment:
Move this to WriteHandle ?
----------------------------------------------------------------
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