public static MessageEncoder getInstance(String compressionFormat)
      throws InvocationTargetException, IllegalAccessException {
    Method methodInstance = registry.get(compressionFormat.toLowerCase());
    if (methodInstance == null) {
      LOG.error("received incorrect CompressionFormat " + compressionFormat);
      throw new RuntimeException("compressionFormat: " + compressionFormat + " is not supported.");
    }
    return (MessageEncoder) methodInstance.invoke(null);
  }
Abstract Factory for the construction of HCatalog message instances.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/messaging/MessageFactory.java