当前位置: 首页>>代码示例>>Java>>正文


Java AsyncOneResponse类代码示例

本文整理汇总了Java中org.apache.cassandra.net.AsyncOneResponse的典型用法代码示例。如果您正苦于以下问题:Java AsyncOneResponse类的具体用法?Java AsyncOneResponse怎么用?Java AsyncOneResponse使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


AsyncOneResponse类属于org.apache.cassandra.net包,在下文中一共展示了AsyncOneResponse类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: sendReplicationNotification

import org.apache.cassandra.net.AsyncOneResponse; //导入依赖的package包/类
/**
 * Sends a notification to a node indicating we have finished replicating data.
 *
 * @param remote node to send notification to
 */
private void sendReplicationNotification(InetAddress remote)
{
    // notify the remote token
    MessageOut msg = new MessageOut(MessagingService.Verb.REPLICATION_FINISHED);
    IFailureDetector failureDetector = FailureDetector.instance;
    if (logger.isDebugEnabled())
        logger.debug("Notifying {} of replication completion\n", remote);
    while (failureDetector.isAlive(remote))
    {
        AsyncOneResponse iar = MessagingService.instance().sendRR(msg, remote);
        try
        {
            iar.get(DatabaseDescriptor.getRpcTimeout(), TimeUnit.MILLISECONDS);
            return; // done
        }
        catch(TimeoutException e)
        {
            // try again
        }
    }
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:27,代码来源:StorageService.java

示例2: sendReplicationNotification

import org.apache.cassandra.net.AsyncOneResponse; //导入依赖的package包/类
/**
 * Sends a notification to a node indicating we have finished replicating data.
 *
 * @param remote node to send notification to
 */
private void sendReplicationNotification(InetAddress remote)
{
    // notify the remote token
    MessageOut msg = new MessageOut(MessagingService.Verb.REPLICATION_FINISHED);
    IFailureDetector failureDetector = FailureDetector.instance;
    if (logger.isDebugEnabled())
        logger.debug("Notifying " + remote.toString() + " of replication completion\n");
    while (failureDetector.isAlive(remote))
    {
        AsyncOneResponse iar = MessagingService.instance().sendRR(msg, remote);
        try
        {
            iar.get(DatabaseDescriptor.getRpcTimeout(), TimeUnit.MILLISECONDS);
            return; // done
        }
        catch(TimeoutException e)
        {
            // try again
        }
    }
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:27,代码来源:StorageService.java

示例3: waitOnFutures

import org.apache.cassandra.net.AsyncOneResponse; //导入依赖的package包/类
public static void waitOnFutures(List<AsyncOneResponse> results, long ms) throws TimeoutException
{
    for (AsyncOneResponse result : results)
        result.get(ms, TimeUnit.MILLISECONDS);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:6,代码来源:FBUtilities.java


注:本文中的org.apache.cassandra.net.AsyncOneResponse类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。