Copilot commented on code in PR #7180:
URL: https://github.com/apache/hbase/pull/7180#discussion_r2243084814
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/tool/LoadIncrementalHFiles.java:
##########
@@ -428,7 +428,9 @@ private Map<LoadQueueItem, ByteBuffer>
performBulkLoad(Admin admin, Table table,
LOG.warn("Secure bulk load has been integrated into HBase core.");
}
-
fsDelegationToken.acquireDelegationToken(queue.peek().getFilePath().getFileSystem(getConf()));
+ Path path = queue.peek().getFilePath();
+ FileSystem fs =
path.getFileSystem(getConf()).resolvePath(path).getFileSystem(getConf());
Review Comment:
The getConf() method is called twice on the same line, which is inefficient.
Consider storing the configuration in a variable to avoid the duplicate call.
```suggestion
Configuration conf = getConf();
FileSystem fs =
path.getFileSystem(conf).resolvePath(path).getFileSystem(conf);
```
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/tool/LoadIncrementalHFiles.java:
##########
@@ -428,7 +428,9 @@ private Map<LoadQueueItem, ByteBuffer>
performBulkLoad(Admin admin, Table table,
LOG.warn("Secure bulk load has been integrated into HBase core.");
}
-
fsDelegationToken.acquireDelegationToken(queue.peek().getFilePath().getFileSystem(getConf()));
+ Path path = queue.peek().getFilePath();
+ FileSystem fs =
path.getFileSystem(getConf()).resolvePath(path).getFileSystem(getConf());
Review Comment:
[nitpick] This line is complex and hard to read due to method chaining.
Consider breaking it into multiple steps for better readability and debugging.
```suggestion
FileSystem initialFileSystem = path.getFileSystem(getConf());
Path resolvedPath = initialFileSystem.resolvePath(path);
FileSystem fs = resolvedPath.getFileSystem(getConf());
```
--
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]