Skip to content
Permalink
Browse files
HBASE-21483 [hbck2] version string checking should look for exactly t…
…he version we know doesn't work
  • Loading branch information
busbey committed Nov 16, 2018
1 parent 458152d commit 8d0ec805cb32dfb99dfa8eb8a931f950f7097a88
Showing 2 changed files with 9 additions and 3 deletions.
@@ -101,12 +101,13 @@ void checkHBCKSupport(Connection connection) throws IOException {
}

static void checkVersion(final String versionStr) {
if (versionStr.startsWith(TWO_POINT_ONE)) {
throw new UnsupportedOperationException(TWO_POINT_ONE + " has no support for hbck2");
}
if (VersionInfo.compareVersion(MININUM_VERSION, versionStr) > 0) {
throw new UnsupportedOperationException("Requires " + MININUM_VERSION + " at least.");
}
// except 2.1.0 didn't ship with support
if (VersionInfo.compareVersion(TWO_POINT_ONE, versionStr) == 0) {
throw new UnsupportedOperationException(TWO_POINT_ONE + " has no support for hbck2");
}
}

TableState setTableState(TableName tableName, TableState.State state) throws IOException {
@@ -69,6 +69,11 @@ public void testCheckVersion210() {
HBCK2.checkVersion("2.1.0");
}

@Test
public void testCheckVersionSpecial210() {
HBCK2.checkVersion("2.1.0-patchedForHBCK2");
}

@Test
public void testCheckVersion203() {
HBCK2.checkVersion("2.0.3");

0 comments on commit 8d0ec80

Please sign in to comment.