public void init(ReplicationDataStoreConfig config) { this.config = config; dataStoreClient = ClientHelper.getVertxWebSocketClient(config.dataStoreClient().clientId(), config.dataStoreClient(), config.verbose()); }
List<String> keys = new ArrayList<>(config.maxBatchSize()); List<String> values = new ArrayList<>(config.maxBatchSize()); long lastSend = time.get(); boolean sendNow = keys.size() >= config.maxBatchSize(); if (!sendNow) { long elapsed = time.get() - lastSend; sendNow = elapsed >= config.maxWaitMillis();
private void setBatch(List<String> keys, List<String> values) { BatchSetRequest bsr = new BatchSetRequest( DataStoreSource.REPLICATION, Action.SET_BATCH, messageId++, config.dataStoreClient().clientId(), keys, values ); dataStoreClient.setBatch(bsr); }