Class RocksDBUtils


  • public class RocksDBUtils
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static double ROCKSDB_OVERHEAD_RATIO_FOR_HYBRID_STORE
      With level_compaction_dynamic_level_bytes to be false, the stable LSM structure is not guaranteed, so the maximum overhead could be around 2.111 for hybrid stores.
    • Constructor Summary

      Constructors 
      Constructor Description
      RocksDBUtils()  
    • Field Detail

      • ROCKSDB_OVERHEAD_RATIO_FOR_HYBRID_STORE

        public static final double ROCKSDB_OVERHEAD_RATIO_FOR_HYBRID_STORE
        With level_compaction_dynamic_level_bytes to be false, the stable LSM structure is not guaranteed, so the maximum overhead could be around 2.111 for hybrid stores. Check https://github.com/facebook/rocksdb/wiki/Leveled-Compaction
        See Also:
        Constant Field Values
    • Constructor Detail

      • RocksDBUtils

        public RocksDBUtils()
    • Method Detail

      • getPartitionDbName

        public static java.lang.String getPartitionDbName​(java.lang.String storeName,
                                                          int partitionId)
      • parseStoreNameFromPartitionDbName

        public static java.lang.String parseStoreNameFromPartitionDbName​(java.lang.String partitionDbName)
      • parsePartitionIdFromPartitionDbName

        public static int parsePartitionIdFromPartitionDbName​(java.lang.String partitionDbName)
      • composeStoreDbDir

        public static java.lang.String composeStoreDbDir​(java.lang.String dbDir,
                                                         java.lang.String storeName)
      • composePartitionDbDir

        public static java.lang.String composePartitionDbDir​(java.lang.String dbDir,
                                                             java.lang.String topicName,
                                                             int partitionId)
      • composeSnapshotDir

        public static java.lang.String composeSnapshotDir​(java.lang.String dbDir,
                                                          java.lang.String topicName,
                                                          int partitionId)
      • composeSnapshotDir

        public static java.lang.String composeSnapshotDir​(java.lang.String composePartitionDbDir)
      • composeTempSSTFileDir

        public static java.lang.String composeTempSSTFileDir​(java.lang.String dbDir,
                                                             java.lang.String topicName,
                                                             int partitionId)
      • composeTempRMDSSTFileDir

        public static java.lang.String composeTempRMDSSTFileDir​(java.lang.String dbDir,
                                                                java.lang.String topicName,
                                                                int partitionId)
      • composeTempSSTFileName

        public static java.lang.String composeTempSSTFileName​(int fileNo)
      • composeTempRMDSSTFileName

        public static java.lang.String composeTempRMDSSTFileName​(int fileNo)
      • isTempSSTFile

        public static boolean isTempSSTFile​(java.lang.String fileName)
      • isTempRMDSSTFile

        public static boolean isTempRMDSSTFile​(java.lang.String fileName)
      • extractTempSSTFileNo

        public static int extractTempSSTFileNo​(java.lang.String fileName)
      • extractTempRMDSSTFileNo

        public static int extractTempRMDSSTFileNo​(java.lang.String fileName)
      • deletePartitionDir

        public static void deletePartitionDir​(java.lang.String baseDir,
                                              java.lang.String storeName,
                                              int version,
                                              int partition)
        Deletes the files associated with the specified store, version, and partition.
        Parameters:
        storeName - the name of the store
        version - the version number of the store
        partition - the partition ID