mirror of https://github.com/apache/cassandra
Revert acccord module to absolute path
This commit is contained in:
parent
c16297f862
commit
66c50d796a
|
|
@ -1,4 +1,4 @@
|
|||
[submodule "modules/accord"]
|
||||
path = modules/accord
|
||||
url = ../cassandra-accord.git
|
||||
url = https://github.com/apache/cassandra-accord.git
|
||||
branch = trunk
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import org.apache.cassandra.config.DatabaseDescriptor;
|
|||
import org.apache.cassandra.utils.Clock;
|
||||
|
||||
import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
|
||||
import static org.apache.cassandra.tcm.Retry.Jitter.MAX_JITTER_MS;
|
||||
|
||||
public abstract class Retry
|
||||
{
|
||||
|
|
@ -160,6 +161,35 @@ public abstract class Retry
|
|||
return new Deadline(Clock.Global.nanoTime() + timeoutNanos, delegate);
|
||||
}
|
||||
|
||||
/**
|
||||
* Since we are using message expiration for communicating timeouts to CMS nodes, we have to be careful not
|
||||
* to overflow the long, since messaging is using only 32 bits for deadlines. To achieve that, we are
|
||||
* giving `timeoutNanos` every time we retry, but will retry indefinitely.
|
||||
*/
|
||||
public static Deadline retryIndefinitely(long timeoutNanos, Meter retryMeter)
|
||||
{
|
||||
return new Deadline(Clock.Global.nanoTime() + timeoutNanos,
|
||||
new Retry.Jitter(Integer.MAX_VALUE, MAX_JITTER_MS, new Random(), retryMeter))
|
||||
{
|
||||
@Override
|
||||
public boolean reachedMax()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long remainingNanos()
|
||||
{
|
||||
return timeoutNanos;
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return String.format("RetryIndefinitely{tries=%d}", currentTries());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean reachedMax()
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue