Mobios v0.91

mobios.mckoi.store
Class ScatteringFileStore

java.lang.Object
  extended by mobios.mckoi.store.AbstractStore
      extended by mobios.mckoi.store.ScatteringFileStore
All Implemented Interfaces:
Store

public final class ScatteringFileStore
extends AbstractStore

An implementation of AbstractStore that scatters a store over one or more files in the filesystem. If the amount of data stored in one store exceeds a given threshold the data grows into a new file.

A ScatteringFileStore has a buffering strategy for accessing the underlying files that is implementation defined (by the BufferManager).

Author:
Tobias Downer

Constructor Summary
ScatteringFileStore(File path, String file_name, String first_ext, long max_slice_size, BufferManager buffer_manager, boolean read_only)
          Constructs the ScatteringFileStore.
 
Method Summary
 void convertToScatteringStore(File f)
          Given a file, this will convert to a scattering file store with files no larger than the maximum slice size.
 boolean delete()
          Deletes this store from the file system.
 boolean exists()
          Returns true if this store exists in the file system.
 void flush()
          Flushes any changes to the underlying storage device if the store implements memory mapping or buffering.
 void printBufferStatistics()
          Prints statistics about the buffer manager.
 void synch()
          Flushes and synchronizes any changes made to the store with the underlying persistent device.
 
Methods inherited from class mobios.mckoi.store.AbstractStore
alloc, close, findAllocatedAreasNotIn, free, getAllAreas, getArea, getFixedArea, getFixedArea, getInputStream, getOutputStream, iterator, lastCloseClean, open, openScanAndFix, setFixedArea, statsScan, totalAllocatedSinceStart
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScatteringFileStore

public ScatteringFileStore(File path,
                           String file_name,
                           String first_ext,
                           long max_slice_size,
                           BufferManager buffer_manager,
                           boolean read_only)
Constructs the ScatteringFileStore.

Method Detail

convertToScatteringStore

public void convertToScatteringStore(File f)
                              throws IOException
Given a file, this will convert to a scattering file store with files no larger than the maximum slice size.

Throws:
IOException

delete

public boolean delete()
               throws IOException
Deletes this store from the file system. This operation should only be used when the store is NOT open.

Throws:
IOException

exists

public boolean exists()
               throws IOException
Returns true if this store exists in the file system.

Throws:
IOException

flush

public void flush()
           throws IOException
Description copied from interface: Store
Flushes any changes to the underlying storage device if the store implements memory mapping or buffering.

Throws:
IOException

synch

public void synch()
           throws IOException
Description copied from interface: Store
Flushes and synchronizes any changes made to the store with the underlying persistent device. This is only necessary for stores based on files. After an 'alloc', 'free' or write operation has occured, this method should be called if this level of robustness is necessary.

Throws:
IOException

printBufferStatistics

public void printBufferStatistics()
Prints statistics about the buffer manager. Statistics include number of hits, misses, amount of time spent in reading data from disk, amount of time spent in writing data to disk, etc. Added by Willard, 2005.05.24


Mobios v0.91

(C) 2002 - 2006 The MoBIoS Group