public class StringPrefixPartitionResolver extends java.lang.Object implements PartitionResolver<java.lang.String,java.lang.Object>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_DELIMITER
The default delimiter is "|".
|
Constructor and Description |
---|
StringPrefixPartitionResolver()
Creates a prefix resolver with the default delimiter.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Called when the region containing this callback is closed or destroyed, when the cache is
closed, or when a callback is removed from a region using an
AttributesMutator . |
boolean |
equals(java.lang.Object o) |
java.lang.String |
getName()
Returns the name of the PartitionResolver
|
java.lang.Object |
getRoutingObject(EntryOperation<java.lang.String,java.lang.Object> opDetails)
Returns the prefix of the String key that precedes the first "|" in the key.
|
int |
hashCode() |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
init
public static final java.lang.String DEFAULT_DELIMITER
public StringPrefixPartitionResolver()
public java.lang.Object getRoutingObject(EntryOperation<java.lang.String,java.lang.Object> opDetails)
getRoutingObject
in interface PartitionResolver<java.lang.String,java.lang.Object>
opDetails
- the detail of the entry operation e.g. Region.get(Object)
java.lang.ClassCastException
- if the key is not an instance of Stringjava.lang.IllegalArgumentException
- if the key does not contain at least one "|".public java.lang.String getName()
PartitionResolver
getName
in interface PartitionResolver<java.lang.String,java.lang.Object>
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public void close()
CacheCallback
AttributesMutator
.
Implementations should cleanup any external resources such as database connections. Any runtime exceptions this method throws will be logged.
It is possible for this method to be called multiple times on a single callback instance, so implementations must be tolerant of this.
close
in interface CacheCallback
RegionService.close()
,
Region.close()
,
Region.localDestroyRegion()
,
Region.destroyRegion()
,
AttributesMutator