Apache9 commented on code in PR #4622:
URL: https://github.com/apache/hbase/pull/4622#discussion_r922637717
##########
hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupSystemTable.java:
##########
@@ -1639,7 +1642,7 @@ public String[] getListOfBackupIdsFromDeleteOperation()
throws IOException {
if (val.length == 0) {
return null;
}
- return new String(val).split(",");
+ return new String(val, StandardCharsets.UTF_8).split(",");
Review Comment:
I think this will introduce another error prone warning? Use guava's
Splitter.on
##########
hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupSystemTable.java:
##########
@@ -1720,7 +1723,7 @@ public String[] getListOfBackupIdsFromMergeOperation()
throws IOException {
if (val.length == 0) {
return null;
}
- return new String(val).split(",");
+ return new String(val, StandardCharsets.UTF_8).split(",");
Review Comment:
Ditto.
##########
hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupSystemTable.java:
##########
@@ -1736,11 +1739,13 @@ static Scan createScanForOrigBulkLoadedFiles(TableName
table) {
return scan;
}
+ @SuppressWarnings("StringSplitter")
Review Comment:
Since we have shaded guava, I think it is OK for use to make use of guava's
Splitter.
##########
hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/util/BackupUtils.java:
##########
@@ -731,6 +733,7 @@ public static BulkLoadHFiles createLoader(Configuration
config) {
return BulkLoadHFiles.create(conf);
}
+ @SuppressWarnings("StringSplitter")
Review Comment:
Ditto.
##########
hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/util/BackupUtils.java:
##########
@@ -593,6 +594,7 @@ public int compare(BackupInfo o1, BackupInfo o2) {
return ts1 < ts2 ? 1 : -1;
}
+ @SuppressWarnings("StringSplitter")
Review Comment:
Ditto.
##########
hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/util/BackupUtils.java:
##########
@@ -275,12 +276,12 @@ public static List<String> getWALFilesOlderThan(final
Configuration c,
return logFiles;
}
+ @SuppressWarnings("StringSplitter")
Review Comment:
DItto.
##########
hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupSystemTable.java:
##########
@@ -1736,11 +1739,13 @@ static Scan createScanForOrigBulkLoadedFiles(TableName
table) {
return scan;
}
+ @SuppressWarnings("StringSplitter")
static String getTableNameFromOrigBulkLoadRow(String rowStr) {
String[] parts = rowStr.split(BLK_LD_DELIM);
return parts[1];
}
+ @SuppressWarnings("StringSplitter")
Review Comment:
Ditto.
--
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]