Class CodecRegistry

java.lang.Object
org.apache.hadoop.io.erasurecode.CodecRegistry

@Private public final class CodecRegistry extends Object
This class registers all coder implementations. CodecRegistry maps codec names to coder factories. All coder factories are dynamically identified and loaded using ServiceLoader.
  • Method Details

    • getInstance

      public static CodecRegistry getInstance()
    • getCoderNames

      public String[] getCoderNames(String codecName)
      Get all coder names of the given codec.
      Parameters:
      codecName - the name of codec
      Returns:
      an array of all coder names, null if not exist
    • getCoders

      public List<RawErasureCoderFactory> getCoders(String codecName)
      Get all coder factories of the given codec.
      Parameters:
      codecName - the name of codec
      Returns:
      a list of all coder factories, null if not exist
    • getCodecNames

      public Set<String> getCodecNames()
      Get all codec names.
      Returns:
      a set of all codec names
    • getCoderByName

      public RawErasureCoderFactory getCoderByName(String codecName, String coderName)
      Get a specific coder factory defined by codec name and coder name.
      Parameters:
      codecName - name of the codec
      coderName - name of the coder
      Returns:
      the specific coder, null if not exist
    • getCodec2CoderCompactMap

      public Map<String,String> getCodec2CoderCompactMap()
      Get all codec names and their corresponding coder list.
      Returns:
      a map of all codec names, and their corresponding code list separated by ','.