本文整理汇总了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);
}
示例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);
}
}
示例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);
}
示例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);
}
示例5: getPhiConvictThreshold
import org.apache.cassandra.config.DatabaseDescriptor; //导入方法依赖的package包/类
public double getPhiConvictThreshold()
{
return DatabaseDescriptor.getPhiConvictThreshold();
}