@Test public void testSendOutstanding() throws Exception { Duration autoFlushTime = Duration.ofSeconds(30); settingsBuilder .stubSettings() .bulkReadRowsSettings() .setBatchingSettings( BatchingSettings.newBuilder() .setDelayThreshold(autoFlushTime) .setElementCountThreshold(100L) .setRequestByteThreshold(10L * 1024L) .build()); dataClient = BigtableDataClient.create(settingsBuilder.build()); BulkReadWrapper bulkReadWrapper = new BulkReadVeneerApi(dataClient, TABLE_ID); List<ApiFuture<Result>> results = new ArrayList<>(); results.add(bulkReadWrapper.add(ByteString.copyFromUtf8("one"), null)); bulkReadWrapper.sendOutstanding(); results.add(bulkReadWrapper.add(ByteString.copyFromUtf8("two"), null)); bulkReadWrapper.sendOutstanding(); results.add(bulkReadWrapper.add(ByteString.copyFromUtf8("three"), null)); bulkReadWrapper.sendOutstanding(); results.add(bulkReadWrapper.add(ByteString.copyFromUtf8("four"), null)); bulkReadWrapper.sendOutstanding(); results.add(bulkReadWrapper.add(ByteString.copyFromUtf8("five"), null)); bulkReadWrapper.sendOutstanding(); ApiFutures.allAsList(results).get(); assertEquals(5, fakeDataService.getReadRowsBatchCount()); }
@Override public void sendOutstanding() { for (Batcher<ByteString, Row> batcher : batchers.values()) { batcher.sendOutstanding(); } notifyArrival(); }
BulkReadVeneerApi implements BulkReadWrapper { @Override public void sendOutstanding() { for (Batcher<ByteString, Row> batcher : batchers.values()) { batcher.sendOutstanding(); } notifyArrival(); } }
BulkReadVeneerApi implements BulkReadWrapper { @Override public void sendOutstanding() { for (Batcher<ByteString, Row> batcher : batchers.values()) { batcher.sendOutstanding(); } notifyArrival(); } BulkReadVeneerApi(BigtableDataClient client, String tableId); }
BulkReadVeneerApi implements BulkReadWrapper { @Override public void sendOutstanding() { for (Batcher<ByteString, Row> batcher : batchers.values()) { batcher.sendOutstanding(); } notifyArrival(); } BulkReadVeneerApi(BigtableDataClient client, String tableId); @Override ApiFuture<Result> add(ByteString rowKey, @Nullable Filters.Filter filter); @Override void sendOutstanding(); }
BulkReadVeneerApi implements BulkReadWrapper { @Override public void sendOutstanding() { for (Batcher<ByteString, Row> batcher : batchers.values()) { batcher.sendOutstanding(); } notifyArrival(); } BulkReadVeneerApi(BigtableDataClient client, String tableId); @Override ApiFuture<Result> add(ByteString rowKey, @Nullable Filters.Filter filter); @Override void sendOutstanding();  }