Class ClientContext.ClientBuilderImpl<T>
- java.lang.Object
-
- org.apache.accumulo.core.clientImpl.ClientContext.ClientBuilderImpl<T>
-
- All Implemented Interfaces:
AccumuloClient.AuthenticationArgs<T>
,AccumuloClient.ClientFactory<T>
,AccumuloClient.ConnectionOptions<T>
,AccumuloClient.FromOptions<T>
,AccumuloClient.InstanceArgs<T>
,AccumuloClient.PropertyOptions<T>
,AccumuloClient.SaslOptions<T>
,AccumuloClient.SslOptions<T>
- Enclosing class:
- ClientContext
public static class ClientContext.ClientBuilderImpl<T> extends Object implements AccumuloClient.InstanceArgs<T>, AccumuloClient.PropertyOptions<T>, AccumuloClient.AuthenticationArgs<T>, AccumuloClient.ConnectionOptions<T>, AccumuloClient.SslOptions<T>, AccumuloClient.SaslOptions<T>, AccumuloClient.ClientFactory<T>, AccumuloClient.FromOptions<T>
-
-
Constructor Summary
Constructors Constructor Description ClientBuilderImpl(Function<ClientContext.ClientBuilderImpl<T>,T> builderFunction)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AccumuloClient.ConnectionOptions<T>
as(CharSequence username, CharSequence password)
Build using password-based credentialsAccumuloClient.ConnectionOptions<T>
as(CharSequence principal, Path keyTabFile)
Build using Kerberos credentialsAccumuloClient.ConnectionOptions<T>
as(CharSequence principal, AuthenticationToken token)
Build using specified credentialsAccumuloClient.ConnectionOptions<T>
batchScannerQueryThreads(int numQueryThreads)
Build with default number of query threads for BatchScannerAccumuloClient.ConnectionOptions<T>
batchWriterConfig(BatchWriterConfig batchWriterConfig)
Build with BatchWriterConfig defaults for BatchWriter, MultiTableBatchWriter & BatchDeleterT
build()
Builds AccumuloClient or client Propertiesstatic AccumuloClient
buildClient(ClientContext.ClientBuilderImpl<AccumuloClient> cbi)
static Properties
buildProps(ClientContext.ClientBuilderImpl<Properties> cbi)
AccumuloClient.FromOptions<T>
from(String propertiesFilePath)
Build using properties file.AccumuloClient.FromOptions<T>
from(URL propertiesURL)
Build using Java properties object.AccumuloClient.FromOptions<T>
from(Path propertiesFile)
Build using properties file.AccumuloClient.FromOptions<T>
from(Properties properties)
Build using Java properties object.AccumuloClient.SslOptions<T>
keystore(CharSequence path)
Build with SSL key storeAccumuloClient.SslOptions<T>
keystore(CharSequence path, CharSequence password, CharSequence type)
Build with SSL key storeAccumuloClient.SaslOptions<T>
primary(CharSequence kerberosServerPrimary)
Build with Kerberos Server PrimaryAccumuloClient.SaslOptions<T>
qop(CharSequence qualityOfProtection)
Build with SASL quality of protectionAccumuloClient.ConnectionOptions<T>
scannerBatchSize(int batchSize)
Build with default batch size for Scannervoid
setProperty(ClientProperty property, CharSequence value)
void
setProperty(ClientProperty property, Integer value)
void
setProperty(ClientProperty property, Long value)
AccumuloClient.AuthenticationArgs<T>
to(CharSequence instanceName, CharSequence zookeepers)
AccumuloClient.SslOptions<T>
truststore(CharSequence path)
Build with SSL trust storeAccumuloClient.SslOptions<T>
truststore(CharSequence path, CharSequence password, CharSequence type)
Build with SSL trust storeAccumuloClient.SslOptions<T>
useJsse()
Use JSSE system properties to configure SSLAccumuloClient.SaslOptions<T>
useSasl()
Build with SASL optionsAccumuloClient.SslOptions<T>
useSsl()
Build with SSL/TLS optionsAccumuloClient.ClientFactory<T>
withUncaughtExceptionHandler(Thread.UncaughtExceptionHandler ueh)
Override default handling of uncaught exceptions in client threadsAccumuloClient.ConnectionOptions<T>
zkTimeout(int timeout)
Build using Zookeeper timeout
-
-
-
Constructor Detail
-
ClientBuilderImpl
public ClientBuilderImpl(Function<ClientContext.ClientBuilderImpl<T>,T> builderFunction)
-
-
Method Detail
-
build
public T build()
Description copied from interface:AccumuloClient.ClientFactory
Builds AccumuloClient or client Properties- Specified by:
build
in interfaceAccumuloClient.ClientFactory<T>
- Returns:
- AccumuloClient or Properties
-
buildClient
public static AccumuloClient buildClient(ClientContext.ClientBuilderImpl<AccumuloClient> cbi)
-
buildProps
public static Properties buildProps(ClientContext.ClientBuilderImpl<Properties> cbi)
-
to
public AccumuloClient.AuthenticationArgs<T> to(CharSequence instanceName, CharSequence zookeepers)
- Specified by:
to
in interfaceAccumuloClient.InstanceArgs<T>
-
truststore
public AccumuloClient.SslOptions<T> truststore(CharSequence path)
Description copied from interface:AccumuloClient.SslOptions
Build with SSL trust store- Specified by:
truststore
in interfaceAccumuloClient.SslOptions<T>
- Parameters:
path
- Path to trust store- Returns:
- this builder
-
truststore
public AccumuloClient.SslOptions<T> truststore(CharSequence path, CharSequence password, CharSequence type)
Description copied from interface:AccumuloClient.SslOptions
Build with SSL trust store- Specified by:
truststore
in interfaceAccumuloClient.SslOptions<T>
- Parameters:
path
- Path to trust storepassword
- Password used to encrypt trust storetype
- Trust store type- Returns:
- this builder
-
keystore
public AccumuloClient.SslOptions<T> keystore(CharSequence path)
Description copied from interface:AccumuloClient.SslOptions
Build with SSL key store- Specified by:
keystore
in interfaceAccumuloClient.SslOptions<T>
- Parameters:
path
- Path to SSL key store- Returns:
- this builder
-
keystore
public AccumuloClient.SslOptions<T> keystore(CharSequence path, CharSequence password, CharSequence type)
Description copied from interface:AccumuloClient.SslOptions
Build with SSL key store- Specified by:
keystore
in interfaceAccumuloClient.SslOptions<T>
- Parameters:
path
- Path to keystorepassword
- Password used to encrypt key storetype
- Key store type- Returns:
- this builder
-
useJsse
public AccumuloClient.SslOptions<T> useJsse()
Description copied from interface:AccumuloClient.SslOptions
Use JSSE system properties to configure SSL- Specified by:
useJsse
in interfaceAccumuloClient.SslOptions<T>
- Returns:
- this builder
-
zkTimeout
public AccumuloClient.ConnectionOptions<T> zkTimeout(int timeout)
Description copied from interface:AccumuloClient.ConnectionOptions
Build using Zookeeper timeout- Specified by:
zkTimeout
in interfaceAccumuloClient.ConnectionOptions<T>
- Parameters:
timeout
- Zookeeper timeout (in milliseconds)- Returns:
- this builder
-
useSsl
public AccumuloClient.SslOptions<T> useSsl()
Description copied from interface:AccumuloClient.ConnectionOptions
Build with SSL/TLS options- Specified by:
useSsl
in interfaceAccumuloClient.ConnectionOptions<T>
- Returns:
- this builder
-
useSasl
public AccumuloClient.SaslOptions<T> useSasl()
Description copied from interface:AccumuloClient.ConnectionOptions
Build with SASL options- Specified by:
useSasl
in interfaceAccumuloClient.ConnectionOptions<T>
- Returns:
- this builder
-
batchWriterConfig
public AccumuloClient.ConnectionOptions<T> batchWriterConfig(BatchWriterConfig batchWriterConfig)
Description copied from interface:AccumuloClient.ConnectionOptions
Build with BatchWriterConfig defaults for BatchWriter, MultiTableBatchWriter & BatchDeleter- Specified by:
batchWriterConfig
in interfaceAccumuloClient.ConnectionOptions<T>
- Parameters:
batchWriterConfig
- BatchWriterConfig- Returns:
- this builder
-
batchScannerQueryThreads
public AccumuloClient.ConnectionOptions<T> batchScannerQueryThreads(int numQueryThreads)
Description copied from interface:AccumuloClient.ConnectionOptions
Build with default number of query threads for BatchScanner- Specified by:
batchScannerQueryThreads
in interfaceAccumuloClient.ConnectionOptions<T>
-
scannerBatchSize
public AccumuloClient.ConnectionOptions<T> scannerBatchSize(int batchSize)
Description copied from interface:AccumuloClient.ConnectionOptions
Build with default batch size for Scanner- Specified by:
scannerBatchSize
in interfaceAccumuloClient.ConnectionOptions<T>
-
primary
public AccumuloClient.SaslOptions<T> primary(CharSequence kerberosServerPrimary)
Description copied from interface:AccumuloClient.SaslOptions
Build with Kerberos Server Primary- Specified by:
primary
in interfaceAccumuloClient.SaslOptions<T>
- Parameters:
kerberosServerPrimary
- Kerberos server primary- Returns:
- this builder
-
qop
public AccumuloClient.SaslOptions<T> qop(CharSequence qualityOfProtection)
Description copied from interface:AccumuloClient.SaslOptions
Build with SASL quality of protection- Specified by:
qop
in interfaceAccumuloClient.SaslOptions<T>
- Parameters:
qualityOfProtection
- Quality of protection- Returns:
- this builder
-
from
public AccumuloClient.FromOptions<T> from(String propertiesFilePath)
Description copied from interface:AccumuloClient.PropertyOptions
Build using properties file. An example properties file can be found at conf/accumulo-client.properties in the Accumulo tarball distribution.- Specified by:
from
in interfaceAccumuloClient.PropertyOptions<T>
- Parameters:
propertiesFilePath
- Path to properties file- Returns:
- this builder
- See Also:
- Client properties documentation
-
from
public AccumuloClient.FromOptions<T> from(Path propertiesFile)
Description copied from interface:AccumuloClient.PropertyOptions
Build using properties file. An example properties file can be found at conf/accumulo-client.properties in the Accumulo tarball distribution.- Specified by:
from
in interfaceAccumuloClient.PropertyOptions<T>
- Parameters:
propertiesFile
- Path to properties file- Returns:
- this builder
- See Also:
- Client properties documentation
-
from
public AccumuloClient.FromOptions<T> from(URL propertiesURL)
Description copied from interface:AccumuloClient.PropertyOptions
Build using Java properties object. An example properties file can be found at conf/accumulo-client.properties in the Accumulo tarball distribution.- Specified by:
from
in interfaceAccumuloClient.PropertyOptions<T>
- Parameters:
propertiesURL
- URL path to properties file- Returns:
- this builder
- See Also:
- Client properties documentation
-
from
public AccumuloClient.FromOptions<T> from(Properties properties)
Description copied from interface:AccumuloClient.PropertyOptions
Build using Java properties object. An example properties file can be found at conf/accumulo-client.properties in the Accumulo tarball distribution.- Specified by:
from
in interfaceAccumuloClient.PropertyOptions<T>
- Parameters:
properties
- Properties object- Returns:
- this builder
- See Also:
- Client properties documentation
-
as
public AccumuloClient.ConnectionOptions<T> as(CharSequence username, CharSequence password)
Description copied from interface:AccumuloClient.AuthenticationArgs
Build using password-based credentials- Specified by:
as
in interfaceAccumuloClient.AuthenticationArgs<T>
- Parameters:
username
- User namepassword
- Password- Returns:
- this builder
-
as
public AccumuloClient.ConnectionOptions<T> as(CharSequence principal, Path keyTabFile)
Description copied from interface:AccumuloClient.AuthenticationArgs
Build using Kerberos credentials- Specified by:
as
in interfaceAccumuloClient.AuthenticationArgs<T>
- Parameters:
principal
- PrincipalkeyTabFile
- Path to keytab file- Returns:
- this builder
-
as
public AccumuloClient.ConnectionOptions<T> as(CharSequence principal, AuthenticationToken token)
Description copied from interface:AccumuloClient.AuthenticationArgs
Build using specified credentials- Specified by:
as
in interfaceAccumuloClient.AuthenticationArgs<T>
- Parameters:
principal
- Principal/usernametoken
- Authentication token- Returns:
- this builder
-
setProperty
public void setProperty(ClientProperty property, CharSequence value)
-
setProperty
public void setProperty(ClientProperty property, Long value)
-
setProperty
public void setProperty(ClientProperty property, Integer value)
-
withUncaughtExceptionHandler
public AccumuloClient.ClientFactory<T> withUncaughtExceptionHandler(Thread.UncaughtExceptionHandler ueh)
Description copied from interface:AccumuloClient.ClientFactory
Override default handling of uncaught exceptions in client threads- Specified by:
withUncaughtExceptionHandler
in interfaceAccumuloClient.ClientFactory<T>
- Parameters:
ueh
- UncaughtExceptionHandler implementation- Returns:
- AccumuloClient or Properties
-
-