Skip to content

Commit

Permalink
removing obsolete version check
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Sotona committed Jun 13, 2017
1 parent 30b8967 commit d80bb94
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ public final class HalyardTableUtils {
private static final DataBlockEncoding DEFAULT_DATABLOCK_ENCODING = DataBlockEncoding.PREFIX;
private static final String REGION_MAX_FILESIZE = "10000000000";
private static final String REGION_SPLIT_POLICY = "org.apache.hadoop.hbase.regionserver.ConstantSizeRegionSplitPolicy";
private static final String HALYARD_VERSION_ATTRIBUTE = "HALYARD_VERSION";
private static final String HALYARD_VERSION = "1";

private static final ThreadLocal<MessageDigest> MD = new ThreadLocal<MessageDigest>(){
@Override
Expand Down Expand Up @@ -153,18 +151,12 @@ public static HTable getTable(Configuration config, String tableName, boolean cr
if (!admin.tableExists(TableName.valueOf(tableName))) {
HTableDescriptor td = new HTableDescriptor(TableName.valueOf(tableName));
td.addFamily(createColumnFamily());
td.setValue(HALYARD_VERSION_ATTRIBUTE, HALYARD_VERSION);
admin.createTable(td, splits);
}
}
}
}
HTable table = new HTable(cfg, tableName);
String version = table.getTableDescriptor().getValue(HALYARD_VERSION_ATTRIBUTE);
if (!HALYARD_VERSION.equals(version)) {
table.close();
throw new IllegalArgumentException("Table " + tableName + " is not compatible, expected " + HALYARD_VERSION_ATTRIBUTE + "=" + HALYARD_VERSION + ", however received " + version);
}
table.setAutoFlushTo(false);
return table;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,18 +124,6 @@ public void testTruncateTable() throws Exception {
}
}

@Test(expected = IllegalArgumentException.class)
public void testInvalidHalyardVersion() throws Exception {
try (Connection con = ConnectionFactory.createConnection(HBaseServerTestInstance.getInstanceConfig())) {
try (Admin admin = con.getAdmin()) {
HTableDescriptor desc = new HTableDescriptor(TableName.valueOf("InvalidTable"));
desc.addFamily(new HColumnDescriptor("e"));
admin.createTable(desc);
}
}
HalyardTableUtils.getTable(HBaseServerTestInstance.getInstanceConfig(), "InvalidTable", false, 0);
}

@Test
public void testNewInstance() {
new HalyardTableUtils();
Expand Down

0 comments on commit d80bb94

Please sign in to comment.