/** * Same as {@link #with(ClientProperty, String)} for ClientProperty.INSTANCE_RPC_SASL_ENABLED and * ClientProperty.GENERAL_KERBEROS_PRINCIPAL. * * @param saslEnabled * Should SASL(kerberos) be enabled * @param kerberosServerPrimary * The 'primary' component of the Kerberos principal Accumulo servers use to login (e.g. * 'accumulo' in 'accumulo/_HOST@REALM') * @since 1.7.0 */ public ClientConfiguration withSasl(boolean saslEnabled, String kerberosServerPrimary) { return withSasl(saslEnabled).with(ClientProperty.KERBEROS_SERVER_PRIMARY, kerberosServerPrimary); }
/** * Same as {@link #with(ClientProperty, String)} for ClientProperty.INSTANCE_RPC_SASL_ENABLED and * ClientProperty.GENERAL_KERBEROS_PRINCIPAL. * * @param saslEnabled * Should SASL(kerberos) be enabled * @param kerberosServerPrimary * The 'primary' component of the Kerberos principal Accumulo servers use to login (e.g. * 'accumulo' in 'accumulo/_HOST@REALM') * @since 1.7.0 */ public ClientConfiguration withSasl(boolean saslEnabled, String kerberosServerPrimary) { return withSasl(saslEnabled).with(ClientProperty.KERBEROS_SERVER_PRIMARY, kerberosServerPrimary); }
/** * Construct a <code>ClientConfiguration</code> instance. * * @param zookeepers * ZooKeeper hosts * @param instanceName * Instance name * @param useSasl * Is SASL enabled * @return A ClientConfiguration instance */ public ClientConfiguration getClientConfiguration(String zookeepers, String instanceName, boolean useSasl) { return ClientConfiguration.loadDefault().withInstance(instanceName).withZkHosts(zookeepers).withSasl(useSasl); }
public Instance getInstance() { String instanceName = getAccumuloInstanceName(); // Fail with a good message if (null == instanceName) { throw new IllegalArgumentException("Accumulo instance name must be provided in hiveconf using " + INSTANCE_NAME); } if (useMockInstance()) { return new MockInstance(instanceName); } String zookeepers = getZooKeepers(); // Fail with a good message if (null == zookeepers) { throw new IllegalArgumentException("ZooKeeper quorum string must be provided in hiveconf using " + ZOOKEEPERS); } ClientConfiguration clientConf = ClientConfiguration.loadDefault().withInstance(instanceName).withZkHosts(zookeepers).withSasl(useSasl()); return new ZooKeeperInstance(clientConf); }