Class RocksDBUtils

java.lang.Object
com.linkedin.venice.store.rocksdb.RocksDBUtils

public class RocksDBUtils extends Object
  • Field Details

    • 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:
  • Constructor Details

    • RocksDBUtils

      public RocksDBUtils()
  • Method Details

    • getPartitionDbName

      public static String getPartitionDbName(String storeName, int partitionId)
    • parseStoreNameFromPartitionDbName

      public static String parseStoreNameFromPartitionDbName(String partitionDbName)
    • parsePartitionIdFromPartitionDbName

      public static int parsePartitionIdFromPartitionDbName(String partitionDbName)
    • composeStoreDbDir

      public static String composeStoreDbDir(String dbDir, String storeName)
    • composePartitionDbDir

      public static String composePartitionDbDir(String dbDir, String topicName, int partitionId)
    • composeTempPartitionDir

      public static String composeTempPartitionDir(String dbDir, String topicName, int partitionId)
    • isTempPartitionDir

      public static boolean isTempPartitionDir(String partitionDir)
    • composeSnapshotDir

      public static String composeSnapshotDir(String dbDir, String topicName, int partitionId)
    • composeSnapshotDir

      public static String composeSnapshotDir(String composePartitionDbDir)
    • composeTempSSTFileDir

      public static String composeTempSSTFileDir(String dbDir, String topicName, int partitionId)
    • composeTempRMDSSTFileDir

      public static String composeTempRMDSSTFileDir(String dbDir, String topicName, int partitionId)
    • composeTempSSTFileName

      public static String composeTempSSTFileName(int fileNo)
    • composeTempRMDSSTFileName

      public static String composeTempRMDSSTFileName(int fileNo)
    • isTempSSTFile

      public static boolean isTempSSTFile(String fileName)
    • isTempRMDSSTFile

      public static boolean isTempRMDSSTFile(String fileName)
    • extractTempSSTFileNo

      public static int extractTempSSTFileNo(String fileName)
    • extractTempRMDSSTFileNo

      public static int extractTempRMDSSTFileNo(String fileName)
    • deleteDirectory

      public static void deleteDirectory(String directoryPathStr)
      Deletes the files associated with the specified partition directory.
    • renameTempTransferredPartitionDirToPartitionDir

      public static void renameTempTransferredPartitionDirToPartitionDir(String dbDir, String topicName, int partitionId)
      Rename the temporary transferred partition directory to the final partition directory. example of temp partition dir: /db/directory/myStore_v3/temp_transferred_myStore_v3_3/ example of final partition dir: /db/directory/myStore_v3/myStore_v3_3/
      Parameters:
      dbDir - the base directory where the partition directories are located
      topicName - the topic name
      partitionId - the partition id
    • cleanupBothPartitionDirAndTempTransferredDir

      public static void cleanupBothPartitionDirAndTempTransferredDir(String storeName, int versionNumber, int partitionId, String basePath)
      Cleans up both the partition directory and the temporary transferred directory for a given store, version, and partition. temp directory example: /db/directory/myStore_v3/temp_transferred_myStore_v3_3/ partition directory example: /db/directory/myStore_v3/myStore_v3_3/
      Parameters:
      storeName -
      versionNumber -
      partitionId -
      basePath -