bbeaudreault commented on code in PR #4932:
URL: https://github.com/apache/hbase/pull/4932#discussion_r1060983938
##########
hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestBackupUtils.java:
##########
@@ -78,4 +81,23 @@ public Path run() {
// Make sure the directory is in foo1234's home directory
Assert.assertTrue(bulkOutputDir.toString().startsWith(fooHomeDirectory.toString()));
}
+
+ @Test
+ public void testFilesystemWalHostNameParsing() {
+ String host = "localhost";
+ String port = "60000";
+ String code = "1671741119623";
+ String pathString = Path.SEPARATOR + "path" + Path.SEPARATOR + host
Review Comment:
Rather than recreate the servername format, I'd just do
`ServerName.valueOf("localhost", 60030, 1234)`.
Rather than create the full path through concatenation, I'd just do
something like:
```java
Path walRootDir = CommonFSUtils.getWALRootDir(conf); // conf exists already
in this class
Path oldLogDir = new Path(walRootDir, HConstants.HREGION_OLDLOGDIR_NAME);
Path testWalPath = new Path(oldLogDir, serverName.toString() +
LOGNAME_SEPARATOR + EnvironmentEdgeManager.currentTime());
Path testMasterWalPath = new Path(oldLogDir, testWalPath.getName() +
ARCHIVED_WAL_SUFFIX);
```
--
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]