@Test public void testRegionAssignment() { ByteBuffer[] endKeys = Stream.of("b", "dd", "fff") .map(c -> ByteBuffer.wrap(b(c))) .toArray(l -> new ByteBuffer[l]); assertEquals(0, HFileSink.toRegionId(endKeys, ibw("a"))); assertEquals(1, HFileSink.toRegionId(endKeys, ibw("b"))); assertEquals(1, HFileSink.toRegionId(endKeys, ibw("c"))); assertEquals(2, HFileSink.toRegionId(endKeys, ibw("dd"))); assertEquals(2, HFileSink.toRegionId(endKeys, ibw("ddd"))); assertEquals(2, HFileSink.toRegionId(endKeys, ibw("e"))); assertEquals(3, HFileSink.toRegionId(endKeys, ibw("fff"))); assertEquals(3, HFileSink.toRegionId(endKeys, ibw("ffff"))); assertEquals(3, HFileSink.toRegionId(endKeys, ibw("gg"))); }
@VisibleForTesting static int toRegionId(ByteBuffer[] endKeys, ImmutableBytesWritable row) { return toRegionId(endKeys, ByteBuffer.wrap( row.get(), row.getOffset(), row.getLength())); }
HFileSink implements DataSink<Cell> { @VisibleForTesting static int toRegionId(ByteBuffer[] endKeys, ImmutableBytesWritable row) { return toRegionId(endKeys, ByteBuffer.wrap( row.get(), row.getOffset(), row.getLength())); } }
HFileSink implements DataSink<Cell> { @VisibleForTesting static int toRegionId(ByteBuffer[] endKeys, ImmutableBytesWritable row) { return toRegionId(endKeys, ByteBuffer.wrap( row.get(), row.getOffset(), row.getLength())); } @VisibleForTesting  HFileSink(HFileSink clone);   HFileSink(
      String tableName,
      boolean doBulkLoad,
      @Nullable Windowing<Cell, ?> windowing,
      UnaryFunction<Window<?>, String> folderNaming,
      Configuration conf,
      List<Update<Job>> updaters); }
HFileSink implements DataSink<Cell> { @VisibleForTesting static int toRegionId(ByteBuffer[] endKeys, ImmutableBytesWritable row) { return toRegionId(endKeys, ByteBuffer.wrap( row.get(), row.getOffset(), row.getLength())); } @VisibleForTesting  HFileSink(HFileSink clone);   HFileSink(
      String tableName,
      boolean doBulkLoad,
      @Nullable Windowing<Cell, ?> windowing,
      UnaryFunction<Window<?>, String> folderNaming,
      Configuration conf,
      List<Update<Job>> updaters); static Builder newBuilder(); @Override boolean prepareDataset(Dataset<Cell> output); @Override Writer<Cell> openWriter(int partitionId); @Override void commit(); @Override void rollback(); void persist(Dataset<T> input, UnaryFunction<T, Cell> mapper); }
HFileSink implements DataSink<Cell> { @VisibleForTesting static int toRegionId(ByteBuffer[] endKeys, ImmutableBytesWritable row) { return toRegionId(endKeys, ByteBuffer.wrap( row.get(), row.getOffset(), row.getLength())); } @VisibleForTesting  HFileSink(HFileSink clone);   HFileSink(
      String tableName,
      boolean doBulkLoad,
      @Nullable Windowing<Cell, ?> windowing,
      UnaryFunction<Window<?>, String> folderNaming,
      Configuration conf,
      List<Update<Job>> updaters); static Builder newBuilder(); @Override boolean prepareDataset(Dataset<Cell> output); @Override Writer<Cell> openWriter(int partitionId); @Override void commit(); @Override void rollback(); void persist(Dataset<T> input, UnaryFunction<T, Cell> mapper); static final String HDFS_USER; static final String HBASE_USER; }