|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public static interface SplittableAlgorithm.SplittableAlgorithmResult
This is helper class that allows the split method to control the creation of algorithms.
When the 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 ... } }
Method Summary | |
---|---|
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. |
Method Detail |
---|
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 moved
BucketStorageException
- if the move can't be performed due to the capacity or filtering reasons
java.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 moved
BucketStorageException
- if the move can't be performed due to the capacity or filtering reasons
java.lang.InstantiationException
- if encapsulating bucket for the algorithm cannot be created
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |