org.egothor.dynamizer
Class Dynamizer

java.lang.Object
  extended by org.egothor.dynamizer.Dynamizer
All Implemented Interfaces:
Status
Direct Known Subclasses:
Egothor, Standard

public abstract class Dynamizer
extends java.lang.Object
implements Status

This abstract class should be implemented by any class applying an algorithm for dynamization to a data structure. A Dynamizer allows to dynamize a static data structure using a merge algorithm and decomposition into smaller data structures.

Author:
Leo Galambos

Constructor Summary
Dynamizer()
           
 
Method Summary
abstract  void add(BarrelReader a)
          Append a new org.egothor.core.DynStructReader to the existing data structure.
abstract  void add(BarrelReader localBarrelReader, java.lang.String srcLocation)
          Pullovers (moves) a new org.egothor.core.DynStructReader to the existing data structure.
 void close()
           
 TransactionLog commit()
          All buffers must be saved.
 void destroy()
           
 Sequence<Barrel> elements()
          Set of DynStruct elements.
 SlotMap getSlotter()
           
 Slot initializeUnderControl(int slot)
          Require manager to watch over a slot (if it does not yet).
 boolean isDirty()
          Test whether this object has been modified.
abstract  void optimize(boolean useSoftDelete)
          Optimizes the data structure following a delete (or remove) operation on the managed elements.
 boolean removeDoc(long gid, int slot, long lid)
           
 void setSlotter(SlotMap slotter)
          Use the given Manager to handle data chunks.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.egothor.core.Status
getState, setState
 

Constructor Detail

Dynamizer

public Dynamizer()
Method Detail

isDirty

public boolean isDirty()
Test whether this object has been modified.

Returns:
true if it has, false otherwise

initializeUnderControl

public final Slot initializeUnderControl(int slot)
Require manager to watch over a slot (if it does not yet).

Parameters:
slot - the slot

setSlotter

public void setSlotter(SlotMap slotter)
Use the given Manager to handle data chunks.

Parameters:
slotter - the desired Slotter

elements

public final Sequence<Barrel> elements()
Set of DynStruct elements.

Returns:
Description of the Return Value

add

public abstract void add(BarrelReader a)
Append a new org.egothor.core.DynStructReader to the existing data structure. When the algorithm decides that it has to rebuild the actual barrel structures it must optimize.

Parameters:
a - the data structure to append

add

public abstract void add(BarrelReader localBarrelReader,
                         java.lang.String srcLocation)
Pullovers (moves) a new org.egothor.core.DynStructReader to the existing data structure. When the algorithm decides that it has to rebuild the actual barrel structures it must optimize.

Parameters:
localBarrelReader -
srcLocation - location of the structure to be pulled over

optimize

public abstract void optimize(boolean useSoftDelete)
Optimizes the data structure following a delete (or remove) operation on the managed elements.

Parameters:
useSoftDelete - true meand don't delete barrels directly, only log them as dead barrels. false means direct delete

commit

public final TransactionLog commit()
All buffers must be saved. Dead barrels' numbers are saved into a file along with the commit time.

Returns:
TransactionLog object, or null (when the slotter is null or the slotter does not support transaction logs)

close

public final void close()

getSlotter

public SlotMap getSlotter()

destroy

public void destroy()

removeDoc

public boolean removeDoc(long gid,
                         int slot,
                         long lid)