org.apache.hadoop.hbase.util
Class ConfigurationUtil

java.lang.Object
  extended by org.apache.hadoop.hbase.util.ConfigurationUtil

@InterfaceAudience.Public
@InterfaceStability.Evolving
public final class ConfigurationUtil
extends Object

Utilities for storing more complex collection types in Configuration instances.


Field Summary
static char KVP_DELIMITER
           
 
Method Summary
static List<Map.Entry<String,String>> getKeyValues(org.apache.hadoop.conf.Configuration conf, String key)
          Retrieve a list of key value pairs from configuration, stored under the provided key
static List<Map.Entry<String,String>> getKeyValues(org.apache.hadoop.conf.Configuration conf, String key, char delimiter)
          Retrieve a list of key value pairs from configuration, stored under the provided key
static void setKeyValues(org.apache.hadoop.conf.Configuration conf, String key, Collection<Map.Entry<String,String>> keyValues)
          Store a collection of Map.Entry's in conf, with each entry separated by ',' and key values delimited by KVP_DELIMITER
static void setKeyValues(org.apache.hadoop.conf.Configuration conf, String key, Collection<Map.Entry<String,String>> keyValues, char delimiter)
          Store a collection of Map.Entry's in conf, with each entry separated by ',' and key values delimited by delimiter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KVP_DELIMITER

public static final char KVP_DELIMITER
See Also:
Constant Field Values
Method Detail

setKeyValues

public static void setKeyValues(org.apache.hadoop.conf.Configuration conf,
                                String key,
                                Collection<Map.Entry<String,String>> keyValues)
Store a collection of Map.Entry's in conf, with each entry separated by ',' and key values delimited by KVP_DELIMITER

Parameters:
conf - configuration to store the collection in
key - overall key to store keyValues under
keyValues - kvps to be stored under key in conf

setKeyValues

public static void setKeyValues(org.apache.hadoop.conf.Configuration conf,
                                String key,
                                Collection<Map.Entry<String,String>> keyValues,
                                char delimiter)
Store a collection of Map.Entry's in conf, with each entry separated by ',' and key values delimited by delimiter.

Parameters:
conf - configuration to store the collection in
key - overall key to store keyValues under
keyValues - kvps to be stored under key in conf
delimiter - character used to separate each kvp

getKeyValues

public static List<Map.Entry<String,String>> getKeyValues(org.apache.hadoop.conf.Configuration conf,
                                                          String key)
Retrieve a list of key value pairs from configuration, stored under the provided key

Parameters:
conf - configuration to retrieve kvps from
key - key under which the key values are stored
Returns:
the list of kvps stored under key in conf, or null if the key isn't present.
See Also:
setKeyValues(Configuration, String, Collection, char)

getKeyValues

public static List<Map.Entry<String,String>> getKeyValues(org.apache.hadoop.conf.Configuration conf,
                                                          String key,
                                                          char delimiter)
Retrieve a list of key value pairs from configuration, stored under the provided key

Parameters:
conf - configuration to retrieve kvps from
key - key under which the key values are stored
delimiter - character used to separate each kvp
Returns:
the list of kvps stored under key in conf, or null if the key isn't present.
See Also:
setKeyValues(Configuration, String, Collection, char)


Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.