public class

NamespacedConfig

extends ZNRecord
java.lang.Object
   ↳ org.apache.helix.ZNRecord
     ↳ org.apache.helix.api.config.NamespacedConfig
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Generic configuration of Helix components prefixed with a namespace

Summary

Constants
char PREFIX_CHAR
[Expand]
Inherited Constants
From class org.apache.helix.ZNRecord
Public Constructors
NamespacedConfig(Scope<?> scope, String prefix)
Instantiate a NamespacedConfig.
NamespacedConfig(HelixProperty property, String prefix)
Instantiate a NamespacedConfig from an existing HelixProperty
NamespacedConfig(NamespacedConfig config)
Instantiate a NamespacedConfig as a copy of another NamedspacedConfig
Public Methods
static void addConfigToProperty(HelixProperty property, NamespacedConfig config)
Add user configuration to an existing helix property.
List<String> getListField(String k)
Get a single List field
Map<StringList<String>> getListFields()
Returns an immutable map of list fields
Map<StringString> getMapField(String k)
Get a single Map field
Map<StringMap<StringString>> getMapFields()
Returns an immutable map of map fields
String getPrefix()
Get the prefix used to distinguish these config properties
Map<StringList<String>> getPrefixedListFields()
Get all list fields with prefixed keys
Map<StringMap<StringString>> getPrefixedMapFields()
Get all map fields with prefixed keys
Map<StringString> getPrefixedSimpleFields()
Get all simple fields with prefixed keys
String getSimpleField(String k)
Get a single String field
Map<StringString> getSimpleFields()
Returns an immutable map of simple fields
void setListField(String k, List<String> v)
Set a single String --> List field
void setListFields(Map<StringList<String>> listFields)
Set all fields whose values are a list of values
void setMapField(String k, Map<StringString> v)
Set a single String --> Map field
void setMapFields(Map<StringMap<StringString>> mapFields)
Set all fields whose values are key, value properties
void setSimpleField(String k, String v)
Set a simple key, value field
void setSimpleFields(Map<StringString> simpleFields)
Set all plain key, value fields
[Expand]
Inherited Methods
From class org.apache.helix.ZNRecord
From class java.lang.Object

Constants

public static final char PREFIX_CHAR

Constant Value: 33 (0x00000021)

Public Constructors

public NamespacedConfig (Scope<?> scope, String prefix)

Instantiate a NamespacedConfig. It is intended for use only by entities that can be identified

Parameters
scope scope object

public NamespacedConfig (HelixProperty property, String prefix)

Instantiate a NamespacedConfig from an existing HelixProperty

Parameters
property property wrapping a configuration

public NamespacedConfig (NamespacedConfig config)

Instantiate a NamespacedConfig as a copy of another NamedspacedConfig

Parameters
config populated NamespacedConfig

Public Methods

public static void addConfigToProperty (HelixProperty property, NamespacedConfig config)

Add user configuration to an existing helix property.

Parameters
property the property to update
config the user config

public List<String> getListField (String k)

Get a single List field

Returns
  • String list

public Map<StringList<String>> getListFields ()

Returns an immutable map of list fields

Returns
  • all list fields

public Map<StringString> getMapField (String k)

Get a single Map field

Returns
  • String --> String map

public Map<StringMap<StringString>> getMapFields ()

Returns an immutable map of map fields

Returns
  • all map fields

public String getPrefix ()

Get the prefix used to distinguish these config properties

Returns
  • string prefix, not including the underscore

public Map<StringList<String>> getPrefixedListFields ()

Get all list fields with prefixed keys

Returns
  • prefixed list fields

public Map<StringMap<StringString>> getPrefixedMapFields ()

Get all map fields with prefixed keys

Returns
  • prefixed map fields

public Map<StringString> getPrefixedSimpleFields ()

Get all simple fields with prefixed keys

Returns
  • prefixed simple fields

public String getSimpleField (String k)

Get a single String field

Returns
  • String field

public Map<StringString> getSimpleFields ()

Returns an immutable map of simple fields

Returns
  • Map of simple fields

public void setListField (String k, List<String> v)

Set a single String --> List field

public void setListFields (Map<StringList<String>> listFields)

Set all fields whose values are a list of values

public void setMapField (String k, Map<StringString> v)

Set a single String --> Map field

public void setMapFields (Map<StringMap<StringString>> mapFields)

Set all fields whose values are key, value properties

public void setSimpleField (String k, String v)

Set a simple key, value field

public void setSimpleFields (Map<StringString> simpleFields)

Set all plain key, value fields