org.egothor.store
Class ThickBarrelOut

java.lang.Object
  extended by org.egothor.store.ThickBarrelOut
All Implemented Interfaces:
BarrelWriter
Direct Known Subclasses:
ThickBarrelSortedOut

public class ThickBarrelOut
extends java.lang.Object
implements BarrelWriter

This object implements a barrel that writes its inverted lists to a single file. This class is a core implementation of a barrel writer.

Author:
Leo Galambos

Constructor Summary
ThickBarrelOut(java.lang.String location)
          Constructor for the ThickBarrelOut object.
 
Method Summary
 void append(BarrelReader old)
          Appends the given Barrel to this one.
 void appendIList(long max_len, IListReader il)
          Appends the given inverted list to this Barrel.
 void close()
          Close this stream and mark resources for garbage collection.
 void saveDocument(long globalUID, long localUID, int revision)
           
 void setListenBarrelWriter(ListenBarrelWriter listener)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThickBarrelOut

public ThickBarrelOut(java.lang.String location)
               throws java.io.IOException
Constructor for the ThickBarrelOut object. Calling this constructor creates the location directory and initializes DB files for metadata in that new directory. This constructor allocates the inverted lists single file that is located in a directory location in a file with filename lists

Parameters:
location - the directory to be created
Throws:
java.io.IOException - if the directory cannot be created
Method Detail

setListenBarrelWriter

public void setListenBarrelWriter(ListenBarrelWriter listener)

close

public void close()
Close this stream and mark resources for garbage collection.

Specified by:
close in interface BarrelWriter

saveDocument

public void saveDocument(long globalUID,
                         long localUID,
                         int revision)
                  throws java.io.IOException
Throws:
java.io.IOException

append

public void append(BarrelReader old)
            throws java.io.IOException
Appends the given Barrel to this one. Access to this method should be synchronized,

Specified by:
append in interface BarrelWriter
Parameters:
old - the Barrel to add to this one
Throws:
java.io.IOException - if an I/O error occurs

appendIList

public void appendIList(long max_len,
                        IListReader il)
                 throws java.io.IOException
Appends the given inverted list to this Barrel. All document numbers are increased by the remap value.

Parameters:
max_len - Description of the Parameter
il - the inverted list to add
Throws:
java.io.IOException - if an I/O error occurs