use of org.projectnessie.model.IcebergTable in project nessie by projectnessie.
the class TableCommitMetaStoreWorker method toStoreGlobalState.
@Override
public ByteString toStoreGlobalState(Content content) {
ObjectTypes.Content.Builder builder = ObjectTypes.Content.newBuilder().setId(content.getId());
if (content instanceof IcebergTable) {
IcebergTable state = (IcebergTable) content;
ObjectTypes.IcebergMetadataPointer.Builder stateBuilder = ObjectTypes.IcebergMetadataPointer.newBuilder().setMetadataLocation(state.getMetadataLocation());
builder.setIcebergMetadataPointer(stateBuilder);
} else if (content instanceof IcebergView) {
IcebergView state = (IcebergView) content;
ObjectTypes.IcebergMetadataPointer.Builder stateBuilder = ObjectTypes.IcebergMetadataPointer.newBuilder().setMetadataLocation(state.getMetadataLocation());
builder.setIcebergMetadataPointer(stateBuilder);
} else {
throw new IllegalArgumentException("Unknown type " + content);
}
return builder.build().toByteString();
}
Aggregations