public class HAUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
addKeySuffixes(String key,
String... suffixes)
Return configuration key of format key.suffix1.suffix2...suffixN
|
static org.apache.hadoop.io.Text |
buildTokenServiceForLogicalAddress(String haJtAddress)
Get the service name used in the delegation token for the given logical
HA service.
|
static void |
cloneDelegationTokenForLogicalAddress(org.apache.hadoop.security.UserGroupInformation ugi,
String haJtAddress,
Collection<InetSocketAddress> jtAddresses) |
static Map<String,InetSocketAddress> |
getHaJtRpcAddresses(org.apache.hadoop.conf.Configuration conf) |
static String |
getJobTrackerId(org.apache.hadoop.conf.Configuration conf)
Get the jobtracker Id by matching the
addressKey
with the the address of the local node. |
static String |
getJobTrackerIdOfOtherNode(org.apache.hadoop.conf.Configuration conf)
Get the jobtracker Id of the other node in an HA setup.
|
static String |
getJtHaHttpRedirectAddress(org.apache.hadoop.conf.Configuration conf,
String jtId) |
static InetSocketAddress |
getJtHaRpcAddress(org.apache.hadoop.conf.Configuration conf) |
static InetSocketAddress |
getJtHaRpcAddress(org.apache.hadoop.conf.Configuration conf,
String jtId) |
static String |
getLogicalName(org.apache.hadoop.conf.Configuration conf) |
static String |
getLogicalName(String jtAddress) |
static String |
getServiceAddressFromToken(org.apache.hadoop.security.token.Token<?> token) |
static boolean |
isHAEnabled()
Returns true if jobtracker HA is configured.
|
static boolean |
isHAEnabled(org.apache.hadoop.conf.Configuration conf,
String jtAddress)
Returns true if jobtracker HA is configured.
|
static boolean |
isTokenForLogicalAddress(org.apache.hadoop.security.token.Token<?> token) |
static void |
setGenericConf(org.apache.hadoop.conf.Configuration conf,
String logicalName,
String jtId,
String... keys) |
static void |
setJtHaRpcAddress(org.apache.hadoop.conf.Configuration conf,
String address) |
static void |
setJtRpcAddress(org.apache.hadoop.conf.Configuration conf)
Set the JT address from the RPC address so that the wrapped JobTracker
starts on the correct address.
|
public static final String MR_JOBTRACKER_ADDRESS_KEY
public static final String MR_JOBTRACKER_RPC_ADDRESS_KEY
public static final String MR_JOBTRACKER_HTTP_ADDRESS_KEY
public static final String MR_JOBTRACKER_OLD_HTTP_ADDRESS_KEY
public static final String MR_JOBTRACKER_OLD_HTTP_PORT_KEY
public static final String MR_HA_JOBTRACKERS_KEY_PREFIX
public static final String MR_HA_JOBTRACKER_RPC_ADDRESS_KEY
public static final String MR_HA_JOBTRACKER_HTTP_REDIRECT_ADDRESS_KEY
public static final String MR_HA_JOBTRACKER_ID_KEY
public static final String MR_HA_FENCING_METHODS_KEY
public static final String MR_HA_AUTO_FAILOVER_ENABLED_KEY
public static final boolean MR_HA_AUTO_FAILOVER_ENABLED_DEFAULT
public static final String MR_HA_ZKFC_PORT_KEY
public static final int MR_HA_ZKFC_PORT_DEFAULT
public static final String MR_HA_ACTIVE_CHECK_MILLIS
public static final int MR_HA_ACTIVE_CHECK_MILLIS_DEFAULT
public static final String MR_CLIENT_FAILOVER_PROXY_PROVIDER_KEY_PREFIX
public static final String MR_CLIENT_FAILOVER_MAX_ATTEMPTS_KEY
public static final int MR_CLIENT_FAILOVER_MAX_ATTEMPTS_DEFAULT
public static final String MR_CLIENT_FAILOVER_SLEEPTIME_BASE_KEY
public static final int MR_CLIENT_FAILOVER_SLEEPTIME_BASE_DEFAULT
public static final String MR_CLIENT_FAILOVER_SLEEPTIME_MAX_KEY
public static final int MR_CLIENT_FAILOVER_SLEEPTIME_MAX_DEFAULT
public static final String MR_CLIENT_FAILOVER_CONNECTION_RETRIES_KEY
public static final int MR_CLIENT_FAILOVER_CONNECTION_RETRIES_DEFAULT
public static final String MR_CLIENT_FAILOVER_CONNECTION_RETRIES_ON_SOCKET_TIMEOUTS_KEY
public static final int MR_CLIENT_FAILOVER_CONNECTION_RETRIES_ON_SOCKET_TIMEOUTS_DEFAULT
public static final String[] JOB_TRACKER_SPECIFIC_KEYS
public static final String HA_DT_SERVICE_PREFIX
public static boolean isHAEnabled()
public static boolean isHAEnabled(org.apache.hadoop.conf.Configuration conf,
String jtAddress)
conf - ConfigurationjtAddress - the (logical) jobtracker addresspublic static String getLogicalName(org.apache.hadoop.conf.Configuration conf)
public static String getJobTrackerId(org.apache.hadoop.conf.Configuration conf)
addressKey
with the the address of the local node.
If MR_HA_JOBTRACKER_ID_KEY is not specifically
configured, this method determines the jobtracker Id by matching the local
node's address with the configured addresses. When a match is found, it
returns the JT Id from the corresponding configuration key.conf - Configurationorg.apache.hadoop.HadoopIllegalArgumentException - on errorpublic static String getJobTrackerIdOfOtherNode(org.apache.hadoop.conf.Configuration conf)
MR_HA_JOBTRACKER_ID_KEY is not specifically
configured, this method determines the jobtracker Id by matching the local
node's address with the configured addresses. When a match is found, it
returns the JT Id from the corresponding configuration key.conf - Configurationorg.apache.hadoop.HadoopIllegalArgumentException - on errorpublic static Map<String,InetSocketAddress> getHaJtRpcAddresses(org.apache.hadoop.conf.Configuration conf)
public static InetSocketAddress getJtHaRpcAddress(org.apache.hadoop.conf.Configuration conf)
public static void setJtHaRpcAddress(org.apache.hadoop.conf.Configuration conf,
String address)
public static InetSocketAddress getJtHaRpcAddress(org.apache.hadoop.conf.Configuration conf, String jtId)
public static void setJtRpcAddress(org.apache.hadoop.conf.Configuration conf)
public static String getJtHaHttpRedirectAddress(org.apache.hadoop.conf.Configuration conf, String jtId)
public static String addKeySuffixes(String key, String... suffixes)
public static void setGenericConf(org.apache.hadoop.conf.Configuration conf,
String logicalName,
String jtId,
String... keys)
public static org.apache.hadoop.io.Text buildTokenServiceForLogicalAddress(String haJtAddress)
haJtAddress - the logical URI of the clusterpublic static boolean isTokenForLogicalAddress(org.apache.hadoop.security.token.Token<?> token)
public static String getServiceAddressFromToken(org.apache.hadoop.security.token.Token<?> token)
public static void cloneDelegationTokenForLogicalAddress(org.apache.hadoop.security.UserGroupInformation ugi,
String haJtAddress,
Collection<InetSocketAddress> jtAddresses)
Copyright © 2009 The Apache Software Foundation