Class BmStores


  • public final class BmStores
    extends Object
    Factory methods for stores.
    • Method Detail

      • createLongLogStructuredFileStore

        public static IBmPersistentLongStore createLongLogStructuredFileStore​(Path path,
                                                                              int fileSizeCompactionThreshold)
        Creates a log-structured file store with long keys.
        Parameters:
        path - The path of the file to store data. May not be null.
        fileSizeCompactionThreshold - The file size in bytes that when exceeded may trigger data compaction. Must be greater than 0.
        Returns:
        the created store, never null.
      • createLongLogStructuredFileStore

        public static IBmPersistentLongStore createLongLogStructuredFileStore​(Path path,
                                                                              int fileSizeCompactionThreshold,
                                                                              int wastePercentageCompactionThreshold)
        Creates a log-structured file store with long keys.
        Parameters:
        path - The path of the file to store data. May not be null.
        fileSizeCompactionThreshold - The file size in bytes that when exceeded may trigger data compaction. Must be greater than 0.
        wastePercentageCompactionThreshold - The waste percentage that when exceeded may trigger data compaction. Must be greater than 0.
        Returns:
        the created store, never null.
      • createMemoryMappedLongLogStructuredFileStore

        public static IBmPersistentLongStore createMemoryMappedLongLogStructuredFileStore​(Path path,
                                                                                          int fileSizeCompactionThreshold)
        Creates a memory-mapped log-structured file store with long keys.
        Parameters:
        path - The path of the file to store data. May not be null.
        fileSizeCompactionThreshold - The file size in bytes that when exceeded may trigger data compaction. Must be greater than 0.
        Returns:
        the created store, never null.
      • createMemoryMappedLongLogStructuredFileStore

        public static IBmPersistentLongStore createMemoryMappedLongLogStructuredFileStore​(Path path,
                                                                                          int fileSizeCompactionThreshold,
                                                                                          int wastePercentageCompactionThreshold)
        Creates a memory-mapped log-structured file store with long keys.
        Parameters:
        path - The path of the file to store data. May not be null.
        fileSizeCompactionThreshold - The file size in bytes that when exceeded may trigger data compaction. Must be greater than 0.
        wastePercentageCompactionThreshold - The waste percentage that when exceeded may trigger data compaction. Must be greater than 0.
        Returns:
        the created store, never null.
      • createStringLogStructuredFileStore

        public static IBmPersistentStringStore createStringLogStructuredFileStore​(Path path,
                                                                                  int fileSizeCompactionThreshold)
        Creates a log-structured file store with string keys.
        Parameters:
        path - The path of the file to store data. May not be null.
        fileSizeCompactionThreshold - The file size in bytes that when exceeded may trigger data compaction. Must be greater than 0.
        Returns:
        the created store, never null.
      • createStringLogStructuredFileStore

        public static IBmPersistentStringStore createStringLogStructuredFileStore​(Path path,
                                                                                  int fileSizeCompactionThreshold,
                                                                                  int wastePercentageCompactionThreshold)
        Creates a log-structured file store with string keys.
        Parameters:
        path - The path of the file to store data. May not be null.
        fileSizeCompactionThreshold - The file size in bytes that when exceeded may trigger data compaction. Must be greater than 0.
        wastePercentageCompactionThreshold - The waste percentage that when exceeded may trigger data compaction. Must be greater than 0.
        Returns:
        the created store, never null.
      • createObjectKeyLogStructuredFileStore

        public static <K> IBmPersistentObjectKeyStore<K> createObjectKeyLogStructuredFileStore​(IBmSerializer<K> keySerializer,
                                                                                               Path path,
                                                                                               int fileSizeCompactionThreshold)
        Creates a log-structured file store with particular object type keys.
        Type Parameters:
        K - The store key type.
        Parameters:
        keySerializer - The key serializer. May not be null.
        path - The path of the file to store data. May not be null.
        fileSizeCompactionThreshold - The file size in bytes that when exceeded may trigger data compaction. Must be greater than 0.
        Returns:
        the created store, never null.
      • createObjectKeyLogStructuredFileStore

        public static <K> IBmPersistentObjectKeyStore<K> createObjectKeyLogStructuredFileStore​(IBmSerializer<K> keySerializer,
                                                                                               Path path,
                                                                                               int fileSizeCompactionThreshold,
                                                                                               int wastePercentageCompactionThreshold)
        Creates a log-structured file store with particular object type keys.
        Type Parameters:
        K - The store key type.
        Parameters:
        keySerializer - The key serializer. May not be null.
        path - The path of the file to store data. May not be null.
        fileSizeCompactionThreshold - The file size in bytes that when exceeded may trigger data compaction. Must be greater than 0.
        wastePercentageCompactionThreshold - The waste percentage that when exceeded may trigger data compaction. Must be greater than 0.
        Returns:
        the created store, never null.
      • createStringRegistry

        public static IBmPersistentStringRegistry createStringRegistry​(Path path)
                                                                throws IOException
        Creates a persistent string registry.
        Parameters:
        path - The path of the file to store data. May not be null.
        Returns:
        the created registry, never null.
        Throws:
        IOException - if any I/O error occurs.
      • createStringRegistry

        public static IBmPersistentStringRegistry createStringRegistry​(Path path,
                                                                       int maxAllowedId)
                                                                throws IOException
        Creates a persistent string registry.
        Parameters:
        path - The path of the file to store data. May not be null.
        maxAllowedId - The maximum allowed ID. Must be greater than 0.
        Returns:
        the created registry, never null.
        Throws:
        IOException - if any I/O error occurs.
      • createWorkLog

        @Deprecated
        public static IBmWorkLog createWorkLog​(Path path,
                                               long sizeThreshold)
                                        throws IOException
        Deprecated.
        Creates a work log.
        Parameters:
        path - The path of the file to store data. May not be null.
        sizeThreshold - The size threshold. Must be greater than 0.
        Returns:
        the created work log, never null.
        Throws:
        IOException - if any I/O error occurs.
      • createWal

        public static IBmWal createWal​(Path path)
                                throws IOException
        Creates a write-ahead log.
        Parameters:
        path - The path of the file to store data. May not be null.
        Returns:
        the created write-ahead log, never null.
        Throws:
        IOException - if any I/O error occurs.