org.egothor.dir
Class Tanker

java.lang.Object
  extended by org.egothor.dir.Group
      extended by org.egothor.dir.Tanker
All Implemented Interfaces:
Resolver<CachedQuery,CachedResult>, Barrel, BarrelWriter
Direct Known Subclasses:
TankerImpl

public abstract class Tanker
extends Group
implements BarrelWriter

A Tanker is a group of Barrels with the capability of inserting new Barrels. The insertion often causes the reorganization of the active Barrels of the group. The reorganization is then assured by Dynamizer.

Author:
Leo Galambos

Field Summary
 
Fields inherited from class org.egothor.dir.Group
cache
 
Constructor Summary
protected Tanker()
           
 
Method Summary
 void append(BarrelReader a)
          Add the given Barrel to this Tanker.
 void close()
          Close this Tanker.
 void commit()
          Store the actual state of this Tanker.
protected  void commitEmit(int recordsx4, long[] record4)
           
protected  void commitEmitEnd()
           
 void destroy()
          Destroy this Tanker.
 Sequence<Barrel> elements()
          Return the Barrels in this Tanker.
abstract  DocumentData expandDocMetadata(DocumentData ofBarrel, Token[] interest)
          Retrives the document data, but restrict the data block to the part relevant to some tokens of our interest.
protected  void finalize()
          Calls close().
 int getRootVersionID()
           
protected  void initialize(Distributor<Barrel> dis, Dynamizer dyn)
          Constructor for the Tanker object.
 boolean isDirty()
          Test whether this Tanker has been modified.
 void optimize()
          Description of the Method
 
Methods inherited from class org.egothor.dir.Group
deleted, expand, forEach, getBitmap, getCache, getCWI, getIListMeta, getMeta, initialize, initializeCache, initializeCache, initializeCache, initializeCache, iterate, open, openIList, query, query, removeDoc, resolve, setBitmap, size
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Tanker

protected Tanker()
Method Detail

initialize

protected void initialize(Distributor<Barrel> dis,
                          Dynamizer dyn)
Constructor for the Tanker object.

Parameters:
dis - handles requests of this Tanker
dyn - takes care of reorganization if necessary

isDirty

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

Returns:
true if it has, false otherwise

expandDocMetadata

public abstract DocumentData expandDocMetadata(DocumentData ofBarrel,
                                               Token[] interest)
Description copied from class: Group
Retrives the document data, but restrict the data block to the part relevant to some tokens of our interest. Full data block is retrieved if none interest is specified.

Specified by:
expandDocMetadata in class Group

elements

public Sequence<Barrel> elements()
Return the Barrels in this Tanker.

Specified by:
elements in class Group
Returns:
an Enumeration of Barrels

commit

public void commit()
Store the actual state of this Tanker. In addition to the global properties of this Tanker, the ID of each Barrel in this Tanker is written to this Tanker's configuration file. If the location of the Tanker is null it does nothing.

Specified by:
commit in interface Barrel

commitEmit

protected void commitEmit(int recordsx4,
                          long[] record4)
                   throws java.io.IOException
Throws:
java.io.IOException

commitEmitEnd

protected void commitEmitEnd()
                      throws java.io.IOException
Throws:
java.io.IOException

getRootVersionID

public int getRootVersionID()

close

public void close()
Close this Tanker.

Specified by:
close in interface Barrel
Specified by:
close in interface BarrelWriter
Overrides:
close in class Group

append

public void append(BarrelReader a)
Add the given Barrel to this Tanker.

Specified by:
append in interface BarrelWriter
Parameters:
a - the Barrel to add

destroy

public void destroy()
Destroy this Tanker. The Tanker configuration file will be deleted from the system.

Specified by:
destroy in interface Barrel
Overrides:
destroy in class Group

optimize

public void optimize()
Description of the Method


finalize

protected void finalize()
Calls close().

Overrides:
finalize in class java.lang.Object