Class FileStorageService

java.lang.Object
io.trino.plugin.raptor.legacy.storage.FileStorageService
All Implemented Interfaces:
StorageService

public class FileStorageService extends Object implements StorageService
  • Constructor Details

    • FileStorageService

      @Inject public FileStorageService(StorageManagerConfig config)
    • FileStorageService

      public FileStorageService(File dataDirectory)
  • Method Details

    • start

      @PostConstruct public void start()
      Specified by:
      start in interface StorageService
    • getAvailableBytes

      public long getAvailableBytes()
      Specified by:
      getAvailableBytes in interface StorageService
    • stop

      @PreDestroy public void stop() throws IOException
      Throws:
      IOException
    • getStorageFile

      public File getStorageFile(UUID shardUuid)
      Specified by:
      getStorageFile in interface StorageService
    • getStagingFile

      public File getStagingFile(UUID shardUuid)
      Specified by:
      getStagingFile in interface StorageService
    • getQuarantineFile

      public File getQuarantineFile(UUID shardUuid)
      Specified by:
      getQuarantineFile in interface StorageService
    • getStorageShards

      public Set<UUID> getStorageShards()
      Specified by:
      getStorageShards in interface StorageService
    • createParents

      public void createParents(File file)
      Specified by:
      createParents in interface StorageService
    • getFileSystemPath

      public static File getFileSystemPath(File base, UUID shardUuid)
      Generate a file system path for a shard UUID. This creates a three level deep directory structure where the first two levels each contain two hex digits (lowercase) of the UUID and the final level contains the full UUID. Example:
       UUID: 701e1a79-74f7-4f56-b438-b41e8e7d019d
       Path: /base/70/1e/701e1a79-74f7-4f56-b438-b41e8e7d019d.orc
       
      This ensures that files are spread out evenly through the tree while a path can still be easily navigated by a human being.