Davis-Zhang-Onehouse commented on code in PR #12826:
URL: https://github.com/apache/hudi/pull/12826#discussion_r1964389169
##########
hudi-common/src/main/java/org/apache/hudi/common/table/timeline/TimelineUtils.java:
##########
@@ -604,4 +612,33 @@ public static boolean isDeletePartition(WriteOperationType
operation) {
|| operation == WriteOperationType.INSERT_OVERWRITE_TABLE
|| operation == WriteOperationType.INSERT_OVERWRITE;
}
+
+ public static boolean isEmpty(HoodieTableMetaClient metaClient,
HoodieInstant instant) {
+ try {
+ return metaClient.getStorage()
+ .getPathInfo(new StoragePath(metaClient.getTimelinePath(),
metaClient.getInstantFileNameGenerator().getFileName(instant)))
+ .getLength() == 0;
+ } catch (IOException e) {
+ throw new HoodieIOException("Failed to check emptiness of instant " +
instant, e);
+ }
+ }
+
+ public static Option<InputStream> getInputStreamOptionLegacy(HoodieTimeline
timeline, HoodieInstant instant) {
+ Option<byte[]> bytes = timeline.getInstantDetails(instant);
+ if (bytes.isEmpty() || bytes.get().length == 0) {
+ return Option.empty();
+ }
+ return Option.of(new ByteArrayInputStream(bytes.get()));
+ }
+
+ public static Option<HoodieInstant> getInstantFromTimeline(HoodieInstant
instant, HoodieActiveTimeline timeline, Option<HoodieInstant> actualInstant) {
Review Comment:
https://issues.apache.org/jira/browse/HUDI-9063 discussed with Ethan, we
will make incremental progress
--
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]