Class ContainerImporter
java.lang.Object
org.apache.hadoop.ozone.container.replication.ContainerImporter
Imports container from tarball.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionContainerImporter(org.apache.hadoop.hdds.conf.ConfigurationSource conf, ContainerSet containerSet, ContainerController controller, MutableVolumeSet volumeSet, VolumeChoosingPolicy volumeChoosingPolicy) -
Method Summary
Modifier and TypeMethodDescriptionlongprotected KeyValueContainerDatagetKeyValueContainerData(byte[] containerDescriptorYaml) protected TarContainerPackergetPacker(CopyContainerCompression compression) longgetRequiredReplicationSpace(long actualContainerSize) Calculate required replication space based on actual container size.longgetSpaceToReserve(Long replicateSize) Get space to reserve for replication.static PathgetUntarDirectory(HddsVolume hddsVolume) voidimportContainer(long containerID, Path tarFilePath, HddsVolume targetVolume, CopyContainerCompression compression) booleanisAllowedContainerImport(long containerID)
-
Field Details
-
CONTAINER_COPY_DIR
- See Also:
-
-
Constructor Details
-
ContainerImporter
public ContainerImporter(@Nonnull org.apache.hadoop.hdds.conf.ConfigurationSource conf, @Nonnull ContainerSet containerSet, @Nonnull ContainerController controller, @Nonnull MutableVolumeSet volumeSet, @Nonnull VolumeChoosingPolicy volumeChoosingPolicy)
-
-
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
- Throws:
IOException
-
getKeyValueContainerData
protected KeyValueContainerData getKeyValueContainerData(byte[] containerDescriptorYaml) throws IOException - Throws:
IOException
-
getImportContainerProgress
-
getPacker
-
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
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
-