public static interface SplittableAlgorithm.SplittableAlgorithmResult
SplittableAlgorithm.split(messif.buckets.split.SplitPolicy, messif.buckets.split.SplittableAlgorithm.SplittableAlgorithmResult, int)
method is called, an instance of this class is provided and
the split method should mark all the objects moved through either the
markMovedObject(messif.algorithms.Algorithm, messif.objects.LocalAbstractObject)
or markMovedObjects(messif.algorithms.Algorithm, java.util.Collection<? extends messif.objects.LocalAbstractObject>)
method.
Example of a split method implementation:
class SomeAlgorithm extends Algorithm { ... public void split(SplitPolicy policy, SplittableAlgorithmResult result) throws OccupationLowException, IllegalArgumentException, CapacityFullException { Algorithm newAlgorithm = new SomeAlgorithm(...); // Move some objects from this algorithm to another one and get the number of bytes or number of objects moved for (...moving one object o...) { result.markMovedObject(newAlgorithm, o); } // Or a batch move result.markMovedObjects(newAlgorithm, ...collection of objects...); ... batch move of collection of objects to algorithm newAlgorithm ... } }
Modifier and Type | Method and Description |
---|---|
void |
markMovedObject(Algorithm algorithm,
LocalAbstractObject object)
Registers a move of one object into the result.
|
void |
markMovedObjects(Algorithm algorithm,
java.util.Collection<? extends LocalAbstractObject> objects)
Registers a move of objects into the result.
|
void markMovedObjects(Algorithm algorithm, java.util.Collection<? extends LocalAbstractObject> objects) throws BucketStorageException, java.lang.InstantiationException
algorithm
- the created algorithm that is the destination for the moveobjects
- the objects movedBucketStorageException
- if the move can't be performed due to the capacity or filtering reasonsjava.lang.InstantiationException
- if encapsulating bucket for the algorithm cannot be createdvoid markMovedObject(Algorithm algorithm, LocalAbstractObject object) throws BucketStorageException, java.lang.InstantiationException
algorithm
- the created algorithm that is the destination for the moveobject
- the object movedBucketStorageException
- if the move can't be performed due to the capacity or filtering reasonsjava.lang.InstantiationException
- if encapsulating bucket for the algorithm cannot be created