public class StorageProxy extends java.lang.Object implements StorageProxyMBean
Modifier and Type | Class and Description |
---|---|
static class |
StorageProxy.LocalReadRunnable |
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 |
---|---|
boolean |
appliesLocally(Mutation mutation) |
static AbstractWriteResponseHandler<IMutation> |
applyCounterMutationOnCoordinator(CounterMutation cm,
java.lang.String localDataCenter,
long queryStartNanoTime) |
static AbstractWriteResponseHandler<IMutation> |
applyCounterMutationOnLeader(CounterMutation cm,
java.lang.String localDataCenter,
java.lang.Runnable callback,
long queryStartNanoTime) |
static RowIterator |
cas(java.lang.String keyspaceName,
java.lang.String cfName,
DecoratedKey key,
CASRequest request,
ConsistencyLevel consistencyForPaxos,
ConsistencyLevel consistencyForCommit,
ClientState state,
int nowInSeconds,
long queryStartNanoTime)
Apply @param updates if and only if the current values in the row for @param key
match the provided @param conditions.
|
static PartitionIterator |
concatAndBlockOnRepair(java.util.List<PartitionIterator> iterators,
java.util.List<ReadRepair<?,?>> repairs) |
static java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
describeSchemaVersions(boolean withPort)
initiate a request/response session with each live node to check whether or not everybody is using the same
migration id.
|
void |
disableCheckForDuplicateRowsDuringCompaction() |
void |
disableCheckForDuplicateRowsDuringReads() |
void |
disableHintsForDC(java.lang.String dc) |
void |
disableRepairedDataTrackingForPartitionReads() |
void |
disableRepairedDataTrackingForRangeReads() |
void |
disableReportingUnconfirmedRepairedDataMismatches() |
void |
disableSnapshotOnDuplicateRowDetection() |
void |
disableSnapshotOnRepairedDataMismatch() |
void |
enableCheckForDuplicateRowsDuringCompaction() |
void |
enableCheckForDuplicateRowsDuringReads() |
void |
enableHintsForDC(java.lang.String dc) |
void |
enableRepairedDataTrackingForPartitionReads() |
void |
enableRepairedDataTrackingForRangeReads()
Tracking and reporting of variances in the repaired data set across replicas at read time
|
void |
enableReportingUnconfirmedRepairedDataMismatches() |
void |
enableSnapshotOnDuplicateRowDetection() |
void |
enableSnapshotOnRepairedDataMismatch() |
java.lang.Long |
getCasContentionTimeout() |
boolean |
getCheckForDuplicateRowsDuringCompaction() |
boolean |
getCheckForDuplicateRowsDuringReads() |
java.lang.Long |
getCounterWriteRpcTimeout() |
java.util.Set<java.lang.String> |
getHintedHandoffDisabledDCs() |
boolean |
getHintedHandoffEnabled() |
int |
getHintsInProgress() |
java.lang.String |
getIdealConsistencyLevel() |
int |
getMaxHintsInProgress() |
int |
getMaxHintWindow() |
java.lang.Long |
getNativeTransportMaxConcurrentConnections() |
java.lang.Long |
getNativeTransportMaxConcurrentConnectionsPerIp() |
int |
getNumberOfTables() |
int |
getOtcBacklogExpirationInterval()
Deprecated.
|
java.lang.Long |
getRangeRpcTimeout() |
static PartitionIterator |
getRangeSlice(PartitionRangeReadCommand command,
ConsistencyLevel consistencyLevel,
long queryStartNanoTime) |
long |
getReadRepairAttempted() |
long |
getReadRepairRepairedBackground() |
long |
getReadRepairRepairedBlocking() |
java.lang.Long |
getReadRpcTimeout() |
boolean |
getRepairedDataTrackingEnabledForPartitionReads() |
boolean |
getRepairedDataTrackingEnabledForRangeReads() |
boolean |
getReportingUnconfirmedRepairedDataMismatchesEnabled() |
java.lang.Long |
getRpcTimeout() |
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getSchemaVersions()
Returns each live node's schema version
|
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getSchemaVersionsWithPort() |
boolean |
getSnapshotOnDuplicateRowDetectionEnabled() |
boolean |
getSnapshotOnRepairedDataMismatchEnabled() |
long |
getTotalHints() |
java.lang.Long |
getTruncateRpcTimeout() |
java.lang.Long |
getWriteRpcTimeout() |
static void |
mutate(java.util.List<? extends IMutation> mutations,
ConsistencyLevel consistencyLevel,
long queryStartNanoTime)
Use this method to have these Mutations applied
across all replicas.
|
static void |
mutateAtomically(java.util.Collection<Mutation> mutations,
ConsistencyLevel consistency_level,
boolean requireQuorumForRemove,
long queryStartNanoTime)
See mutate.
|
static AbstractWriteResponseHandler<IMutation> |
mutateCounter(CounterMutation cm,
java.lang.String localDataCenter,
long queryStartNanoTime)
Handle counter mutation on the coordinator host.
|
static void |
mutateMV(java.nio.ByteBuffer dataKey,
java.util.Collection<Mutation> mutations,
boolean writeCommitLog,
java.util.concurrent.atomic.AtomicLong baseComplete,
long queryStartNanoTime)
Use this method to have these Mutations applied
across all replicas.
|
static void |
mutateWithTriggers(java.util.List<? extends IMutation> mutations,
ConsistencyLevel consistencyLevel,
boolean mutateAtomically,
long queryStartNanoTime) |
static AbstractWriteResponseHandler<IMutation> |
performWrite(IMutation mutation,
ConsistencyLevel consistencyLevel,
java.lang.String localDataCenter,
StorageProxy.WritePerformer performer,
java.lang.Runnable callback,
WriteType writeType,
long queryStartNanoTime)
Perform the write of a mutation given a WritePerformer.
|
static PartitionIterator |
read(SinglePartitionReadCommand.Group group,
ConsistencyLevel consistencyLevel,
ClientState state,
long queryStartNanoTime)
Performs the actual reading of a row out of the StorageService, fetching
a specific set of column names from a given column family.
|
static PartitionIterator |
read(SinglePartitionReadCommand.Group group,
ConsistencyLevel consistencyLevel,
long queryStartNanoTime) |
static RowIterator |
readOne(SinglePartitionReadCommand command,
ConsistencyLevel consistencyLevel,
ClientState state,
long queryStartNanoTime) |
static RowIterator |
readOne(SinglePartitionReadCommand command,
ConsistencyLevel consistencyLevel,
long queryStartNanoTime) |
void |
reloadTriggerClasses() |
static void |
sendToHintedReplicas(Mutation mutation,
ReplicaPlan.ForTokenWrite plan,
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) |
java.lang.String |
setIdealConsistencyLevel(java.lang.String cl) |
void |
setMaxHintsInProgress(int qs) |
void |
setMaxHintWindow(int ms) |
void |
setNativeTransportMaxConcurrentConnections(java.lang.Long nativeTransportMaxConcurrentConnections) |
void |
setNativeTransportMaxConcurrentConnectionsPerIp(java.lang.Long nativeTransportMaxConcurrentConnections) |
void |
setOtcBacklogExpirationInterval(int intervalInMillis)
Deprecated.
|
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(Replica replica) |
static java.util.concurrent.Future<java.lang.Void> |
submitHint(Mutation mutation,
EndpointsForToken targets,
AbstractWriteResponseHandler<IMutation> responseHandler) |
static java.util.concurrent.Future<java.lang.Void> |
submitHint(Mutation mutation,
Replica 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() |
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, int nowInSeconds, long queryStartNanoTime) throws UnavailableException, IsBootstrappingException, RequestFailureException, RequestTimeoutException, InvalidRequestException, CasWriteUnknownResultException
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.UnavailableException
IsBootstrappingException
RequestFailureException
RequestTimeoutException
InvalidRequestException
CasWriteUnknownResultException
public static void mutate(java.util.List<? extends IMutation> mutations, ConsistencyLevel consistencyLevel, long queryStartNanoTime) throws UnavailableException, OverloadedException, WriteTimeoutException, WriteFailureException
mutations
- the mutations to be applied across the replicasconsistencyLevel
- the consistency level for the operationqueryStartNanoTime
- the value of System.nanoTime() when the query started to be processedUnavailableException
OverloadedException
WriteTimeoutException
WriteFailureException
public boolean appliesLocally(Mutation mutation)
public static void mutateMV(java.nio.ByteBuffer dataKey, java.util.Collection<Mutation> mutations, boolean writeCommitLog, java.util.concurrent.atomic.AtomicLong baseComplete, long queryStartNanoTime) throws UnavailableException, OverloadedException, WriteTimeoutException
mutations
- the mutations to be applied across the replicaswriteCommitLog
- if commitlog should be writtenbaseComplete
- time from epoch in ms that the local base mutation was(or will be) completedqueryStartNanoTime
- the value of System.nanoTime() when the query started to be processedUnavailableException
OverloadedException
WriteTimeoutException
public static void mutateWithTriggers(java.util.List<? extends IMutation> mutations, ConsistencyLevel consistencyLevel, boolean mutateAtomically, long queryStartNanoTime) throws WriteTimeoutException, WriteFailureException, UnavailableException, OverloadedException, InvalidRequestException
public static void mutateAtomically(java.util.Collection<Mutation> mutations, ConsistencyLevel consistency_level, boolean requireQuorumForRemove, long queryStartNanoTime) 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 batchlogqueryStartNanoTime
- the value of System.nanoTime() when the query started to be processedUnavailableException
OverloadedException
WriteTimeoutException
public static AbstractWriteResponseHandler<IMutation> performWrite(IMutation mutation, ConsistencyLevel consistencyLevel, java.lang.String localDataCenter, StorageProxy.WritePerformer performer, java.lang.Runnable callback, WriteType writeType, long queryStartNanoTime)
mutation
- the mutation to be appliedconsistencyLevel
- 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 isqueryStartNanoTime
- the value of System.nanoTime() when the query started to be processedpublic static void sendToHintedReplicas(Mutation mutation, ReplicaPlan.ForTokenWrite plan, 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 AbstractWriteResponseHandler<IMutation> mutateCounter(CounterMutation cm, java.lang.String localDataCenter, long queryStartNanoTime) throws UnavailableException, OverloadedException
public static AbstractWriteResponseHandler<IMutation> applyCounterMutationOnLeader(CounterMutation cm, java.lang.String localDataCenter, java.lang.Runnable callback, long queryStartNanoTime) throws UnavailableException, OverloadedException
public static AbstractWriteResponseHandler<IMutation> applyCounterMutationOnCoordinator(CounterMutation cm, java.lang.String localDataCenter, long queryStartNanoTime) throws UnavailableException, OverloadedException
public static RowIterator readOne(SinglePartitionReadCommand command, ConsistencyLevel consistencyLevel, long queryStartNanoTime) throws UnavailableException, IsBootstrappingException, ReadFailureException, ReadTimeoutException, InvalidRequestException
public static RowIterator readOne(SinglePartitionReadCommand command, ConsistencyLevel consistencyLevel, ClientState state, long queryStartNanoTime) throws UnavailableException, IsBootstrappingException, ReadFailureException, ReadTimeoutException, InvalidRequestException
public static PartitionIterator read(SinglePartitionReadCommand.Group group, ConsistencyLevel consistencyLevel, long queryStartNanoTime) throws UnavailableException, IsBootstrappingException, ReadFailureException, ReadTimeoutException, InvalidRequestException
public static PartitionIterator read(SinglePartitionReadCommand.Group group, ConsistencyLevel consistencyLevel, ClientState state, long queryStartNanoTime) throws UnavailableException, IsBootstrappingException, ReadFailureException, ReadTimeoutException, InvalidRequestException
public static PartitionIterator concatAndBlockOnRepair(java.util.List<PartitionIterator> iterators, java.util.List<ReadRepair<?,?>> repairs)
public static PartitionIterator getRangeSlice(PartitionRangeReadCommand command, ConsistencyLevel consistencyLevel, long queryStartNanoTime)
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getSchemaVersions()
StorageProxyMBean
getSchemaVersions
in interface StorageProxyMBean
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getSchemaVersionsWithPort()
getSchemaVersionsWithPort
in interface StorageProxyMBean
public static java.util.Map<java.lang.String,java.util.List<java.lang.String>> describeSchemaVersions(boolean withPort)
public boolean getHintedHandoffEnabled()
getHintedHandoffEnabled
in interface StorageProxyMBean
public void setHintedHandoffEnabled(boolean b)
setHintedHandoffEnabled
in interface StorageProxyMBean
public void enableHintsForDC(java.lang.String dc)
enableHintsForDC
in interface StorageProxyMBean
public void disableHintsForDC(java.lang.String dc)
disableHintsForDC
in interface StorageProxyMBean
public java.util.Set<java.lang.String> getHintedHandoffDisabledDCs()
getHintedHandoffDisabledDCs
in interface StorageProxyMBean
public int getMaxHintWindow()
getMaxHintWindow
in interface StorageProxyMBean
public void setMaxHintWindow(int ms)
setMaxHintWindow
in interface StorageProxyMBean
public static boolean shouldHint(Replica replica)
public static void truncateBlocking(java.lang.String keyspace, java.lang.String cfname) throws UnavailableException, java.util.concurrent.TimeoutException
keyspace
- cfname
- UnavailableException
- If some of the hosts in the ring are down.java.util.concurrent.TimeoutException
public long getTotalHints()
getTotalHints
in interface StorageProxyMBean
public int getMaxHintsInProgress()
getMaxHintsInProgress
in interface StorageProxyMBean
public void setMaxHintsInProgress(int qs)
setMaxHintsInProgress
in interface StorageProxyMBean
public int getHintsInProgress()
getHintsInProgress
in interface StorageProxyMBean
public void verifyNoHintsInProgress()
public static java.util.concurrent.Future<java.lang.Void> submitHint(Mutation mutation, Replica target, AbstractWriteResponseHandler<IMutation> responseHandler)
public static java.util.concurrent.Future<java.lang.Void> submitHint(Mutation mutation, EndpointsForToken targets, AbstractWriteResponseHandler<IMutation> responseHandler)
public java.lang.Long getRpcTimeout()
getRpcTimeout
in interface StorageProxyMBean
public void setRpcTimeout(java.lang.Long timeoutInMillis)
setRpcTimeout
in interface StorageProxyMBean
public java.lang.Long getReadRpcTimeout()
getReadRpcTimeout
in interface StorageProxyMBean
public void setReadRpcTimeout(java.lang.Long timeoutInMillis)
setReadRpcTimeout
in interface StorageProxyMBean
public java.lang.Long getWriteRpcTimeout()
getWriteRpcTimeout
in interface StorageProxyMBean
public void setWriteRpcTimeout(java.lang.Long timeoutInMillis)
setWriteRpcTimeout
in interface StorageProxyMBean
public java.lang.Long getCounterWriteRpcTimeout()
getCounterWriteRpcTimeout
in interface StorageProxyMBean
public void setCounterWriteRpcTimeout(java.lang.Long timeoutInMillis)
setCounterWriteRpcTimeout
in interface StorageProxyMBean
public java.lang.Long getCasContentionTimeout()
getCasContentionTimeout
in interface StorageProxyMBean
public void setCasContentionTimeout(java.lang.Long timeoutInMillis)
setCasContentionTimeout
in interface StorageProxyMBean
public java.lang.Long getRangeRpcTimeout()
getRangeRpcTimeout
in interface StorageProxyMBean
public void setRangeRpcTimeout(java.lang.Long timeoutInMillis)
setRangeRpcTimeout
in interface StorageProxyMBean
public java.lang.Long getTruncateRpcTimeout()
getTruncateRpcTimeout
in interface StorageProxyMBean
public void setTruncateRpcTimeout(java.lang.Long timeoutInMillis)
setTruncateRpcTimeout
in interface StorageProxyMBean
public java.lang.Long getNativeTransportMaxConcurrentConnections()
getNativeTransportMaxConcurrentConnections
in interface StorageProxyMBean
public void setNativeTransportMaxConcurrentConnections(java.lang.Long nativeTransportMaxConcurrentConnections)
setNativeTransportMaxConcurrentConnections
in interface StorageProxyMBean
public java.lang.Long getNativeTransportMaxConcurrentConnectionsPerIp()
public void setNativeTransportMaxConcurrentConnectionsPerIp(java.lang.Long nativeTransportMaxConcurrentConnections)
public void reloadTriggerClasses()
reloadTriggerClasses
in interface StorageProxyMBean
public long getReadRepairAttempted()
getReadRepairAttempted
in interface StorageProxyMBean
public long getReadRepairRepairedBlocking()
getReadRepairRepairedBlocking
in interface StorageProxyMBean
public long getReadRepairRepairedBackground()
getReadRepairRepairedBackground
in interface StorageProxyMBean
public int getNumberOfTables()
getNumberOfTables
in interface StorageProxyMBean
public java.lang.String getIdealConsistencyLevel()
getIdealConsistencyLevel
in interface StorageProxyMBean
public java.lang.String setIdealConsistencyLevel(java.lang.String cl)
setIdealConsistencyLevel
in interface StorageProxyMBean
@Deprecated public int getOtcBacklogExpirationInterval()
getOtcBacklogExpirationInterval
in interface StorageProxyMBean
@Deprecated public void setOtcBacklogExpirationInterval(int intervalInMillis)
setOtcBacklogExpirationInterval
in interface StorageProxyMBean
public void enableRepairedDataTrackingForRangeReads()
StorageProxyMBean
enableRepairedDataTrackingForRangeReads
in interface StorageProxyMBean
public void disableRepairedDataTrackingForRangeReads()
disableRepairedDataTrackingForRangeReads
in interface StorageProxyMBean
public boolean getRepairedDataTrackingEnabledForRangeReads()
getRepairedDataTrackingEnabledForRangeReads
in interface StorageProxyMBean
public void enableRepairedDataTrackingForPartitionReads()
enableRepairedDataTrackingForPartitionReads
in interface StorageProxyMBean
public void disableRepairedDataTrackingForPartitionReads()
disableRepairedDataTrackingForPartitionReads
in interface StorageProxyMBean
public boolean getRepairedDataTrackingEnabledForPartitionReads()
getRepairedDataTrackingEnabledForPartitionReads
in interface StorageProxyMBean
public void enableReportingUnconfirmedRepairedDataMismatches()
enableReportingUnconfirmedRepairedDataMismatches
in interface StorageProxyMBean
public void disableReportingUnconfirmedRepairedDataMismatches()
disableReportingUnconfirmedRepairedDataMismatches
in interface StorageProxyMBean
public boolean getReportingUnconfirmedRepairedDataMismatchesEnabled()
getReportingUnconfirmedRepairedDataMismatchesEnabled
in interface StorageProxyMBean
public boolean getSnapshotOnRepairedDataMismatchEnabled()
getSnapshotOnRepairedDataMismatchEnabled
in interface StorageProxyMBean
public void enableSnapshotOnRepairedDataMismatch()
enableSnapshotOnRepairedDataMismatch
in interface StorageProxyMBean
public void disableSnapshotOnRepairedDataMismatch()
disableSnapshotOnRepairedDataMismatch
in interface StorageProxyMBean
public boolean getSnapshotOnDuplicateRowDetectionEnabled()
getSnapshotOnDuplicateRowDetectionEnabled
in interface StorageProxyMBean
public void enableSnapshotOnDuplicateRowDetection()
enableSnapshotOnDuplicateRowDetection
in interface StorageProxyMBean
public void disableSnapshotOnDuplicateRowDetection()
disableSnapshotOnDuplicateRowDetection
in interface StorageProxyMBean
public boolean getCheckForDuplicateRowsDuringReads()
getCheckForDuplicateRowsDuringReads
in interface StorageProxyMBean
public void enableCheckForDuplicateRowsDuringReads()
enableCheckForDuplicateRowsDuringReads
in interface StorageProxyMBean
public void disableCheckForDuplicateRowsDuringReads()
disableCheckForDuplicateRowsDuringReads
in interface StorageProxyMBean
public boolean getCheckForDuplicateRowsDuringCompaction()
getCheckForDuplicateRowsDuringCompaction
in interface StorageProxyMBean
public void enableCheckForDuplicateRowsDuringCompaction()
enableCheckForDuplicateRowsDuringCompaction
in interface StorageProxyMBean
public void disableCheckForDuplicateRowsDuringCompaction()
disableCheckForDuplicateRowsDuringCompaction
in interface StorageProxyMBean
Copyright © 2009- The Apache Software Foundation