xushiyan commented on code in PR #5064:
URL: https://github.com/apache/hudi/pull/5064#discussion_r1055311023
##########
hudi-platform-service/hudi-metaserver/src/main/java/org/apache/hudi/metaserver/client/HoodieMetaserverClientImp.java:
##########
@@ -108,35 +108,42 @@ public void createTable(Table table) {
}
}
+ @Override
public List<HoodieInstant> listInstants(String db, String tb, int commitNum)
{
return exceptionWrapper(() -> this.client.listInstants(db, tb,
commitNum).stream()
- .map(EntityConvertor::fromTHoodieInstant)
+ .map(EntityConversions::fromTHoodieInstant)
.collect(Collectors.toList())).get();
}
+ @Override
public Option<byte[]> getInstantMeta(String db, String tb, HoodieInstant
instant) {
- ByteBuffer bytes = exceptionWrapper(() -> this.client.getInstantMeta(db,
tb, EntityConvertor.toTHoodieInstant(instant))).get();
- Option<byte[]> res = bytes.capacity() == 0 ? Option.empty() :
Option.of(bytes.array());
- return res;
+ ByteBuffer byteBuffer = exceptionWrapper(() ->
this.client.getInstantMeta(db, tb,
EntityConversions.toTHoodieInstant(instant))).get();
+ byte[] bytes = new byte[byteBuffer.remaining()];
+ byteBuffer.get(bytes);
+ return byteBuffer.hasRemaining() ? Option.empty() : Option.of(bytes);
Review Comment:
> Flink will commit the instant with empty instant meta?
sounds like it's a responsibility of who commits the instant to decide what
to write. Here we better stick to what is desirable from API design
perspective. Also would like to see the relevant code to make a better judgement
--
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]