private static byte[][] splitInUniformRegions(Configuration hBaseConf, int numRegions) throws IOException { KeyGenerator keyGen = KeyGeneratorImplementations.defaultKeyGenerator(); RegionSplitter.SplitAlgorithm algo = RegionSplitter.newSplitAlgoInstance(hBaseConf, RegionSplitter.UniformSplit.class.getName()); algo.setFirstRow(algo.rowToStr(keyGen.startTimestampToKey(0))); algo.setLastRow(algo.rowToStr(keyGen.startTimestampToKey(Long.MAX_VALUE))); // Return the split keys return algo.split(numRegions); }
public HBaseCommitTable(Configuration hbaseConfig, HBaseCommitTableConfig config, KeyGenerator keygen) { this.hbaseConfig = hbaseConfig; this.tableName = config.getTableName(); this.commitTableFamily = config.getCommitTableFamily(); this.lowWatermarkFamily = config.getLowWatermarkFamily(); this.keygen = keygen; }
@Override public Client getClient() throws IOException { return new HBaseClient(); }
private byte[] startTimestampToKey(long startTimestamp) throws IOException { return keygen.startTimestampToKey(startTimestamp); }
public HBaseCommitTable(Connection hbaseConnection, HBaseCommitTableConfig config) throws IOException { this(hbaseConnection, config, KeyGeneratorImplementations.defaultKeyGenerator()); }
private Optional<CommitTable.Client> buildCommitTableClient() throws IOException { HBaseCommitTableConfig commitTableConf = new HBaseCommitTableConfig(); commitTableConf.setTableName(hbaseOmidClientConf.getCommitTableName()); CommitTable commitTable = new HBaseCommitTable(hbaseOmidClientConf.getHBaseConfiguration(), commitTableConf); return Optional.of(commitTable.getClient()); }
@Override public Writer getWriter() throws IOException { return new HBaseWriter(); }
void complete() { set(null); }
public static KeyGenerator defaultKeyGenerator() { return new BucketKeyGenerator(); }
void error(IOException ioe) { setException(ioe); }
@Override public void close() throws IOException { clearWriteBuffer(); table.close(); }
private static byte[][] splitInUniformRegions(Configuration hBaseConf, int numRegions) throws IOException { KeyGenerator keyGen = KeyGeneratorImplementations.defaultKeyGenerator(); RegionSplitter.SplitAlgorithm algo = RegionSplitter.newSplitAlgoInstance(hBaseConf, RegionSplitter.UniformSplit.class.getName()); algo.setFirstRow(algo.rowToStr(keyGen.startTimestampToKey(0))); algo.setLastRow(algo.rowToStr(keyGen.startTimestampToKey(Long.MAX_VALUE))); // Return the split keys return algo.split(numRegions); }
public HBaseCommitTable(Connection hbaseConnection, HBaseCommitTableConfig config, KeyGenerator keygen) throws IOException { this.hbaseConnection = hbaseConnection; this.tableName = config.getTableName(); this.commitTableFamily = config.getCommitTableFamily(); this.lowWatermarkFamily = config.getLowWatermarkFamily(); this.keygen = keygen; }
private byte[] startTimestampToKey(long startTimestamp) throws IOException { return keygen.startTimestampToKey(startTimestamp); }
@Override public Client getClient() throws IOException { return new HBaseClient(); }
@Override public Writer getWriter() throws IOException { return new HBaseWriter(); }
void complete() { set(null); }
public static KeyGenerator defaultKeyGenerator() { return new BucketKeyGenerator(); }
void error(IOException ioe) { setException(ioe); }
@Override public void close() throws IOException { clearWriteBuffer(); table.close(); }