org.apache.hcatalog.common
Enum HCatContext

Object
  extended by Enum<HCatContext>
      extended by HCatContext
All Implemented Interfaces:
Serializable, Comparable<HCatContext>

@InterfaceAudience.Public
@InterfaceStability.Evolving
public enum HCatContext
extends Enum<HCatContext>

HCatContext is a singleton that provides global access to configuration data.

HCatalog provides a variety of functionality that users can configure at runtime through configuration properties. Available configuration properties are defined in HCatConstants. HCatContext allows users to enable optional functionality by setting properties in a provided configuration.

HCatalog users (MR apps, processing framework adapters) should set properties in a configuration that has been provided to setConf(org.apache.hadoop.conf.Configuration) to enable optional functionality. The job configuration must be used to ensure properties are passed to the backend MR tasks.

HCatalog developers should enable optional functionality by checking properties from getConf(). Since users are not obligated to set a configuration, optional functionality must provide a sensible default.


Enum Constant Summary
INSTANCE
           
 
Method Summary
 Optional<Configuration> getConf()
          Get the configuration, if there is one.
 HCatContext setConf(Configuration newConf)
          Use the given configuration for optional behavior.
static HCatContext valueOf(String name)
          Returns the enum constant of this type with the specified name.
static HCatContext[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

INSTANCE

public static final HCatContext INSTANCE
Method Detail

values

public static HCatContext[] 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 (HCatContext c : HCatContext.values())
    System.out.println(c);

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

valueOf

public static HCatContext valueOf(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:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

setConf

public HCatContext setConf(Configuration newConf)
Use the given configuration for optional behavior. Keys exclusive to an existing config are set in the new conf. The job conf must be used to ensure properties are passed to backend MR tasks.


getConf

public Optional<Configuration> getConf()
Get the configuration, if there is one. Users are not required to setup HCatContext unless they wish to override default behavior, so the configuration may not be present.

Returns:
an Optional that might contain a Configuration