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


Java DatabaseDescriptor.getPhiConvictThreshold方法代码示例

本文整理汇总了Java中org.apache.cassandra.config.DatabaseDescriptor.getPhiConvictThreshold方法的典型用法代码示例。如果您正苦于以下问题:Java DatabaseDescriptor.getPhiConvictThreshold方法的具体用法?Java DatabaseDescriptor.getPhiConvictThreshold怎么用?Java DatabaseDescriptor.getPhiConvictThreshold使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.cassandra.config.DatabaseDescriptor的用法示例。


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

示例1: convict

import org.apache.cassandra.config.DatabaseDescriptor; //导入方法依赖的package包/类
public void convict(InetAddress endpoint, double phi)
{
    if (!endpoints.contains(endpoint))
        return;

    // We want a higher confidence in the failure detection than usual because failing a repair wrongly has a high cost.
    if (phi < 2 * DatabaseDescriptor.getPhiConvictThreshold())
        return;

    // Though unlikely, it is possible to arrive here multiple time and we
    // want to avoid print an error message twice
    if (!isFailed.compareAndSet(false, true))
        return;

    failedNode(endpoint);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:17,代码来源:RepairSession.java

示例2: convict

import org.apache.cassandra.config.DatabaseDescriptor; //导入方法依赖的package包/类
/**
 * Something has happened to a remote node - if that node is a coordinator, we mark the parent repair session id as failed.
 *
 * The fail marker is kept in the map for 24h to make sure that if the coordinator does not agree
 * that the repair failed, we need to fail the entire repair session
 *
 * @param ep  endpoint to be convicted
 * @param phi the value of phi with with ep was convicted
 */
public void convict(InetAddress ep, double phi)
{
    // We want a higher confidence in the failure detection than usual because failing a repair wrongly has a high cost.
    if (phi < 2 * DatabaseDescriptor.getPhiConvictThreshold() || parentRepairSessions.isEmpty())
        return;

    Set<UUID> toRemove = new HashSet<>();

    for (Map.Entry<UUID, ParentRepairSession> repairSessionEntry : parentRepairSessions.entrySet())
    {
        if (repairSessionEntry.getValue().coordinator.equals(ep))
        {
            toRemove.add(repairSessionEntry.getKey());
        }
    }

    if (!toRemove.isEmpty())
    {
        logger.debug("Removing {} in parent repair sessions", toRemove);
        for (UUID id : toRemove)
            removeParentRepairSession(id);
    }
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:33,代码来源:ActiveRepairService.java

示例3: convict

import org.apache.cassandra.config.DatabaseDescriptor; //导入方法依赖的package包/类
public void convict(InetAddress endpoint, double phi)
{
    if (!endpoints.contains(endpoint))
        return;

    // We want a higher confidence in the failure detection than usual because failing a repair wrongly has a high cost.
    if (phi < 2 * DatabaseDescriptor.getPhiConvictThreshold())
        return;

    // Though unlikely, it is possible to arrive here multiple time and we
    // want to avoid print an error message twice
    if (!isFailed.compareAndSet(false, true))
        return;

    Exception exception = new IOException(String.format("Endpoint %s died", endpoint));
    logger.error(String.format("[repair #%s] session completed with the following error", getId()), exception);
    // If a node failed, we stop everything (though there could still be some activity in the background)
    forceShutdown(exception);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:20,代码来源:RepairSession.java

示例4: convict

import org.apache.cassandra.config.DatabaseDescriptor; //导入方法依赖的package包/类
public void convict(InetAddress endpoint, double phi)
{
    if (!endpoint.equals(peer))
        return;

    // We want a higher confidence in the failure detection than usual because failing a streaming wrongly has a high cost.
    if (phi < 2 * DatabaseDescriptor.getPhiConvictThreshold())
        return;

    closeSession(State.FAILED);
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:12,代码来源:StreamSession.java

示例5: getPhiConvictThreshold

import org.apache.cassandra.config.DatabaseDescriptor; //导入方法依赖的package包/类
public double getPhiConvictThreshold()
{
    return DatabaseDescriptor.getPhiConvictThreshold();
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:5,代码来源:FailureDetector.java


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