Class ClientContext


  • public class ClientContext
    extends Object
    This class represents any essential configuration and credentials needed to initiate RPC operations throughout the code. It is intended to represent a shared object that contains these things from when the client was first constructed. It is not public API, and is only an internal representation of the context in which a client is executing RPCs. If additional parameters are added to the public API that need to be used in the internals of Accumulo, they should be added to this object for later retrieval, rather than as a separate parameter. Any state in this object should be available at the time of its construction.
    • Method Detail

      • getInstance

        public Instance getInstance()
        Retrieve the instance used to construct this context
      • getCredentials

        public Credentials getCredentials()
        Retrieve the credentials used to construct this context
      • setCredentials

        public void setCredentials​(Credentials newCredentials)
        Update the credentials in the current context after changing the current user's password or other auth token
      • getConfiguration

        public AccumuloConfiguration getConfiguration()
        Retrieve the configuration used to construct this context
      • getClientTimeoutInMillis

        public long getClientTimeoutInMillis()
        Retrieve the universal RPC client timeout from the configuration
      • getClientSslParams

        public SslConnectionParams getClientSslParams()
        Retrieve SSL/TLS configuration to initiate an RPC connection to a server
      • getSaslParams

        public SaslConnectionParams getSaslParams()
        Retrieve SASL configuration to initiate an RPC connection to a server
      • rpcCreds

        public TCredentials rpcCreds()
        Serialize the credentials just before initiating the RPC call
      • convertClientConfig

        public static AccumuloConfiguration convertClientConfig​(org.apache.commons.configuration.Configuration config)
        A utility method for converting client configuration to a standard configuration object for use internally.
        Parameters:
        config - the original ClientConfiguration
        Returns:
        the client configuration presented in the form of an AccumuloConfiguration