Class ScatteringStoreDataAccessor


  • public class ScatteringStoreDataAccessor
    extends java.lang.Object
    An implementation of StoreDataAccessor that scatters the addressible data resource across multiple files in the file system. When one store data resource reaches a certain threshold size, the content 'flows' over to the next file.
    Author:
    Tobias Downer
    • Constructor Summary

      Constructors 
      Constructor Description
      ScatteringStoreDataAccessor​(java.io.File path, java.lang.String file_name, java.lang.String first_ext, long max_slice_size)
      Constructs the store data accessor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      void convertToScatteringStore​(java.io.File f)
      Given a file, this will convert to a scattering file store with files no larger than the maximum slice size.
      boolean delete()  
      boolean exists()  
      long getSize()  
      void open​(boolean read_only)  
      void read​(long position, byte[] buf, int off, int len)  
      void setSize​(long length)  
      void synch()  
      void write​(long position, byte[] buf, int off, int len)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ScatteringStoreDataAccessor

        public ScatteringStoreDataAccessor​(java.io.File path,
                                           java.lang.String file_name,
                                           java.lang.String first_ext,
                                           long max_slice_size)
        Constructs the store data accessor.
    • Method Detail

      • convertToScatteringStore

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

        public void open​(boolean read_only)
                  throws java.io.IOException
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • delete

        public boolean delete()
      • exists

        public boolean exists()
      • read

        public void read​(long position,
                         byte[] buf,
                         int off,
                         int len)
                  throws java.io.IOException
        Throws:
        java.io.IOException
      • write

        public void write​(long position,
                          byte[] buf,
                          int off,
                          int len)
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • setSize

        public void setSize​(long length)
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • getSize

        public long getSize()
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • synch

        public void synch()
                   throws java.io.IOException
        Throws:
        java.io.IOException