Class TarContainerPacker
java.lang.Object
org.apache.hadoop.ozone.container.keyvalue.TarContainerPacker
- All Implemented Interfaces:
ContainerPacker<KeyValueContainerData>
Compress/uncompress KeyValueContainer data to a tar archive.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PathgetChunkPath(Path baseDir) static PathgetDbPath(Path baseDir, KeyValueContainerData containerData) static PathgetDbPath(KeyValueContainerData containerData) voidpack(Container<KeyValueContainerData> container, OutputStream output) Given a containerData include all the required container data/metadata in a tar file.byte[]unpackContainerData(Container<KeyValueContainerData> container, InputStream input, Path tmpDir, Path destContainerDir) Given an input stream (tar file) extract the data to the specified directories.byte[]Read the descriptor from the finished archive to get the data before importing the container.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.ozone.container.common.interfaces.ContainerPacker
persistCustomContainerState
-
Constructor Details
-
TarContainerPacker
-
-
Method Details
-
unpackContainerData
public byte[] unpackContainerData(Container<KeyValueContainerData> container, InputStream input, Path tmpDir, Path destContainerDir) throws IOException Given an input stream (tar file) extract the data to the specified directories.- Specified by:
unpackContainerDatain interfaceContainerPacker<KeyValueContainerData>- Parameters:
container- container which defines the destination structure.input- the input stream.- Returns:
- the byte content of the descriptor (which won't be written to a file but returned).
- Throws:
IOException
-
pack
public void pack(Container<KeyValueContainerData> container, OutputStream output) throws IOException Given a containerData include all the required container data/metadata in a tar file.- Specified by:
packin interfaceContainerPacker<KeyValueContainerData>- Parameters:
container- Container to archive (data + metadata).output- Destination tar file/stream.- Throws:
IOException
-
unpackContainerDescriptor
Description copied from interface:ContainerPackerRead the descriptor from the finished archive to get the data before importing the container.- Specified by:
unpackContainerDescriptorin interfaceContainerPacker<KeyValueContainerData>- Throws:
IOException
-
getDbPath
-
getDbPath
-
getChunkPath
-