public class StorageProxy extends java.lang.Object implements StorageProxyMBean
| Modifier and Type | Class and Description |
|---|---|
static interface |
StorageProxy.WritePerformer |
| Modifier and Type | Field and Description |
|---|---|
static StorageProxy |
instance |
static java.lang.String |
MBEAN_NAME |
static java.lang.String |
UNREACHABLE |
| Modifier and Type | Method and Description |
|---|---|
static AbstractWriteResponseHandler<IMutation> |
applyCounterMutationOnCoordinator(CounterMutation cm,
java.lang.String localDataCenter) |
static AbstractWriteResponseHandler<IMutation> |
applyCounterMutationOnLeader(CounterMutation cm,
java.lang.String localDataCenter,
java.lang.Runnable callback) |
static boolean |
canDoLocalRequest(java.net.InetAddress replica) |
static RowIterator |
cas(java.lang.String keyspaceName,
java.lang.String cfName,
DecoratedKey key,
CASRequest request,
ConsistencyLevel consistencyForPaxos,
ConsistencyLevel consistencyForCommit,
ClientState state)
Apply @param updates if and only if the current values in the row for @param key
match the provided @param conditions.
|
static java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
describeSchemaVersions()
initiate a request/response session with each live node to check whether or not everybody is using the same
migration id.
|
void |
disableHintsForDC(java.lang.String dc) |
void |
enableHintsForDC(java.lang.String dc) |
java.lang.Long |
getCasContentionTimeout() |
java.lang.Long |
getCounterWriteRpcTimeout() |
java.util.Set<java.lang.String> |
getHintedHandoffDisabledDCs() |
boolean |
getHintedHandoffEnabled() |
int |
getHintsInProgress() |
static java.util.List<java.net.InetAddress> |
getLiveSortedEndpoints(Keyspace keyspace,
java.nio.ByteBuffer key) |
static java.util.List<java.net.InetAddress> |
getLiveSortedEndpoints(Keyspace keyspace,
RingPosition pos) |
int |
getMaxHintsInProgress() |
int |
getMaxHintWindow() |
java.lang.Long |
getNativeTransportMaxConcurrentConnections() |
java.lang.Long |
getNativeTransportMaxConcurrentConnectionsPerIp() |
java.lang.Long |
getRangeRpcTimeout() |
static PartitionIterator |
getRangeSlice(PartitionRangeReadCommand command,
ConsistencyLevel consistencyLevel) |
long |
getReadRepairAttempted() |
long |
getReadRepairRepairedBackground() |
long |
getReadRepairRepairedBlocking() |
java.lang.Long |
getReadRpcTimeout() |
java.lang.Long |
getRpcTimeout() |
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getSchemaVersions()
Returns each live node's schema version
|
long |
getTotalHints() |
java.lang.Long |
getTruncateRpcTimeout() |
java.lang.Long |
getWriteRpcTimeout() |
static void |
mutate(java.util.Collection<? extends IMutation> mutations,
ConsistencyLevel consistency_level)
Use this method to have these Mutations applied
across all replicas.
|
static void |
mutateAtomically(java.util.Collection<Mutation> mutations,
ConsistencyLevel consistency_level,
boolean requireQuorumForRemove)
See mutate.
|
static AbstractWriteResponseHandler<IMutation> |
mutateCounter(CounterMutation cm,
java.lang.String localDataCenter)
Handle counter mutation on the coordinator host.
|
static void |
mutateMV(java.nio.ByteBuffer dataKey,
java.util.Collection<Mutation> mutations)
Use this method to have these Mutations applied
across all replicas.
|
static void |
mutateWithTriggers(java.util.Collection<? extends IMutation> mutations,
ConsistencyLevel consistencyLevel,
boolean mutateAtomically) |
static AbstractWriteResponseHandler<IMutation> |
performWrite(IMutation mutation,
ConsistencyLevel consistency_level,
java.lang.String localDataCenter,
StorageProxy.WritePerformer performer,
java.lang.Runnable callback,
WriteType writeType)
Perform the write of a mutation given a WritePerformer.
|
static PartitionIterator |
read(SinglePartitionReadCommand.Group group,
ConsistencyLevel consistencyLevel) |
static PartitionIterator |
read(SinglePartitionReadCommand.Group group,
ConsistencyLevel consistencyLevel,
ClientState state)
Performs the actual reading of a row out of the StorageService, fetching
a specific set of column names from a given column family.
|
static RowIterator |
readOne(SinglePartitionReadCommand command,
ConsistencyLevel consistencyLevel) |
static RowIterator |
readOne(SinglePartitionReadCommand command,
ConsistencyLevel consistencyLevel,
ClientState state) |
void |
reloadTriggerClasses() |
static void |
sendToHintedEndpoints(Mutation mutation,
java.lang.Iterable<java.net.InetAddress> targets,
AbstractWriteResponseHandler<IMutation> responseHandler,
java.lang.String localDataCenter,
Stage stage)
Send the mutations to the right targets, write it locally if it corresponds or writes a hint when the node
is not available.
|
void |
setCasContentionTimeout(java.lang.Long timeoutInMillis) |
void |
setCounterWriteRpcTimeout(java.lang.Long timeoutInMillis) |
void |
setHintedHandoffEnabled(boolean b) |
void |
setMaxHintsInProgress(int qs) |
void |
setMaxHintWindow(int ms) |
void |
setNativeTransportMaxConcurrentConnections(java.lang.Long nativeTransportMaxConcurrentConnections) |
void |
setNativeTransportMaxConcurrentConnectionsPerIp(java.lang.Long nativeTransportMaxConcurrentConnections) |
void |
setRangeRpcTimeout(java.lang.Long timeoutInMillis) |
void |
setReadRpcTimeout(java.lang.Long timeoutInMillis) |
void |
setRpcTimeout(java.lang.Long timeoutInMillis) |
void |
setTruncateRpcTimeout(java.lang.Long timeoutInMillis) |
void |
setWriteRpcTimeout(java.lang.Long timeoutInMillis) |
static boolean |
shouldHint(java.net.InetAddress ep) |
static java.util.concurrent.Future<java.lang.Void> |
submitHint(Mutation mutation,
java.net.InetAddress target,
AbstractWriteResponseHandler<IMutation> responseHandler) |
static void |
truncateBlocking(java.lang.String keyspace,
java.lang.String cfname)
Performs the truncate operatoin, which effectively deletes all data from
the column family cfname
|
void |
verifyNoHintsInProgress() |
static void |
writeHintForMutation(Mutation mutation,
long now,
int ttl,
java.net.InetAddress target) |
public static final java.lang.String MBEAN_NAME
public static final java.lang.String UNREACHABLE
public static final StorageProxy instance
public static RowIterator cas(java.lang.String keyspaceName, java.lang.String cfName, DecoratedKey key, CASRequest request, ConsistencyLevel consistencyForPaxos, ConsistencyLevel consistencyForCommit, ClientState state) throws UnavailableException, IsBootstrappingException, RequestFailureException, RequestTimeoutException, InvalidRequestException
keyspaceName - the keyspace for the CAScfName - the column family for the CASkey - the row key for the row to CASrequest - the conditions for the CAS to apply as well as the update to perform if the conditions hold.consistencyForPaxos - the consistency for the paxos prepare and propose round. This can only be either SERIAL or LOCAL_SERIAL.consistencyForCommit - the consistency for write done during the commit phase. This can be anything, except SERIAL or LOCAL_SERIAL.UnavailableExceptionIsBootstrappingExceptionRequestFailureExceptionRequestTimeoutExceptionInvalidRequestExceptionpublic static void mutate(java.util.Collection<? extends IMutation> mutations, ConsistencyLevel consistency_level) throws UnavailableException, OverloadedException, WriteTimeoutException, WriteFailureException
mutations - the mutations to be applied across the replicasconsistency_level - the consistency level for the operationUnavailableExceptionOverloadedExceptionWriteTimeoutExceptionWriteFailureExceptionpublic static void mutateMV(java.nio.ByteBuffer dataKey,
java.util.Collection<Mutation> mutations)
throws UnavailableException,
OverloadedException,
WriteTimeoutException
mutations - the mutations to be applied across the replicasUnavailableExceptionOverloadedExceptionWriteTimeoutExceptionpublic static void mutateWithTriggers(java.util.Collection<? extends IMutation> mutations, ConsistencyLevel consistencyLevel, boolean mutateAtomically) throws WriteTimeoutException, WriteFailureException, UnavailableException, OverloadedException, InvalidRequestException
public static void mutateAtomically(java.util.Collection<Mutation> mutations, ConsistencyLevel consistency_level, boolean requireQuorumForRemove) throws UnavailableException, OverloadedException, WriteTimeoutException
mutations - the Mutations to be applied across the replicasconsistency_level - the consistency level for the operationrequireQuorumForRemove - at least a quorum of nodes will see update before deleting batchlogUnavailableExceptionOverloadedExceptionWriteTimeoutExceptionpublic static boolean canDoLocalRequest(java.net.InetAddress replica)
public static AbstractWriteResponseHandler<IMutation> performWrite(IMutation mutation, ConsistencyLevel consistency_level, java.lang.String localDataCenter, StorageProxy.WritePerformer performer, java.lang.Runnable callback, WriteType writeType) throws UnavailableException, OverloadedException
mutation - the mutation to be appliedconsistency_level - the consistency level for the write operationperformer - the WritePerformer in charge of appliying the mutation
given the list of write endpoints (either standardWritePerformer for
standard writes or counterWritePerformer for counter writes).callback - an optional callback to be run if and when the write is
successful.UnavailableExceptionOverloadedExceptionpublic static void sendToHintedEndpoints(Mutation mutation, java.lang.Iterable<java.net.InetAddress> targets, AbstractWriteResponseHandler<IMutation> responseHandler, java.lang.String localDataCenter, Stage stage) throws OverloadedException
| Hinted Handoff | Consist. Level |
| on | >=1 | --> wait for hints. We DO NOT notify the handler with handler.response() for hints;
| on | ANY | --> wait for hints. Responses count towards consistency.
| off | >=1 | --> DO NOT fire hints. And DO NOT wait for them to complete.
| off | ANY | --> DO NOT fire hints. And DO NOT wait for them to complete.
OverloadedException - if the hints cannot be written/enqueuedpublic static java.util.concurrent.Future<java.lang.Void> submitHint(Mutation mutation, java.net.InetAddress target, AbstractWriteResponseHandler<IMutation> responseHandler)
public static void writeHintForMutation(Mutation mutation, long now, int ttl, java.net.InetAddress target)
now - current time in milliseconds - relevant for hint replay handling of truncated CFspublic static AbstractWriteResponseHandler<IMutation> mutateCounter(CounterMutation cm, java.lang.String localDataCenter) throws UnavailableException, OverloadedException
public static AbstractWriteResponseHandler<IMutation> applyCounterMutationOnLeader(CounterMutation cm, java.lang.String localDataCenter, java.lang.Runnable callback) throws UnavailableException, OverloadedException
public static AbstractWriteResponseHandler<IMutation> applyCounterMutationOnCoordinator(CounterMutation cm, java.lang.String localDataCenter) throws UnavailableException, OverloadedException
public static RowIterator readOne(SinglePartitionReadCommand command, ConsistencyLevel consistencyLevel) throws UnavailableException, IsBootstrappingException, ReadFailureException, ReadTimeoutException, InvalidRequestException
public static RowIterator readOne(SinglePartitionReadCommand command, ConsistencyLevel consistencyLevel, ClientState state) throws UnavailableException, IsBootstrappingException, ReadFailureException, ReadTimeoutException, InvalidRequestException
public static PartitionIterator read(SinglePartitionReadCommand.Group group, ConsistencyLevel consistencyLevel) throws UnavailableException, IsBootstrappingException, ReadFailureException, ReadTimeoutException, InvalidRequestException
public static PartitionIterator read(SinglePartitionReadCommand.Group group, ConsistencyLevel consistencyLevel, ClientState state) throws UnavailableException, IsBootstrappingException, ReadFailureException, ReadTimeoutException, InvalidRequestException
public static java.util.List<java.net.InetAddress> getLiveSortedEndpoints(Keyspace keyspace, java.nio.ByteBuffer key)
public static java.util.List<java.net.InetAddress> getLiveSortedEndpoints(Keyspace keyspace, RingPosition pos)
public static PartitionIterator getRangeSlice(PartitionRangeReadCommand command, ConsistencyLevel consistencyLevel) throws UnavailableException, ReadFailureException, ReadTimeoutException
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getSchemaVersions()
StorageProxyMBeangetSchemaVersions in interface StorageProxyMBeanpublic static java.util.Map<java.lang.String,java.util.List<java.lang.String>> describeSchemaVersions()
public boolean getHintedHandoffEnabled()
getHintedHandoffEnabled in interface StorageProxyMBeanpublic void setHintedHandoffEnabled(boolean b)
setHintedHandoffEnabled in interface StorageProxyMBeanpublic void enableHintsForDC(java.lang.String dc)
enableHintsForDC in interface StorageProxyMBeanpublic void disableHintsForDC(java.lang.String dc)
disableHintsForDC in interface StorageProxyMBeanpublic java.util.Set<java.lang.String> getHintedHandoffDisabledDCs()
getHintedHandoffDisabledDCs in interface StorageProxyMBeanpublic int getMaxHintWindow()
getMaxHintWindow in interface StorageProxyMBeanpublic void setMaxHintWindow(int ms)
setMaxHintWindow in interface StorageProxyMBeanpublic static boolean shouldHint(java.net.InetAddress ep)
public static void truncateBlocking(java.lang.String keyspace,
java.lang.String cfname)
throws UnavailableException,
java.util.concurrent.TimeoutException,
java.io.IOException
keyspace - cfname - UnavailableException - If some of the hosts in the ring are down.java.util.concurrent.TimeoutExceptionjava.io.IOExceptionpublic long getTotalHints()
getTotalHints in interface StorageProxyMBeanpublic int getMaxHintsInProgress()
getMaxHintsInProgress in interface StorageProxyMBeanpublic void setMaxHintsInProgress(int qs)
setMaxHintsInProgress in interface StorageProxyMBeanpublic int getHintsInProgress()
getHintsInProgress in interface StorageProxyMBeanpublic void verifyNoHintsInProgress()
public java.lang.Long getRpcTimeout()
getRpcTimeout in interface StorageProxyMBeanpublic void setRpcTimeout(java.lang.Long timeoutInMillis)
setRpcTimeout in interface StorageProxyMBeanpublic java.lang.Long getReadRpcTimeout()
getReadRpcTimeout in interface StorageProxyMBeanpublic void setReadRpcTimeout(java.lang.Long timeoutInMillis)
setReadRpcTimeout in interface StorageProxyMBeanpublic java.lang.Long getWriteRpcTimeout()
getWriteRpcTimeout in interface StorageProxyMBeanpublic void setWriteRpcTimeout(java.lang.Long timeoutInMillis)
setWriteRpcTimeout in interface StorageProxyMBeanpublic java.lang.Long getCounterWriteRpcTimeout()
getCounterWriteRpcTimeout in interface StorageProxyMBeanpublic void setCounterWriteRpcTimeout(java.lang.Long timeoutInMillis)
setCounterWriteRpcTimeout in interface StorageProxyMBeanpublic java.lang.Long getCasContentionTimeout()
getCasContentionTimeout in interface StorageProxyMBeanpublic void setCasContentionTimeout(java.lang.Long timeoutInMillis)
setCasContentionTimeout in interface StorageProxyMBeanpublic java.lang.Long getRangeRpcTimeout()
getRangeRpcTimeout in interface StorageProxyMBeanpublic void setRangeRpcTimeout(java.lang.Long timeoutInMillis)
setRangeRpcTimeout in interface StorageProxyMBeanpublic java.lang.Long getTruncateRpcTimeout()
getTruncateRpcTimeout in interface StorageProxyMBeanpublic void setTruncateRpcTimeout(java.lang.Long timeoutInMillis)
setTruncateRpcTimeout in interface StorageProxyMBeanpublic java.lang.Long getNativeTransportMaxConcurrentConnections()
getNativeTransportMaxConcurrentConnections in interface StorageProxyMBeanpublic void setNativeTransportMaxConcurrentConnections(java.lang.Long nativeTransportMaxConcurrentConnections)
setNativeTransportMaxConcurrentConnections in interface StorageProxyMBeanpublic java.lang.Long getNativeTransportMaxConcurrentConnectionsPerIp()
public void setNativeTransportMaxConcurrentConnectionsPerIp(java.lang.Long nativeTransportMaxConcurrentConnections)
public void reloadTriggerClasses()
reloadTriggerClasses in interface StorageProxyMBeanpublic long getReadRepairAttempted()
getReadRepairAttempted in interface StorageProxyMBeanpublic long getReadRepairRepairedBlocking()
getReadRepairRepairedBlocking in interface StorageProxyMBeanpublic long getReadRepairRepairedBackground()
getReadRepairRepairedBackground in interface StorageProxyMBeanCopyright © 2015 The Apache Software Foundation