@Override public QueryBatcher withBatchSize(int batchSize) { requireNotStarted(); super.withBatchSize(batchSize); return this; }
@Override public WriteBatcher withJobId(String jobId) { requireNotInitialized(); super.withJobId(jobId); return this; }
@Override public QueryBatcher withJobName(String jobName) { requireNotStarted(); super.withJobName(jobName); return this; }
@Override public WriteBatcher withThreadCount(int threadCount) { requireNotInitialized(); super.withThreadCount(threadCount); return this; }
@Override public synchronized QueryBatcher withForestConfig(ForestConfiguration forestConfig) { super.withForestConfig(forestConfig); Forest[] forests = forestConfig.listForests(); Set<Forest> oldForests = new HashSet<>(forestResults.keySet()); Map<String,Forest> hosts = new HashMap<>(); for ( Forest forest : forests ) { if ( forest.getPreferredHost() == null ) throw new IllegalStateException("Hostname must not be null for any forest"); hosts.put(forest.getPreferredHost(), forest); if ( forestResults.get(forest) == null ) forestResults.put(forest, new AtomicLong()); if ( forestIsDone.get(forest) == null ) forestIsDone.put(forest, new AtomicBoolean(false)); if ( retryForestMap.get(forest) == null ) retryForestMap.put(forest, new AtomicInteger(0)); } logger.info("(withForestConfig) Using forests on {} hosts for \"{}\"", hosts.keySet(), forests[0].getDatabaseName()); List<DatabaseClient> newClientList = new ArrayList<>(); for ( String host : hosts.keySet() ) { Forest forest = hosts.get(host); DatabaseClient client = getMoveMgr().getForestClient(forest); newClientList.add(client); } clientList.set(newClientList); boolean started = (threadPool != null); if ( started == true && oldForests.size() > 0 ) calucluateDeltas(oldForests, forests); return this; }
@Override public QueryBatcher withThreadCount(int threadCount) { requireNotStarted(); if ( getThreadCount() <= 0 ) { throw new IllegalArgumentException("threadCount must be 1 or greater"); } threadCountSet = true; super.withThreadCount(threadCount); return this; }
@Override public synchronized WriteBatcher withForestConfig(ForestConfiguration forestConfig) { super.withForestConfig(forestConfig); if (forestConfig == null) throw new IllegalArgumentException("forestConfig must not be null");
@Override public WriteBatcher withBatchSize(int batchSize) { requireNotInitialized(); super.withBatchSize(batchSize); return this; }
@Override public QueryBatcher withJobId(String jobId) { requireNotStarted(); super.withJobId(jobId); return this; }
@Override public WriteBatcher withJobName(String jobName) { requireNotInitialized(); super.withJobName(jobName); return this; }