@Test public void testMergeRegionsInvalidParams() throws Exception { final int originalCount = TEST_UTIL.countRows(table); RegionsMerger merger = new RegionsMerger(TEST_UTIL.getConfiguration()); assertEquals(1, merger.run(new String[]{})); assertEquals("Row count before and after merge should be equal", originalCount, TEST_UTIL.countRows(table)); }
@Override public int run(String[] args) { if(args.length!=2){ LOG.error("Wrong number of arguments. " + "Arguments are: <TABLE_NAME> <TARGET_NUMBER_OF_REGIONS>"); return 1; } try { this.mergeRegions(args[0], Integer.parseInt(args[1])); } catch(Exception e){ LOG.error("Merging regions failed:", e); return 2; } return 0; }
RegionsMerger extends Configured implements org.apache.hadoop.util.Tool { @Override public int run(String[] args) { if(args.length!=2){ LOG.error("Wrong number of arguments. " + "Arguments are: <TABLE_NAME> <TARGET_NUMBER_OF_REGIONS>"); return 1; } try { this.mergeRegions(args[0], Integer.parseInt(args[1])); } catch(Exception e){ LOG.error("Merging regions failed:", e); return 2; } return 0; } }
RegionsMerger extends Configured implements org.apache.hadoop.util.Tool { @Override public int run(String[] args) { if(args.length!=2){ LOG.error("Wrong number of arguments. " + "Arguments are: <TABLE_NAME> <TARGET_NUMBER_OF_REGIONS>"); return 1; } try { this.mergeRegions(args[0], Integer.parseInt(args[1])); } catch(Exception e){ LOG.error("Merging regions failed:", e); return 2; } return 0; } RegionsMerger(Configuration conf); }
RegionsMerger extends Configured implements org.apache.hadoop.util.Tool { @Override public int run(String[] args) { if(args.length!=2){ LOG.error("Wrong number of arguments. " + "Arguments are: <TABLE_NAME> <TARGET_NUMBER_OF_REGIONS>"); return 1; } try { this.mergeRegions(args[0], Integer.parseInt(args[1])); } catch(Exception e){ LOG.error("Merging regions failed:", e); return 2; } return 0; } RegionsMerger(Configuration conf); void mergeRegions(String tblName, int targetRegions); @Override int run(String[] args); static void main(String [] args); }
RegionsMerger extends Configured implements org.apache.hadoop.util.Tool { @Override public int run(String[] args) { if(args.length!=2){ LOG.error("Wrong number of arguments. " + "Arguments are: <TABLE_NAME> <TARGET_NUMBER_OF_REGIONS>"); return 1; } try { this.mergeRegions(args[0], Integer.parseInt(args[1])); } catch(Exception e){ LOG.error("Merging regions failed:", e); return 2; } return 0; } RegionsMerger(Configuration conf); void mergeRegions(String tblName, int targetRegions); @Override int run(String[] args); static void main(String [] args); static final String RESULTING_REGION_UPPER_MARK; static final String SLEEP; static final String MAX_ROUNDS_IDLE; }