public class MapValue extends Object implements Comparable<MapValue>
| Modifier and Type | Class and Description |
|---|---|
static class |
MapValue.Digest
Digest or summary of a MapValue for use during Anti-Entropy exchanges.
|
| Constructor and Description |
|---|
MapValue(byte[] value,
Timestamp timestamp)
Constructor automatically to create the system time of construction.
|
MapValue(byte[] value,
Timestamp timestamp,
long creationTime)
Creates a map value using value, timestamp, and creation time.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(MapValue o) |
MapValue |
copy()
Creates a copy of MapValue.
|
long |
creationTime()
Returns the creation time of this value.
|
MapValue.Digest |
digest()
Returns summary of a MapValue for use during Anti-Entropy exchanges.
|
boolean |
equals(Object other) |
byte[] |
get()
Returns this value.
|
<V> V |
get(com.google.common.base.Function<byte[],V> decoder)
Returns the decoded value.
|
int |
hashCode() |
boolean |
isAlive()
Tests if this value is alive.
|
boolean |
isNewerThan(MapValue other)
Tests if this value is newer than the specified MapValue.
|
boolean |
isNewerThan(Timestamp timestamp)
Tests if this timestamp is newer than the specified timestamp.
|
boolean |
isTombstone()
Tests if this value is tombstone value with the specified timestamp.
|
Timestamp |
timestamp()
Returns the timestamp of this value.
|
static MapValue |
tombstone(Timestamp timestamp)
Creates a tombstone value with the specified timestamp.
|
String |
toString() |
public MapValue(byte[] value,
Timestamp timestamp)
value - valuetimestamp - value timestamppublic MapValue(byte[] value,
Timestamp timestamp,
long creationTime)
value - valuetimestamp - value timestamp.creationTime - the system time (on local instance) of constructionpublic static MapValue tombstone(Timestamp timestamp)
timestamp - timestamp for tombstonepublic MapValue copy()
The copy will have an updated creation time corresponding to when the copy was constructed.
public boolean isTombstone()
public boolean isAlive()
public Timestamp timestamp()
public byte[] get()
public <V> V get(com.google.common.base.Function<byte[],V> decoder)
V - the decoded value typedecoder - the decoder with which to decode the valuepublic long creationTime()
public boolean isNewerThan(MapValue other)
other - the value to be comparedpublic boolean isNewerThan(Timestamp timestamp)
timestamp - timestamp to be comparedpublic MapValue.Digest digest()
public int compareTo(MapValue o)
compareTo in interface Comparable<MapValue>Copyright © 2013–2018. All rights reserved.