Class ContainerImporter

java.lang.Object
org.apache.hadoop.ozone.container.replication.ContainerImporter

public class ContainerImporter extends Object
Imports container from tarball.
  • Field Details

  • Constructor Details

  • Method Details

    • isAllowedContainerImport

      public boolean isAllowedContainerImport(long containerID)
    • importContainer

      public void importContainer(long containerID, Path tarFilePath, HddsVolume targetVolume, CopyContainerCompression compression) throws IOException
      Throws:
      IOException
    • getUntarDirectory

      public static Path getUntarDirectory(HddsVolume hddsVolume) throws IOException
      Throws:
      IOException
    • getKeyValueContainerData

      protected KeyValueContainerData getKeyValueContainerData(byte[] containerDescriptorYaml) throws IOException
      Throws:
      IOException
    • getImportContainerProgress

      protected Set<Long> getImportContainerProgress()
    • getPacker

      protected TarContainerPacker getPacker(CopyContainerCompression compression)
    • getDefaultReplicationSpace

      public long getDefaultReplicationSpace()
    • getRequiredReplicationSpace

      public long getRequiredReplicationSpace(long actualContainerSize)
      Calculate required replication space based on actual container size.
      Parameters:
      actualContainerSize - the actual size of the container in bytes
      Returns:
      required space for replication (2 * actualContainerSize)
    • getSpaceToReserve

      public long getSpaceToReserve(Long replicateSize)
      Get space to reserve for replication. If replicateSize is provided, calculate required space based on that, otherwise return default replication space.
      Parameters:
      replicateSize - the size of the container to replicate in bytes (can be null)
      Returns:
      space to reserve for replication