yihua commented on code in PR #12900:
URL: https://github.com/apache/hudi/pull/12900#discussion_r1978540573
##########
hudi-common/src/main/java/org/apache/hudi/common/table/timeline/TimelineUtils.java:
##########
@@ -623,4 +624,15 @@ public static Option<InputStream>
getInputStreamOptionLegacy(HoodieTimeline time
}
return Option.of(new ByteArrayInputStream(bytes.get()));
}
+
+ // TODO[HUDI-9094]: work around when caller needs to write byte array in
raw. This method should be removed.
+ public static <T> Option<HoodieInstantWriter>
getHoodieInstantWriterOption(HoodieTimeline timeline, Option<T> metadata) {
+ Option<HoodieInstantWriter> writerOption;
+ if (metadata.isPresent() && metadata.get() instanceof HoodieInstantWriter)
{
+ writerOption = (Option<HoodieInstantWriter>) metadata;
+ } else {
+ writerOption = timeline.getInstantWriter(metadata);
+ }
+ return writerOption;
+ }
Review Comment:
We discussed that the if branch `writerOption =
(Option<HoodieInstantWriter>) metadata;` can still use byte array to retrofit
old logic before such logic is fully cleaned up.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]