rdblue commented on a change in pull request #3663:
URL: https://github.com/apache/iceberg/pull/3663#discussion_r774776627
##########
File path: core/src/main/java/org/apache/iceberg/hadoop/HadoopTables.java
##########
@@ -194,8 +203,24 @@ TableOperations newTableOps(String location) {
if (location.contains(METADATA_JSON)) {
return new StaticTableOperations(location, new HadoopFileIO(conf));
} else {
- return new HadoopTableOperations(new Path(location), new
HadoopFileIO(conf), conf);
+ return new HadoopTableOperations(new Path(location), new
HadoopFileIO(conf), conf,
+ createOrGetLockManager(location));
Review comment:
The `LockManager` is configured by the Hadoop `Configuration`, which is
passed into `HadoopTables` at create time. While this does implement
`Configurable`, I don't think there is any need to support changing lock
manager configurations.
If we tried to support configuration changes we would introduce
inconsistency: what happens when a table is loaded, the config changes, and
then the table is loaded again? Either you use the same lock manager with the
old settings, or you create a different lock manager and break in-memory locks.
There is no need to introduce these worries.
To avoid unnecessary complexity, I think we should remove the cache and
instantiate a lock manager in the constructor that is used for all tables
loaded by this interface. Then we don't have to worry about having a lock
manager per table -- that's a good thing because each lock manager has a
heartbeat thread!
--
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]