Spring for Apache Hadoop

org.springframework.data.hadoop.store.codec
Enum Codecs

java.lang.Object
  extended by java.lang.Enum<Codecs>
      extended by org.springframework.data.hadoop.store.codec.Codecs
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Codecs>

public enum Codecs
extends java.lang.Enum<Codecs>

Default codecs supported by store framework. We keep codec info here for implementations which are supported out of the box. Reference to codec is a fully qualified name of a class, not a class itself. This allows user to define and use codecs which are added into a classpath unknown during the compilation time.

This enum also allows case insensitive lookup for main abbreviation. Defined abbreviations strings in a constructor are just keywords to do back mapping from a lookup table. Registering a mixing abbreviations is not checked.

Codecs.get("gzip").getAbbreviation(); -> "GZIP"

Author:
Janne Valkealahti

Enum Constant Summary
BZIP2
          Splittable BZip2Codec.
GZIP
          Non-splittable GzipCodec.
LZO
          Non-splittable LzoCodec.
LZOP
          Non-splittable LzopCodec.
SLZO
          Splittable LzoCodec.
SLZOP
          Splittable LzoCodec.
SNAPPY
          Non-splittable SnappyCodec.
 
Method Summary
static Codecs get(java.lang.String abbreviation)
          Gets the Codecs by its abbreviation.
 java.lang.String getAbbreviation()
          Gets the main abbreviation.
 java.lang.String[] getAbbreviations()
          Gets the abbreviations.
 CodecInfo getCodecInfo()
          Gets the codec info.
static CodecInfo getCodecInfo(java.lang.String abbreviation)
          Gets the CodecInfo by Codecs abbreviation.
static Codecs valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Codecs[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

GZIP

public static final Codecs GZIP
Non-splittable GzipCodec.


SNAPPY

public static final Codecs SNAPPY
Non-splittable SnappyCodec. This codec will need native snappy libraries.


BZIP2

public static final Codecs BZIP2
Splittable BZip2Codec.


LZO

public static final Codecs LZO
Non-splittable LzoCodec. This codec should be based on implementation from http://code.google.com/p/hadoop-gpl-compression.


SLZO

public static final Codecs SLZO
Splittable LzoCodec. This codec should be based on implementation from http://github.com/kevinweil/hadoop-lzo.


LZOP

public static final Codecs LZOP
Non-splittable LzopCodec. This codec should be based on implementation from http://code.google.com/p/hadoop-gpl-compression.


SLZOP

public static final Codecs SLZOP
Splittable LzoCodec. This codec should be based on implementation from http://github.com/kevinweil/hadoop-lzo.

Method Detail

values

public static Codecs[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Codecs c : Codecs.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Codecs valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getCodecInfo

public CodecInfo getCodecInfo()
Gets the codec info.

Returns:
the codec info

getAbbreviation

public java.lang.String getAbbreviation()
Gets the main abbreviation.

Returns:
the main abbreviation

getAbbreviations

public java.lang.String[] getAbbreviations()
Gets the abbreviations.

Returns:
the abbreviations

get

public static Codecs get(java.lang.String abbreviation)
Gets the Codecs by its abbreviation. Lookup returns NULL if abbreviation hasn't been registered.

Parameters:
abbreviation - the abbreviation
Returns:
the codecs resulted as a lookup

getCodecInfo

public static CodecInfo getCodecInfo(java.lang.String abbreviation)
Gets the CodecInfo by Codecs abbreviation. Lookup returns NULL if abbreviation hasn't been registered.

Parameters:
abbreviation - the abbreviation
Returns:
the codec info resulted as a lookup
See Also:
get(String)

Spring for Apache Hadoop