/** * Same as {@link #with(ClientProperty, String)} for ClientProperty.RPC_SSL_TRUSTORE_PATH, * ClientProperty.RPC_SSL_TRUSTORE_PASSWORD, and ClientProperty.RPC_SSL_TRUSTORE_TYPE * */ public ClientConfiguration withTruststore(String path, String password, String type) { checkArgument(path != null, "path is null"); setProperty(ClientProperty.RPC_SSL_TRUSTSTORE_PATH, path); if (password != null) setProperty(ClientProperty.RPC_SSL_TRUSTSTORE_PASSWORD, password); if (type != null) setProperty(ClientProperty.RPC_SSL_TRUSTSTORE_TYPE, type); return this; }
/** * Same as {@link #with(ClientProperty, String)} for ClientProperty.INSTANCE_RPC_SSL_CLIENT_AUTH, * ClientProperty.RPC_SSL_KEYSTORE_PATH, ClientProperty.RPC_SSL_KEYSTORE_PASSWORD, and * ClientProperty.RPC_SSL_KEYSTORE_TYPE * */ public ClientConfiguration withKeystore(String path, String password, String type) { checkArgument(path != null, "path is null"); setProperty(ClientProperty.INSTANCE_RPC_SSL_CLIENT_AUTH, "true"); setProperty(ClientProperty.RPC_SSL_KEYSTORE_PATH, path); if (password != null) setProperty(ClientProperty.RPC_SSL_KEYSTORE_PASSWORD, password); if (type != null) setProperty(ClientProperty.RPC_SSL_KEYSTORE_TYPE, type); return this; }
@SuppressWarnings("deprecation") public static org.apache.accumulo.core.client.ClientConfiguration toClientConf( Properties properties) { org.apache.accumulo.core.client.ClientConfiguration config = org.apache.accumulo.core.client.ClientConfiguration .create(); for (Object keyObj : properties.keySet()) { String propKey = (String) keyObj; String val = properties.getProperty(propKey); String confKey = propsConf.get(propKey); if (confKey == null) { config.setProperty(propKey, val); } else { config.setProperty(confKey, val); } if (propKey.equals(ClientProperty.SSL_KEYSTORE_PATH.getKey())) { config.setProperty( org.apache.accumulo.core.client.ClientConfiguration.ClientProperty.INSTANCE_RPC_SSL_CLIENT_AUTH, "true"); } } return config; }
if (serverPrincipal != null && !serverPrincipal.isEmpty()) { krbName = new KerberosName(serverPrincipal); clientConf.setProperty( org.apache.accumulo.core.client.ClientConfiguration.ClientProperty.KERBEROS_SERVER_PRIMARY, krbName.getServiceName()); key = entry.getKey(); if (clientKeys.contains(key)) { clientConf.setProperty(key, entry.getValue());
/** * Same as {@link #with(ClientProperty, String)} for ClientProperty.RPC_SSL_TRUSTORE_PATH, * ClientProperty.RPC_SSL_TRUSTORE_PASSWORD, and ClientProperty.RPC_SSL_TRUSTORE_TYPE * */ public ClientConfiguration withTruststore(String path, String password, String type) { checkArgument(path != null, "path is null"); setProperty(ClientProperty.RPC_SSL_TRUSTSTORE_PATH, path); if (password != null) setProperty(ClientProperty.RPC_SSL_TRUSTSTORE_PASSWORD, password); if (type != null) setProperty(ClientProperty.RPC_SSL_TRUSTSTORE_TYPE, type); return this; }
/** * Same as {@link #with(ClientProperty, String)} for ClientProperty.INSTANCE_RPC_SSL_CLIENT_AUTH, * ClientProperty.RPC_SSL_KEYSTORE_PATH, ClientProperty.RPC_SSL_KEYSTORE_PASSWORD, and * ClientProperty.RPC_SSL_KEYSTORE_TYPE * */ public ClientConfiguration withKeystore(String path, String password, String type) { checkArgument(path != null, "path is null"); setProperty(ClientProperty.INSTANCE_RPC_SSL_CLIENT_AUTH, "true"); setProperty(ClientProperty.RPC_SSL_KEYSTORE_PATH, path); if (password != null) setProperty(ClientProperty.RPC_SSL_KEYSTORE_PASSWORD, password); if (type != null) setProperty(ClientProperty.RPC_SSL_KEYSTORE_TYPE, type); return this; }
: ClientConfiguration.fromFile(new File(getClientConfigFile())); if (useSsl()) { clientConfig.setProperty(ClientProperty.INSTANCE_RPC_SSL_ENABLED, "true"); clientConfig.setProperty(ClientProperty.INSTANCE_RPC_SASL_ENABLED, "true"); String instanceName = zkOpts.get(0); String hosts = zkOpts.get(1); clientConfig.setProperty(ClientProperty.INSTANCE_ZK_HOST, hosts); clientConfig.setProperty(ClientProperty.INSTANCE_NAME, instanceName); clientConfig.setProperty(ClientProperty.INSTANCE_ZK_HOST, zooKeeperHosts); clientConfig.setProperty(ClientProperty.INSTANCE_NAME, zooKeeperInstanceName);
@SuppressWarnings("unchecked") public ClientConfiguration getClientConfiguration() { ClientConfiguration config = ClientConfiguration.create() .withInstance(this.getAccumuloInstanceName()) .withZkHosts(this.getZookeeperServers()); for (Map.Entry<String, String> entry : getClientConfigurationProperties().entrySet()) { config.setProperty(entry.getKey(), entry.getValue()); } return config; }
@SuppressWarnings("unchecked") public ClientConfiguration getClientConfiguration() { ClientConfiguration config = ClientConfiguration.create() .withInstance(this.getAccumuloInstanceName()) .withZkHosts(this.getZookeeperServers()); for (Map.Entry<String, String> entry : getClientConfigurationProperties().entrySet()) { config.setProperty(entry.getKey(), entry.getValue()); } return config; }
clientConfig.setProperty(ClientProperty.INSTANCE_RPC_SSL_ENABLED, "true"); clientConfig.setProperty(ClientProperty.INSTANCE_RPC_SASL_ENABLED, "true"); String instanceIDFromFile = ZooUtil.getInstanceIDFromHdfs(instanceDir, config); if (config.getBoolean(Property.INSTANCE_RPC_SSL_ENABLED)) clientConfig.setProperty(ClientProperty.INSTANCE_RPC_SSL_ENABLED, "true"); return cachedClientConfig = clientConfig.withInstance(UUID.fromString(instanceIDFromFile)) .withZkHosts(zookeepers);
clientConf.setProperty(ClientProperty.KERBEROS_SERVER_PRIMARY, shortName);
clientConf.setProperty(prop, clusterClientConf.get(prop.getKey()));