hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bus...@apache.org
Subject hbase git commit: HBASE-17677 Just the new tests from 'ServerName parsing from directory name should be more robust to errors.'
Date Thu, 23 Feb 2017 03:24:35 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 a37344573 -> 791731447


HBASE-17677 Just the new tests from 'ServerName parsing from directory name should be more
robust to errors.'

Signed-off-by: Michael Stack <stack@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/79173144
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/79173144
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/79173144

Branch: refs/heads/branch-1
Commit: 7917314477fcbadcd761e617fdf472a262274443
Parents: a373445
Author: Sean Busbey <busbey@apache.org>
Authored: Wed Feb 22 13:31:51 2017 -0600
Committer: Sean Busbey <busbey@apache.org>
Committed: Wed Feb 22 21:23:11 2017 -0600

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/wal/TestWALMethods.java  | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/79173144/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALMethods.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALMethods.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALMethods.java
index 63fe1a7..178c448 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALMethods.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALMethods.java
@@ -34,6 +34,7 @@ import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.KeyValueTestUtil;
+import org.apache.hadoop.hbase.ServerName;
 import org.apache.hadoop.hbase.testclassification.SmallTests;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.SplitLogTask.RecoveryMode;
@@ -59,6 +60,20 @@ public class TestWALMethods {
 
   private final HBaseTestingUtility util = new HBaseTestingUtility();
 
+  @Test
+  public void testServerNameFromWAL() throws Exception {
+    Path walPath = new Path("/hbase/WALs/regionserver-2.example.com,22101,1487767381290",
"regionserver-2.example.com%2C22101%2C1487767381290.null0.1487785392316");
+    ServerName name = DefaultWALProvider.getServerNameFromWALDirectoryName(walPath);
+    assertEquals(ServerName.valueOf("regionserver-2.example.com", 22101, 1487767381290L),
name);
+  }
+
+  @Test
+  public void testServerNameFromTestWAL() throws Exception {
+    Path walPath = new Path("/user/example/test-data/12ff1404-68c6-4715-a4b9-775e763842bc/WALs/TestWALRecordReader",
"TestWALRecordReader.default.1487787939118");
+    ServerName name = DefaultWALProvider.getServerNameFromWALDirectoryName(walPath);
+    assertNull(name);
+  }
+
   /**
    * Assert that getSplitEditFilesSorted returns files in expected order and
    * that it skips moved-aside files.


Mime
View raw message