public class ReplicationNetworkBucketDispatcher extends NetworkBucketDispatcher
Modifier and Type | Field and Description |
---|---|
protected StatisticSimpleWeakrefCounter |
bucketOperationDistcompCounter
Statistic for per query operation DC
|
protected boolean |
replicateBucketsEqually
If true then automatically replicate all bucket at the same nodes
|
log, UNASSIGNED_BUCKET_ID
Constructor and Description |
---|
ReplicationNetworkBucketDispatcher(MessageDispatcher messageDisp,
int maxBuckets,
long bucketCapacity,
boolean replicateBucketsEqually,
java.lang.Class<? extends LocalBucket> defaultBucketClass)
Creates a new instance of ReplicationNetworkBucketDispatcher
|
ReplicationNetworkBucketDispatcher(MessageDispatcher messageDisp,
int maxBuckets,
long bucketCapacity,
long bucketSoftCapacity,
long bucketLowOccupation,
boolean bucketOccupationAsBytes,
java.lang.Class<? extends LocalBucket> defaultBucketClass,
boolean replicateBucketsEqually)
Creates a new instance of ReplicationNetworkBucketDispatcher
|
Modifier and Type | Method and Description |
---|---|
LocalBucket |
addBucket(LocalBucket bucket)
Add new bucket with encapsulation into ReplicationBucket
|
void |
createReplica(NetworkNode atNetworkNode)
Methods to be executed on the replication buckets
|
java.util.Set<NetworkNode> |
getAllReplicaNodes()
Return set of all network nodes where my buckets have some replicas
|
StatisticSimpleWeakrefCounter |
getBucketOperationDistcompCounter()
Get this bucket dispatcher's statistic for per query operation DC
|
boolean |
removeReplica(NetworkNode atNetworkNode)
Remove replica of this bucket from all bucket in this dispatcher.
|
void |
replicaMigrated(NetworkNode origNode,
NetworkNode newNode)
One of the replicas (of potentially all buckets) has been migrated.
|
copyAllObjects, createRemoteBucket, createRemoteBucket, createRemoteBucket, finalize, getCurrentNetworkNode, receive, removeRemoteBucket, send, splitBucket
closeTemporarilyIfIdle, createAutoPivotChooser, createBucket, createBucket, createBucket, createBucket, createBucket, createBucket, destroy, getAllBucketIDs, getAllBuckets, getAutoPivotChooser, getAutoPivotChooserClass, getBucket, getBucketCapacity, getBucketCount, getBucketLowOccupation, getBucketOccupationAsBytes, getBucketSoftCapacity, getDefaultBucketClass, getDefaultBucketClassParams, getMaxBuckets, getObjectCount, getOccupation, getOverloadedBucketCount, moveBucket, removeBucket, removeBucket, setAllBucketLowOccupation, setAllBucketSoftCapacity, setAutoPivotChooser, setAutoPivotChooser, setBucketCapacity, setBucketLowOccupation, setBucketOccupationAsBytes, setBucketSoftCapacity, setDefaultBucketClass, setDefaultBucketClassParams, setTemporaryClosePeriod, toString
protected StatisticSimpleWeakrefCounter bucketOperationDistcompCounter
protected final boolean replicateBucketsEqually
public ReplicationNetworkBucketDispatcher(MessageDispatcher messageDisp, int maxBuckets, long bucketCapacity, boolean replicateBucketsEqually, java.lang.Class<? extends LocalBucket> defaultBucketClass) throws java.lang.InstantiationException
java.lang.InstantiationException
public ReplicationNetworkBucketDispatcher(MessageDispatcher messageDisp, int maxBuckets, long bucketCapacity, long bucketSoftCapacity, long bucketLowOccupation, boolean bucketOccupationAsBytes, java.lang.Class<? extends LocalBucket> defaultBucketClass, boolean replicateBucketsEqually) throws java.lang.InstantiationException
java.lang.InstantiationException
public StatisticSimpleWeakrefCounter getBucketOperationDistcompCounter()
public LocalBucket addBucket(LocalBucket bucket) throws BucketStorageException, java.lang.IllegalStateException
addBucket
in class BucketDispatcher
bucket
- the bucket to add to this dispatcherBucketStorageException
- if the maximal number of buckets is already allocatedjava.lang.IllegalStateException
- if the bucket is already maintained by another onepublic void createReplica(NetworkNode atNetworkNode) throws BucketStorageException, java.lang.IllegalStateException
BucketStorageException
java.lang.IllegalStateException
public boolean removeReplica(NetworkNode atNetworkNode) throws java.io.IOException
java.io.IOException
public void replicaMigrated(NetworkNode origNode, NetworkNode newNode)
public java.util.Set<NetworkNode> getAllReplicaNodes()