Class HadoopSnappyCompressionProvider
- java.lang.Object
-
- org.apache.hop.core.compress.hadoopsnappy.HadoopSnappyCompressionProvider
-
- All Implemented Interfaces:
ICompressionProvider
@CompressionPlugin(id="HADOOPSNAPPY", name="Hadoop-snappy", description="Hadoop Snappy compression") public class HadoopSnappyCompressionProvider extends Object implements ICompressionProvider
-
-
Field Summary
Fields Modifier and Type Field Description static intIO_COMPRESSION_CODEC_SNAPPY_DEFAULT_BUFFERSIZE
-
Constructor Summary
Constructors Constructor Description HadoopSnappyCompressionProvider()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description HadoopSnappyCompressionInputStreamcreateInputStream(InputStream in)Creates an input stream that decompresses data (according to the provider's implementation)HadoopSnappyCompressionOutputStreamcreateOutputStream(OutputStream out)Creates an output stream that compresses data (according to the provider's implementation)static ObjectgetActiveSnappyShim()Locate the Snappy Shim for the active Hadoop Configuration via the Hadoop Configuration UtilStringgetDefaultExtension()Gets the default file extension for this provider.StringgetDescription()Gets the name of this provider.StringgetName()Gets the name of this provider.static booleanisHadoopSnappyAvailable()Tests whether hadoop-snappy (not to be confused with other java-based snappy implementations such as jsnappy or snappy-java) plus the native snappy libraries are available.booleansupportsInput()Whether this compression provider supports input streamsbooleansupportsOutput()Whether this compression provider supports output streams
-
-
-
Field Detail
-
IO_COMPRESSION_CODEC_SNAPPY_DEFAULT_BUFFERSIZE
public static final int IO_COMPRESSION_CODEC_SNAPPY_DEFAULT_BUFFERSIZE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getActiveSnappyShim
public static Object getActiveSnappyShim() throws Exception
Locate the Snappy Shim for the active Hadoop Configuration via the Hadoop Configuration Util- Returns:
- A
org.apache.hop.hadoop.shim.spi.SnappyShimto interact with Snappy - Throws:
Exception- Error locating a valid Snappy shim:org.apache.hop.hadoop.hive.jdbc.HadoopConfigurationUtilcould not be located- No active Hadoop configuration
- Active Hadoop configuration doesn't support Snappy
-
isHadoopSnappyAvailable
public static boolean isHadoopSnappyAvailable()
Tests whether hadoop-snappy (not to be confused with other java-based snappy implementations such as jsnappy or snappy-java) plus the native snappy libraries are available.- Returns:
- true if hadoop-snappy is available on the classpath
-
createInputStream
public HadoopSnappyCompressionInputStream createInputStream(InputStream in) throws IOException
Description copied from interface:ICompressionProviderCreates an input stream that decompresses data (according to the provider's implementation)- Specified by:
createInputStreamin interfaceICompressionProvider- Parameters:
in- An existing input stream to wrap- Returns:
- a CompressionInputStream object that decompresses incoming data
- Throws:
IOException
-
supportsInput
public boolean supportsInput()
Description copied from interface:ICompressionProviderWhether this compression provider supports input streams- Specified by:
supportsInputin interfaceICompressionProvider- Returns:
- true if the provider supports input streams, false otherwise
-
createOutputStream
public HadoopSnappyCompressionOutputStream createOutputStream(OutputStream out) throws IOException
Description copied from interface:ICompressionProviderCreates an output stream that compresses data (according to the provider's implementation)- Specified by:
createOutputStreamin interfaceICompressionProvider- Parameters:
out- An existing output stream to wrap- Returns:
- a CompressionOutputStream object that compresses outgoing data
- Throws:
IOException
-
supportsOutput
public boolean supportsOutput()
Description copied from interface:ICompressionProviderWhether this compression provider supports output streams- Specified by:
supportsOutputin interfaceICompressionProvider- Returns:
- true if the provider supports output streams, false otherwise
-
getDescription
public String getDescription()
Description copied from interface:ICompressionProviderGets the name of this provider. Used for display e.g.- Specified by:
getDescriptionin interfaceICompressionProvider- Returns:
- A String containing a description of this provider
-
getName
public String getName()
Description copied from interface:ICompressionProviderGets the name of this provider. Used for display and as a reference in saved artifacts (pipelines, e.g.)- Specified by:
getNamein interfaceICompressionProvider- Returns:
- A String containing the name of this provider
-
getDefaultExtension
public String getDefaultExtension()
Description copied from interface:ICompressionProviderGets the default file extension for this provider. If the streams are wrapped in File streams, this method can be used to determine an appropriate extension to append to the filename so the file will be recognized as an artifact of the compression mechanism (.zip, .bz2, e.g.)- Specified by:
getDefaultExtensionin interfaceICompressionProvider- Returns:
- A String containing the default file extension for this provider
-
-