uk.ac.starlink.table.storage

## Class ByteStoreStoragePolicy

- java.lang.Object
- - uk.ac.starlink.table.StoragePolicy
  - - uk.ac.starlink.table.storage.ByteStoreStoragePolicy

-     public abstract class ByteStoreStoragePolicy
      extends StoragePolicy

  Abstract StoragePolicy implementation based on a ByteStore. The `attemptMakeByteStore()` method must be implemented, and the other methods are implemented in terms of that.
  Since:
    5 Nov 2009

- - ### Field Summary

    - ### Fields inherited from class uk.ac.starlink.table.StoragePolicy

      `ADAPTIVE, DISCARD, PREF_PROPERTY, PREFER_DISK, PREFER_MEMORY, SIDEWAYS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ByteStoreStoragePolicy()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract ByteStore` | `attemptMakeByteStore()` Returns a ByteStore object to hold data.
    `ByteStore` | `makeByteStore()` Returns a new ByteStore object which can be used to provide a destination for general purpose data storage.
    `RowStore` | `makeConfiguredRowStore(StarTable meta)` Creates a new RowStore and primes it by calling `TableSink.acceptMetadata(uk.ac.starlink.table.StarTable)` on it.
    `RowStore` | `makeRowStore()` Returns a new `RowStore` object which can be used to provide a destination for random-access table storage.

    - ### Methods inherited from class uk.ac.starlink.table.StoragePolicy

      `copyTable, getDefaultPolicy, randomTable, setDefaultPolicy`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ByteStoreStoragePolicy

          public ByteStoreStoragePolicy()

  - ### Method Detail

    - #### attemptMakeByteStore

          protected abstract ByteStore attemptMakeByteStore()
                                                     throws java.io.IOException

      Returns a ByteStore object to hold data. If an exception is thrown, this implementation will fall back to memory-based techniques.
      Returns:
        new byte store
      Throws:
        `java.io.IOException`

    - #### makeByteStore

          public ByteStore makeByteStore()

      Description copied from class: `StoragePolicy`
      Returns a new ByteStore object which can be used to provide a destination for general purpose data storage.
      Specified by:
        `makeByteStore` in class `StoragePolicy`
      Returns:
        new byte store

    - #### makeRowStore

          public RowStore makeRowStore()

      Description copied from class: `StoragePolicy`
      Returns a new `RowStore` object which can be used to provide a destination for random-access table storage.
      Specified by:
        `makeRowStore` in class `StoragePolicy`
      Returns:
        a RowStore object

    - #### makeConfiguredRowStore

          public RowStore makeConfiguredRowStore(StarTable meta)

      Description copied from class: `StoragePolicy`
      Creates a new RowStore and primes it by calling `TableSink.acceptMetadata(uk.ac.starlink.table.StarTable)` on it.
      Specified by:
        `makeConfiguredRowStore` in class `StoragePolicy`
      Parameters:
        `meta` - template giving the metadata which describes the rows that will have to be stored
      Returns:
        a RowStore on which `acceptMetadata(meta)` has been called