Example usage for org.apache.hadoop.conf Configuration setTimeDuration

List of usage examples for org.apache.hadoop.conf Configuration setTimeDuration

Introduction

In this page you can find the example usage for org.apache.hadoop.conf Configuration setTimeDuration.

Prototype

public void setTimeDuration(String name, long value, TimeUnit unit) 

Source Link

Document

Set the value of name to the given time duration.

Usage

From source file:org.apache.hive.jdbc.TestActivePassiveHA.java

License:Apache License

private static void setHAConfigs(Configuration conf) {
    conf.setBoolean(ConfVars.HIVE_SERVER2_SUPPORT_DYNAMIC_SERVICE_DISCOVERY.varname, true);
    conf.set(ConfVars.HIVE_ZOOKEEPER_QUORUM.varname, zkServer.getConnectString());
    conf.setBoolean(ConfVars.HIVE_SERVER2_ACTIVE_PASSIVE_HA_ENABLE.varname, true);
    conf.set(ConfVars.HIVE_SERVER2_ACTIVE_PASSIVE_HA_REGISTRY_NAMESPACE.varname, zkHANamespace);
    conf.setTimeDuration(ConfVars.HIVE_ZOOKEEPER_CONNECTION_TIMEOUT.varname, 2, TimeUnit.SECONDS);
    conf.setTimeDuration(ConfVars.HIVE_ZOOKEEPER_CONNECTION_BASESLEEPTIME.varname, 100, TimeUnit.MILLISECONDS);
    conf.setInt(ConfVars.HIVE_ZOOKEEPER_CONNECTION_MAX_RETRIES.varname, 1);
}