BsoBird commented on code in PR #10623:
URL: https://github.com/apache/iceberg/pull/10623#discussion_r1669916171
##########
core/src/main/java/org/apache/iceberg/hadoop/HadoopTableOperations.java:
##########
@@ -159,18 +169,124 @@ public void commit(TableMetadata base, TableMetadata
metadata) {
int nextVersion = (current.first() != null ? current.first() : 0) + 1;
Path finalMetadataFile = metadataFilePath(nextVersion, codec);
FileSystem fs = getFileSystem(tempMetadataFile, conf);
+ boolean versionCommitSuccess = false;
+ boolean useObjectStore =
+ metadata.propertyAsBoolean(
+ TableProperties.OBJECT_STORE_ENABLED,
TableProperties.OBJECT_STORE_ENABLED_DEFAULT);
+ int previousVersionsMax =
+ metadata.propertyAsInt(
+ TableProperties.METADATA_PREVIOUS_VERSIONS_MAX,
+ TableProperties.METADATA_PREVIOUS_VERSIONS_MAX_DEFAULT);
+ // todo:Currently, if the user is using an object store, we assume that he
must be using the
+ // global locking service. But we should support add some other
conditions in future.
+ boolean supportGlobalLocking = useObjectStore;
Review Comment:
This flag actually serves to distinguish the difference in behaviour between
block storage and object storage.In the original design, we should have been
more careful in determining the type of the current filesystem, and used
different execution strategies for different filesystems. But in practice, if
we use the global locking service, the logic for committing a new version is
the same regardless of the filesystem we use. So in the end, we'll just use
this identifier to differentiate.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]