CodecRegistry (Apache Hadoop Common 3.5.0 API)
Description: declaration: package: org.apache.hadoop.io.erasurecode, class: CodecRegistry

Package org.apache.hadoop.io.erasurecode

# 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 Summary

  Modifier and Type
  Method
  Description
  `Map<String,String>`
  `getCodec2CoderCompactMap()`
  Get all codec names and their corresponding coder list.
  `Set<String>`
  `getCodecNames()`
  Get all codec names.
  `RawErasureCoderFactory`
  `getCoderByName(String codecName, String coderName)`
  Get a specific coder factory defined by codec name and coder name.
  `String[]`
  `getCoderNames(String codecName)`
  Get all coder names of the given codec.
  `List<RawErasureCoderFactory>`
  `getCoders(String codecName)`
  Get all coder factories of the given codec.
  `static CodecRegistry`
  `getInstance()`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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 ','.