public class

ConfigAccessor

extends Object
java.lang.Object
   ↳ org.apache.helix.ConfigAccessor

Class Overview

Provides access to the persistent configuration of the cluster, the instances that live on it, and the logical resources assigned to it.

Summary

Public Constructors
ConfigAccessor(ZkClient zkClient)
Initialize an accessor with a Zookeeper client
Public Methods
Map<StringString> get(HelixConfigScope scope, List<String> keys)
get many config entries
String get(HelixConfigScope scope, String key)
get a single config entry
List<String> getKeys(HelixConfigScope scope)
Get list of config keys for a scope
void remove(HelixConfigScope scope, List<String> keys)
Remove multiple configs
void remove(HelixConfigScope scope, String key)
Remove a single config
void set(HelixConfigScope scope, Map<StringString> keyValueMap)
Set multiple configs, creating them if they don't exist
void set(HelixConfigScope scope, String key, String value)
Set config, creating it if it doesn't exist
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ConfigAccessor (ZkClient zkClient)

Initialize an accessor with a Zookeeper client

Public Methods

public Map<StringString> get (HelixConfigScope scope, List<String> keys)

get many config entries

Parameters
scope scope specification of the entity set to query (e.g. cluster, resource, participant, etc.)
keys the identifiers of the configuration entries
Returns
  • the configuration entries, organized by key

public String get (HelixConfigScope scope, String key)

get a single config entry

Parameters
scope specification of the entity set to query (e.g. cluster, resource, participant, etc.)
key the identifier of the configuration entry
Returns
  • the configuration entry

public List<String> getKeys (HelixConfigScope scope)

Get list of config keys for a scope

Returns
  • a list of configuration keys

public void remove (HelixConfigScope scope, List<String> keys)

Remove multiple configs

Parameters
scope scope specification of the entity set to query (e.g. cluster, resource, participant, etc.)
keys the identifiers of the configuration entries

public void remove (HelixConfigScope scope, String key)

Remove a single config

Parameters
scope scope specification of the entity set to query (e.g. cluster, resource, participant, etc.)
key the identifier of the configuration entry

public void set (HelixConfigScope scope, Map<StringString> keyValueMap)

Set multiple configs, creating them if they don't exist

Parameters
scope scope specification of the entity set to query (e.g. cluster, resource, participant, etc.)
keyValueMap configurations organized by their identifiers

public void set (HelixConfigScope scope, String key, String value)

Set config, creating it if it doesn't exist

Parameters
scope scope specification of the entity set to query (e.g. cluster, resource, participant, etc.)
key the identifier of the configuration entry
value the configuration