rdblue commented on a change in pull request #3663:
URL: https://github.com/apache/iceberg/pull/3663#discussion_r767315524
##########
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:
This class should only need one `LockManager`. The same `LockManager` is
thread safe and can be shared by all the `TableOperations`. That's how the
original use in `GlueCatalog` works.
##########
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));
+ }
+ }
+
+ private LockManager createOrGetLockManager(String location) {
Review comment:
Nit: most APIs use `getOrCreate` instead of `createOrGet`.
##########
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));
+ }
+ }
+
+ private LockManager createOrGetLockManager(String location) {
+ Map<String, String> properties = new HashMap<>();
Review comment:
Nit: use `Maps.newHashMap()` instead.
--
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]