Class CompressionProcessor
- java.lang.Object
-
- org.apache.ignite.internal.processors.GridProcessorAdapter
-
- org.apache.ignite.internal.processors.compress.CompressionProcessor
-
- All Implemented Interfaces:
GridComponent,GridProcessor
public class CompressionProcessor extends GridProcessorAdapter
Compression processor.- See Also:
IgniteComponentType.COMPRESSION
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.ignite.internal.GridComponent
GridComponent.DiscoveryDataExchangeType
-
-
Field Summary
Fields Modifier and Type Field Description protected static byteCOMPACTED_PAGEprotected static byteLZ4_COMPRESSED_PAGEstatic intLZ4_DEFAULT_LEVELstatic intLZ4_MAX_LEVELstatic intLZ4_MIN_LEVELprotected static byteSNAPPY_COMPRESSED_PAGEstatic byteUNCOMPRESSED_PAGEprotected static byteZSTD_COMPRESSED_PAGEstatic intZSTD_DEFAULT_LEVELstatic intZSTD_MAX_LEVELstatic intZSTD_MIN_LEVEL-
Fields inherited from class org.apache.ignite.internal.processors.GridProcessorAdapter
ctx, diagnosticLog, log
-
-
Constructor Summary
Constructors Constructor Description CompressionProcessor(GridKernalContext ctx)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static intcheckCompressionLevelBounds(int compressLevel, DiskPageCompression compression)voidcheckPageCompressionSupported()Checks weither page compression can be used for page file storage.voidcheckPageCompressionSupported(Path storagePath, int pageSize)Checks weither page file storage supports compression.ByteBuffercompressPage(ByteBuffer page, int pageSize, int blockSize, DiskPageCompression compression, int compressLevel)voiddecompressPage(ByteBuffer page, int pageSize)protected ByteBufferdoCompactPage(ByteBuffer page, int pageSize)protected ByteBufferdoCompressPage(DiskPageCompression compression, ByteBuffer compactPage, int compactSize, int compressLevel)protected voiddoDecompressPage(int compressType, ByteBuffer page, int compressedSize, int compactSize)static intgetCompressionLevel(Integer compressLevel, DiskPageCompression compression)static intgetDefaultCompressionLevel(DiskPageCompression compression)protected static ByteBuffersetCompactionInfo(ByteBuffer page, int compactSize)protected static ByteBuffersetCompressionInfo(ByteBuffer page, DiskPageCompression compression, int compressedSize, int compactedSize)-
Methods inherited from class org.apache.ignite.internal.processors.GridProcessorAdapter
assertParameter, collectGridNodeData, collectJoiningNodeData, discoveryDataType, onDisconnected, onGridDataReceived, onJoiningNodeDataReceived, onKernalStart, onKernalStop, onReconnected, printMemoryStats, start, stop, toString, validateNode, validateNode
-
-
-
-
Field Detail
-
LZ4_MIN_LEVEL
public static final int LZ4_MIN_LEVEL
- See Also:
- Constant Field Values
-
LZ4_MAX_LEVEL
public static final int LZ4_MAX_LEVEL
- See Also:
- Constant Field Values
-
LZ4_DEFAULT_LEVEL
public static final int LZ4_DEFAULT_LEVEL
- See Also:
- Constant Field Values
-
ZSTD_MIN_LEVEL
public static final int ZSTD_MIN_LEVEL
- See Also:
- Constant Field Values
-
ZSTD_MAX_LEVEL
public static final int ZSTD_MAX_LEVEL
- See Also:
- Constant Field Values
-
ZSTD_DEFAULT_LEVEL
public static final int ZSTD_DEFAULT_LEVEL
- See Also:
- Constant Field Values
-
UNCOMPRESSED_PAGE
public static final byte UNCOMPRESSED_PAGE
- See Also:
- Constant Field Values
-
COMPACTED_PAGE
protected static final byte COMPACTED_PAGE
- See Also:
- Constant Field Values
-
ZSTD_COMPRESSED_PAGE
protected static final byte ZSTD_COMPRESSED_PAGE
- See Also:
- Constant Field Values
-
LZ4_COMPRESSED_PAGE
protected static final byte LZ4_COMPRESSED_PAGE
- See Also:
- Constant Field Values
-
SNAPPY_COMPRESSED_PAGE
protected static final byte SNAPPY_COMPRESSED_PAGE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CompressionProcessor
public CompressionProcessor(GridKernalContext ctx)
- Parameters:
ctx- Kernal context.
-
-
Method Detail
-
getCompressionLevel
public static int getCompressionLevel(Integer compressLevel, DiskPageCompression compression)
- Parameters:
compressLevel- Compression level.compression- Compression algorithm.- Returns:
- Compression level.
-
getDefaultCompressionLevel
public static int getDefaultCompressionLevel(DiskPageCompression compression)
- Parameters:
compression- Compression algorithm.- Returns:
- Default compression level.
-
checkCompressionLevelBounds
public static int checkCompressionLevelBounds(int compressLevel, DiskPageCompression compression)- Parameters:
compressLevel- Compression level.compression- Compression algorithm.- Returns:
- Compression level.
-
checkPageCompressionSupported
public void checkPageCompressionSupported() throws IgniteCheckedExceptionChecks weither page compression can be used for page file storage.- Throws:
IgniteCheckedException- If compression is not supported.
-
checkPageCompressionSupported
public void checkPageCompressionSupported(Path storagePath, int pageSize) throws IgniteCheckedException
Checks weither page file storage supports compression.- Parameters:
storagePath- Storage path.pageSize- Page size.- Throws:
IgniteCheckedException- If compression is not supported.
-
setCompactionInfo
protected static ByteBuffer setCompactionInfo(ByteBuffer page, int compactSize)
- Parameters:
page- Page.compactSize- Compacted page size.- Returns:
- The given page.
-
setCompressionInfo
protected static ByteBuffer setCompressionInfo(ByteBuffer page, DiskPageCompression compression, int compressedSize, int compactedSize)
- Parameters:
page- Page.compression- Compression algorithm.compressedSize- Compressed size.compactedSize- Compact size.- Returns:
- The given page.
-
compressPage
public ByteBuffer compressPage(ByteBuffer page, int pageSize, int blockSize, DiskPageCompression compression, int compressLevel) throws IgniteCheckedException
- Parameters:
page- Page buffer.pageSize- Page size.blockSize- Store block size.compression- Compression algorithm.compressLevel- Compression level.- Returns:
- Possibly compressed buffer.
- Throws:
IgniteCheckedException- If failed.
-
doCompactPage
protected ByteBuffer doCompactPage(ByteBuffer page, int pageSize) throws IgniteCheckedException
- Parameters:
page- Page buffer.pageSize- Page size.- Returns:
- Compacted page buffer.
- Throws:
IgniteCheckedException
-
doCompressPage
protected ByteBuffer doCompressPage(DiskPageCompression compression, ByteBuffer compactPage, int compactSize, int compressLevel)
- Parameters:
compression- Compression algorithm.compactPage- Compacted page.compactSize- Compacted page size.compressLevel- Compression level.- Returns:
- Compressed page.
-
decompressPage
public void decompressPage(ByteBuffer page, int pageSize) throws IgniteCheckedException
- Parameters:
page- Possibly compressed page buffer.pageSize- Page size.- Throws:
IgniteCheckedException- If failed.
-
doDecompressPage
protected void doDecompressPage(int compressType, ByteBuffer page, int compressedSize, int compactSize)
-
-