本文整理了Java中org.apache.cassandra.utils.FBUtilities.waitOnFutures()
方法的一些代码示例,展示了FBUtilities.waitOnFutures()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FBUtilities.waitOnFutures()
方法的具体详情如下:
包路径:org.apache.cassandra.utils.FBUtilities
类名称:FBUtilities
方法名:waitOnFutures
暂无
代码示例来源:origin: org.apache.cassandra/cassandra-all
private static void executeAllBlocking(Stream
{
if (function == null)
{
logger.error("failed to flush indexes: {} because flush task is missing.", indexers);
return;
}
List
indexers.forEach(indexer -> {
Callable> task = function.apply(indexer);
if (null != task)
waitFor.add(blockingExecutor.submit(task));
});
FBUtilities.waitOnFutures(waitFor);
}
}
代码示例来源:origin: jsevellec/cassandra-unit
private static void executeAllBlocking(Stream
{
if (function == null)
{
logger.error("failed to flush indexes: {} because flush task is missing.", indexers);
return;
}
List
indexers.forEach(indexer -> {
Callable> task = function.apply(indexer);
if (null != task)
waitFor.add(blockingExecutor.submit(task));
});
FBUtilities.waitOnFutures(waitFor);
}
}
代码示例来源:origin: org.apache.cassandra/cassandra-all
/**
* Flushes matching column families from the given keyspace, or all columnFamilies
* if the cf list is empty.
*/
private void flushSSTables(Iterable
{
List
for (ColumnFamilyStore cfs : stores)
flushes.add(cfs.forceFlush());
FBUtilities.waitOnFutures(flushes);
}
代码示例来源:origin: jsevellec/cassandra-unit
/**
* Flushes matching column families from the given keyspace, or all columnFamilies
* if the cf list is empty.
*/
private void flushSSTables(Iterable
{
List
for (ColumnFamilyStore cfs : stores)
flushes.add(cfs.forceFlush());
FBUtilities.waitOnFutures(flushes);
}
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server
/**
* Flushes matching column families from the given keyspace, or all columnFamilies
* if the cf list is empty.
*/
private void flushSSTables(Iterable
{
List
for (ColumnFamilyStore cfs : stores)
flushes.add(cfs.forceFlush());
FBUtilities.waitOnFutures(flushes);
}
代码示例来源:origin: com.strapdata.cassandra/cassandra-all
/**
* Flushes matching column families from the given keyspace, or all columnFamilies
* if the cf list is empty.
*/
private void flushSSTables(Iterable
{
List
for (ColumnFamilyStore cfs : stores)
flushes.add(cfs.forceFlush());
FBUtilities.waitOnFutures(flushes);
}
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server
public int blockForWrites()
{
for (Map.Entry
logger.info(String.format("Skipped %d mutations from unknown (probably removed) CF with id %s", entry.getValue().intValue(), entry.getKey()));
// wait for all the writes to finish on the mutation stage
FBUtilities.waitOnFutures(futures);
logger.debug("Finished waiting on mutations from recovery");
// flush replayed keyspaces
futures.clear();
for (Keyspace keyspace : keyspacesRecovered)
futures.addAll(keyspace.flush());
FBUtilities.waitOnFutures(futures);
return replayedCount.get();
}
代码示例来源:origin: org.apache.cassandra/cassandra-all
/**
* used for tests - to be able to check things after a minor compaction
* @param waitForFutures if we should block until autocompaction is done
*/
@VisibleForTesting
public void enableAutoCompaction(boolean waitForFutures)
{
compactionStrategyManager.enable();
List
if (waitForFutures)
FBUtilities.waitOnFutures(futures);
}
代码示例来源:origin: jsevellec/cassandra-unit
/**
* used for tests - to be able to check things after a minor compaction
* @param waitForFutures if we should block until autocompaction is done
*/
@VisibleForTesting
public void enableAutoCompaction(boolean waitForFutures)
{
compactionStrategyManager.enable();
List
if (waitForFutures)
FBUtilities.waitOnFutures(futures);
}
代码示例来源:origin: com.strapdata.cassandra/cassandra-all
/**
* used for tests - to be able to check things after a minor compaction
* @param waitForFutures if we should block until autocompaction is done
*/
@VisibleForTesting
public void enableAutoCompaction(boolean waitForFutures)
{
compactionStrategyManager.enable();
List
if (waitForFutures)
FBUtilities.waitOnFutures(futures);
}
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server
public void performMaximal(final ColumnFamilyStore cfStore) throws InterruptedException, ExecutionException
{
FBUtilities.waitOnFutures(submitMaximal(cfStore, getDefaultGcBefore(cfStore)));
}
代码示例来源:origin: jsevellec/cassandra-unit
public void saveCaches() throws ExecutionException, InterruptedException
{
List
logger.debug("submitting cache saves");
futures.add(keyCache.submitWrite(DatabaseDescriptor.getKeyCacheKeysToSave()));
futures.add(rowCache.submitWrite(DatabaseDescriptor.getRowCacheKeysToSave()));
futures.add(counterCache.submitWrite(DatabaseDescriptor.getCounterCacheKeysToSave()));
FBUtilities.waitOnFutures(futures);
logger.debug("cache saves completed");
}
代码示例来源:origin: org.apache.cassandra/cassandra-all
public void saveCaches() throws ExecutionException, InterruptedException
{
List
logger.debug("submitting cache saves");
futures.add(keyCache.submitWrite(DatabaseDescriptor.getKeyCacheKeysToSave()));
futures.add(rowCache.submitWrite(DatabaseDescriptor.getRowCacheKeysToSave()));
futures.add(counterCache.submitWrite(DatabaseDescriptor.getCounterCacheKeysToSave()));
FBUtilities.waitOnFutures(futures);
logger.debug("cache saves completed");
}
代码示例来源:origin: com.strapdata.cassandra/cassandra-all
public void saveCaches() throws ExecutionException, InterruptedException
{
List
logger.debug("submitting cache saves");
futures.add(keyCache.submitWrite(DatabaseDescriptor.getKeyCacheKeysToSave()));
futures.add(rowCache.submitWrite(DatabaseDescriptor.getRowCacheKeysToSave()));
futures.add(counterCache.submitWrite(DatabaseDescriptor.getCounterCacheKeysToSave()));
FBUtilities.waitOnFutures(futures);
logger.debug("cache saves completed");
}
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server
public void saveCaches() throws ExecutionException, InterruptedException
{
List
logger.debug("submitting cache saves");
futures.add(keyCache.submitWrite(DatabaseDescriptor.getKeyCacheKeysToSave()));
futures.add(rowCache.submitWrite(DatabaseDescriptor.getRowCacheKeysToSave()));
futures.add(counterCache.submitWrite(DatabaseDescriptor.getCounterCacheKeysToSave()));
FBUtilities.waitOnFutures(futures);
logger.debug("cache saves completed");
}
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server
/**
* used for tests - to be able to check things after a minor compaction
* @param waitForFutures if we should block until autocompaction is done
*/
@VisibleForTesting
public void enableAutoCompaction(boolean waitForFutures)
{
this.compactionStrategyWrapper.enable();
List
if (waitForFutures)
FBUtilities.waitOnFutures(futures);
}
代码示例来源:origin: jsevellec/cassandra-unit
public void performMaximal(final ColumnFamilyStore cfStore, boolean splitOutput)
{
FBUtilities.waitOnFutures(submitMaximal(cfStore, getDefaultGcBefore(cfStore, FBUtilities.nowInSeconds()), splitOutput));
}
代码示例来源:origin: org.apache.cassandra/cassandra-all
public void performMaximal(final ColumnFamilyStore cfStore, boolean splitOutput)
{
FBUtilities.waitOnFutures(submitMaximal(cfStore, getDefaultGcBefore(cfStore, FBUtilities.nowInSeconds()), splitOutput));
}
代码示例来源:origin: com.strapdata.cassandra/cassandra-all
public void performMaximal(final ColumnFamilyStore cfStore, boolean splitOutput)
{
FBUtilities.waitOnFutures(submitMaximal(cfStore, getDefaultGcBefore(cfStore, FBUtilities.nowInSeconds()), splitOutput));
}
代码示例来源:origin: jsevellec/cassandra-unit
public void close()
{
try
{
FBUtilities.waitOnFutures(repairResults, DatabaseDescriptor.getWriteRpcTimeout());
}
catch (TimeoutException ex)
{
// We got all responses, but timed out while repairing
int blockFor = consistency.blockFor(keyspace);
if (Tracing.isTracing())
Tracing.trace("Timed out while read-repairing after receiving all {} data and digest responses", blockFor);
else
logger.debug("Timeout while read-repairing after receiving all {} data and digest responses", blockFor);
throw new ReadTimeoutException(consistency, blockFor-1, blockFor, true);
}
}