public final class Replica extends java.lang.Object implements java.lang.Comparable<Replica>
Constructor and Description |
---|
Replica(InetAddressAndPort endpoint,
Range<Token> range,
boolean full) |
Replica(InetAddressAndPort endpoint,
Token start,
Token end,
boolean full) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Replica o) |
boolean |
contains(Range<Token> that) |
Replica |
decorateSubrange(Range<Token> subrange) |
InetAddressAndPort |
endpoint() |
boolean |
equals(java.lang.Object o) |
static Replica |
fullReplica(InetAddressAndPort endpoint,
Range<Token> range) |
static Replica |
fullReplica(InetAddressAndPort endpoint,
Token start,
Token end) |
int |
hashCode() |
boolean |
intersectsOnRange(Replica replica) |
boolean |
isFull() |
boolean |
isSelf() |
boolean |
isTransient() |
Range<Token> |
range() |
RangesAtEndpoint |
subtractIgnoreTransientStatus(Range<Token> subtract)
Don't use this method and ignore transient status unless you are explicitly handling it outside this method.
|
RangesAtEndpoint |
subtractSameReplication(RangesAtEndpoint toSubtract)
This is used exclusively in TokenMetadata to check if a portion of a range is already replicated
by an endpoint so that we only mark as pending the portion that is either not replicated sufficiently (transient
when we need full) or at all.
|
java.lang.String |
toString() |
static Replica |
transientReplica(InetAddressAndPort endpoint,
Range<Token> range) |
static Replica |
transientReplica(InetAddressAndPort endpoint,
Token start,
Token end) |
public Replica(InetAddressAndPort endpoint, Range<Token> range, boolean full)
public Replica(InetAddressAndPort endpoint, Token start, Token end, boolean full)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int compareTo(Replica o)
compareTo
in interface java.lang.Comparable<Replica>
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public final InetAddressAndPort endpoint()
public boolean isSelf()
public final boolean isFull()
public final boolean isTransient()
public RangesAtEndpoint subtractSameReplication(RangesAtEndpoint toSubtract)
public RangesAtEndpoint subtractIgnoreTransientStatus(Range<Token> subtract)
public boolean intersectsOnRange(Replica replica)
public static Replica fullReplica(InetAddressAndPort endpoint, Range<Token> range)
public static Replica fullReplica(InetAddressAndPort endpoint, Token start, Token end)
public static Replica transientReplica(InetAddressAndPort endpoint, Range<Token> range)
public static Replica transientReplica(InetAddressAndPort endpoint, Token start, Token end)
Copyright © 2009-2022 The Apache Software Foundation