Example usage for org.apache.hadoop.security SecurityUtil HOSTNAME_PATTERN

List of usage examples for org.apache.hadoop.security SecurityUtil HOSTNAME_PATTERN

Introduction

In this page you can find the example usage for org.apache.hadoop.security SecurityUtil HOSTNAME_PATTERN.

Prototype

String HOSTNAME_PATTERN

To view the source code for org.apache.hadoop.security SecurityUtil HOSTNAME_PATTERN.

Click Source Link

Usage

From source file:org.apache.sentry.hdfs.ha.HdfsHAClientInvocationHandler.java

License:Apache License

private void checkClientConf() {
    if (conf.getBoolean(ServerConfig.SENTRY_HA_ZOOKEEPER_SECURITY,
            ServerConfig.SENTRY_HA_ZOOKEEPER_SECURITY_DEFAULT)) {
        String serverPrincipal = Preconditions.checkNotNull(conf.get(ServerConfig.PRINCIPAL),
                ServerConfig.PRINCIPAL + " is required");
        Preconditions.checkArgument(serverPrincipal.contains(SecurityUtil.HOSTNAME_PATTERN),
                ServerConfig.PRINCIPAL + " : " + serverPrincipal + " should contain "
                        + SecurityUtil.HOSTNAME_PATTERN);
    }//from w  w w. j a  va  2 s  .c  om
}