Java Code Examples for org.apache.cassandra.config.DatabaseDescriptor#getMaxHintWindow()
The following examples show how to use
org.apache.cassandra.config.DatabaseDescriptor#getMaxHintWindow() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StorageProxy.java From stratio-cassandra with Apache License 2.0 | 6 votes |
public static boolean shouldHint(InetAddress ep) { if (DatabaseDescriptor.shouldHintByDC()) { final String dc = DatabaseDescriptor.getEndpointSnitch().getDatacenter(ep); //Disable DC specific hints if(!DatabaseDescriptor.hintedHandoffEnabled(dc)) { HintedHandOffManager.instance.metrics.incrPastWindow(ep); return false; } } else if (!DatabaseDescriptor.hintedHandoffEnabled()) { HintedHandOffManager.instance.metrics.incrPastWindow(ep); return false; } boolean hintWindowExpired = Gossiper.instance.getEndpointDowntime(ep) > DatabaseDescriptor.getMaxHintWindow(); if (hintWindowExpired) { HintedHandOffManager.instance.metrics.incrPastWindow(ep); Tracing.trace("Not hinting {} which has been down {}ms", ep, Gossiper.instance.getEndpointDowntime(ep)); } return !hintWindowExpired; }
Example 2
Source File: StorageProxy.java From stratio-cassandra with Apache License 2.0 | 4 votes |
public int getMaxHintWindow() { return DatabaseDescriptor.getMaxHintWindow(); }