NihalJain commented on code in PR #7975:
URL: https://github.com/apache/hbase/pull/7975#discussion_r2988883454
##########
hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/TableSnapshotInputFormatImpl.java:
##########
@@ -424,74 +424,76 @@ public static List<InputSplit> getSplits(Scan scan,
SnapshotManifest manifest,
Connection connection = null;
RegionLocator regionLocator = null;
- if (localityEnabled && useRegionLoc) {
- Configuration newConf = new Configuration(conf);
- newConf.setInt("hbase.hconnection.threads.max", 1);
- try {
+ List<InputSplit> splits = new ArrayList<>();
+ try {
+ if (localityEnabled && useRegionLoc) {
+ Configuration newConf = new Configuration(conf);
+ newConf.setInt("hbase.hconnection.threads.max", 1);
+
Review Comment:
can we do try-with-resources here
##########
hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/TableSnapshotInputFormatImpl.java:
##########
@@ -424,74 +424,76 @@ public static List<InputSplit> getSplits(Scan scan,
SnapshotManifest manifest,
Connection connection = null;
RegionLocator regionLocator = null;
- if (localityEnabled && useRegionLoc) {
- Configuration newConf = new Configuration(conf);
- newConf.setInt("hbase.hconnection.threads.max", 1);
- try {
+ List<InputSplit> splits = new ArrayList<>();
+ try {
Review Comment:
can we do try-with-resources here
##########
hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/TableSnapshotInputFormatImpl.java:
##########
@@ -424,74 +424,76 @@ public static List<InputSplit> getSplits(Scan scan,
SnapshotManifest manifest,
Connection connection = null;
RegionLocator regionLocator = null;
- if (localityEnabled && useRegionLoc) {
- Configuration newConf = new Configuration(conf);
- newConf.setInt("hbase.hconnection.threads.max", 1);
- try {
+ List<InputSplit> splits = new ArrayList<>();
+ try {
+ if (localityEnabled && useRegionLoc) {
+ Configuration newConf = new Configuration(conf);
+ newConf.setInt("hbase.hconnection.threads.max", 1);
+
Review Comment:
can we do try-with-resources here
--
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]