From commits-return-6603-archive-asf-public=cust-asf.ponee.io@kudu.apache.org Fri Oct 26 20:57:05 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 3780D1807AC for ; Fri, 26 Oct 2018 20:57:02 +0200 (CEST) Received: (qmail 22197 invoked by uid 500); 26 Oct 2018 18:56:56 -0000 Mailing-List: contact commits-help@kudu.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@kudu.apache.org Delivered-To: mailing list commits@kudu.apache.org Received: (qmail 21975 invoked by uid 99); 26 Oct 2018 18:56:56 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Oct 2018 18:56:56 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 41D2CE11F5; Fri, 26 Oct 2018 18:56:55 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: abukor@apache.org To: commits@kudu.apache.org Date: Fri, 26 Oct 2018 18:57:17 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [24/52] [abbrv] [partial] kudu git commit: Updating web site for Kudu 1.8.0 release http://git-wip-us.apache.org/repos/asf/kudu/blob/1fefa84c/releases/1.8.0/apidocs/org/apache/kudu/client/AsyncKuduClient.html ---------------------------------------------------------------------- diff --git a/releases/1.8.0/apidocs/org/apache/kudu/client/AsyncKuduClient.html b/releases/1.8.0/apidocs/org/apache/kudu/client/AsyncKuduClient.html new file mode 100644 index 0000000..27a6684 --- /dev/null +++ b/releases/1.8.0/apidocs/org/apache/kudu/client/AsyncKuduClient.html @@ -0,0 +1,1137 @@ + + + + + + +AsyncKuduClient (Kudu 1.8.0 API) + + + + + + + + + + + +
+
org.apache.kudu.client
+

Class AsyncKuduClient

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    AutoCloseable
    +
    +
    +
    +
    @InterfaceAudience.Public
    + @InterfaceStability.Unstable
    +public class AsyncKuduClient
    +extends Object
    +implements AutoCloseable
    +
    A fully asynchronous and thread-safe client for Kudu. +

    + A single Kudu client instance corresponds to a single remote Kudu cluster, + and can be used to read or write any number of tables within that cluster. + An application should use exactly one Kudu client instance per distinct Kudu + cluster it connects to. + + In rare cases where a single application needs multiple instances connected + to the same cluster, or when many applications each using one or more Kudu + client instances are running on the same machine, it may be necessary to + adjust the instances to use less resources. See the options in + AsyncKuduClient.AsyncKuduClientBuilder. + +

    Creating a client instance

    An AsyncKuduClient instance may + be created using the AsyncKuduClient.AsyncKuduClientBuilder class. If + a synchronous API is preferred, KuduClient.KuduClientBuilder may be + used instead. See the documentation on these classes for more details on + client configuration options. + +

    Authenticating to a secure cluster

    A Kudu cluster may be configured + such that it requires clients to connect using strong authentication. Clients + can authenticate to such clusters using either of two methods: +
      +
    1. Kerberos credentials
    2. +
    3. Authentication tokens
    4. +
    + + In a typical environment, Kerberos credentials are used for non-distributed + client applications and for applications which spawn distributed + jobs. Tokens are used for the tasks of distributed jobs, since those + tasks do not have access to the user's Kerberos credentials. + +

    Authenticating using Kerberos credentials

    + + In order to integrate with Kerberos, Kudu uses the standard Java + Authentication and Authorization Service (JAAS) API provided by the JDK. + JAAS provides a common way for applications to initialize Kerberos + credentials, store these credentials in a Subject + instance, and associate the Subject the current thread of execution. The Kudu + client then accesses the Kerberos credentials in the + Subject and uses them to authenticate to the + remote cluster as necessary. +

    + Kerberos credentials are typically obtained in one of two ways: +

      +
    1. The Kerberos ticket cache
    2. +
    3. A keytab file
    4. +
    + +

    Authenticating from the Kerberos ticket cache

    + + The Kerberos ticket cache is a file stored on the local file system + which is automatically initialized when a user runs kinit at the + command line. This is the predominant method for authenticating users in + interactive applications: the user is expected to have run kinit + recently, and the application will find the appropriate credentials in the + ticket cache. +

    + In the case of the Kudu client, Kudu will automatically look for credentials + in the standard system-configured ticket cache location. No additional code + needs to be written to enable this behavior. +

    + Kudu will automatically detect if the ticket it has obtained from the ticket + cache is about to expire. When that is the case, it will attempt to re-read + the ticket cache to obtain a new ticket with a later expiration time. So, if + an application needs to run for longer than the lifetime of a single ticket, + the user must ensure that the ticket cache is periodically refreshed, for + example by re-running 'kinit' once each day. + +

    Authenticating from a keytab

    + + Long-running applications typically obtain Kerberos credentials from a + Kerberos keytab file. A keytab is essentially a saved password, and + allows the application to obtain new Kerberos tickets whenever the prior + ticket is about to expire. +

    + The Kudu client does not provide any utility code to facilitate logging in + from a keytab. Instead, applications should invoke the JAAS APIs directly, + and then ensure that the resulting Subject + instance is associated with the current thread's + AccessControlContext when instantiating the Kudu client + instance for the first time. The Subject instance + will be stored and used whenever Kerberos authentication is required. +

    + Note: if the Kudu client is instantiated with a + Subject as described above, it will not + make any attempt to re-login from the keytab. Instead, the application should + arrange to periodically re-initiate the login process and update the + credentials stored in the same Subject instance as was provided when the + client was instantiated. +

    + In the context of the Hadoop ecosystem, the UserGroupInformation + class provides utility methods to login from a keytab and then run code as + the resulting Subject:

    
    +   UserGroupInformation.loginUserFromKeytab("my-app", "/path/to/app.keytab");
    +   KuduClient c = UserGroupInformation.getLoginUser().doAs(
    +     new PrivilegedExceptionAction<KuduClient>() {
    +       &#64;Override
    +       public KuduClient run() throws Exception {
    +         return myClientBuilder.build();
    +       }
    +     }
    +   );
    + 
    The UserGroupInformation class will also automatically + start a thread to periodically re-login from the keytab. + +

    Debugging Kudu's usage of Kerberos credentials

    + + The Kudu client emits DEBUG-level logs under the + org.apache.kudu.client.SecurityContext slf4j category. Enabling DEBUG + logging for this class may help you understand which credentials are being + obtained by the Kudu client when it is instantiated. Additionally, if the + Java system property kudu.jaas.debug is set to true, Kudu + will enable the debug option when configuring Krb5LoginModule + when it attempts to log in from a ticket cache. JDK-specific system properties + such as sun.security.krb5.debug may also be useful in troubleshooting + Kerberos authentication failures. + +

    Authenticating using tokens

    + + In the case of distributed applications, the worker tasks often do not have + access to Kerberos credentials such as ticket caches or keytabs. + Additionally, there may be hundreds or thousands of workers with relatively + short life-times, and if each task attempted to authenticate using Kerberos, + the amount of load on the Kerberos infrastructure could be substantial enough + to cause instability. To solve this issue, Kudu provides support for + authentication tokens. +

    + An authentication token is a time-limited credential which can be obtained by + an application which has already authenticated via Kerberos. The token is + represented by an opaque byte string, and it can be passed from one client to + another to transfer credentials. +

    + A token may be generated using the + exportAuthenticationCredentials() API, and then + imported to another client using + importAuthenticationCredentials(byte[]). + +

    Authentication in Spark jobs

    + + Note that the Spark integration provided by the kudu-spark package + automatically handles the interaction with Kerberos and the passing of tokens + from the Spark driver to tasks. Refer to the Kudu documentation for details + on how to submit a Spark job on a secure cluster. + +

    API Compatibility

    + + Note that some methods in the Kudu client implementation are public but + annotated with the InterfaceAudience.Private annotation. This + annotation indicates that, despite having public visibility, the + method is not part of the public API and there is no guarantee that its + existence or behavior will be maintained in subsequent versions of the Kudu + client library. + + Other APIs are annotated with the InterfaceStability.Unstable annotation. + These APIs are meant for public consumption but may change between minor releases. + Note that the asynchronous client is currently considered unstable. + +

    Thread Safety

    + + The Kudu client instance itself is thread-safe; however, not all associated + classes are themselves thread-safe. For example, neither + AsyncKuduSession nor its synchronous wrapper KuduSession is + thread-safe. Refer to the documentation for each individual class for more + details. + +

    Asynchronous usage

    + + This client is fully non-blocking, any blocking operation will return a + Deferred instance to which you can attach a Callback chain + that will execute when the asynchronous operation completes. +

    + The asynchronous calls themselves typically do not throw exceptions. Instead, + an errback should be attached which will be called with the Exception + that occurred.

    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        LOG

        +
        public static final org.slf4j.Logger LOG
        +
      • +
      + + + + + + + +
        +
      • +

        EMPTY_ARRAY

        +
        public static final byte[] EMPTY_ARRAY
        +
      • +
      + + + + + + + +
        +
      • +

        DEFAULT_OPERATION_TIMEOUT_MS

        +
        public static final long DEFAULT_OPERATION_TIMEOUT_MS
        +
        +
        See Also:
        +
        Constant Field Values
        +
        +
      • +
      + + + +
        +
      • +

        DEFAULT_SOCKET_READ_TIMEOUT_MS

        +
        public static final long DEFAULT_SOCKET_READ_TIMEOUT_MS
        +
        +
        See Also:
        +
        Constant Field Values
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        updateLastPropagatedTimestamp

        +
        public void updateLastPropagatedTimestamp(long lastPropagatedTimestamp)
        +
        Updates the last timestamp received from a server. Used for CLIENT_PROPAGATED + external consistency.
        +
        +
        Parameters:
        +
        lastPropagatedTimestamp - the last timestamp received from a server
        +
        +
      • +
      + + + +
        +
      • +

        getLastPropagatedTimestamp

        +
        public long getLastPropagatedTimestamp()
        +
        Returns the last timestamp received from a server. Used for CLIENT_PROPAGATED + external consistency. Note that the returned timestamp is encoded and cannot be + interpreted as a raw timestamp.
        +
        +
        Returns:
        +
        a long indicating the specially-encoded last timestamp received from a server
        +
        +
      • +
      + + + +
        +
      • +

        hasLastPropagatedTimestamp

        +
        public boolean hasLastPropagatedTimestamp()
        +
        Checks if the client received any timestamps from a server. Used for + CLIENT_PROPAGATED external consistency.
        +
        +
        Returns:
        +
        true if last propagated timestamp has been set
        +
        +
      • +
      + + + +
        +
      • +

        syncClient

        +
        public KuduClient syncClient()
        +
        Returns a synchronous KuduClient which wraps this asynchronous client. + Calling KuduClient.close() on the returned client will close this client. + If this asynchronous client should outlive the returned synchronous client, + then do not close the synchronous client.
        +
        +
        Returns:
        +
        a new synchronous KuduClient
        +
        +
      • +
      + + + +
        +
      • +

        createTable

        +
        public com.stumbleupon.async.Deferred<KuduTable> createTable(String name,
        +                                                             Schema schema,
        +                                                             CreateTableOptions builder)
        +
        Create a table on the cluster with the specified name, schema, and table configurations. + If the primary key columns of the table schema aren't specified first, the deferred result + will be a NonRecoverableException
        +
        +
        Parameters:
        +
        name - the table's name
        +
        schema - the table's schema
        +
        builder - a builder containing the table's configurations
        +
        Returns:
        +
        a deferred object to track the progress of the createTable command that gives + an object to communicate with the created table
        +
        +
      • +
      + + + +
        +
      • +

        isCreateTableDone

        +
        public com.stumbleupon.async.Deferred<IsCreateTableDoneResponse> isCreateTableDone(String name)
        +
        Check whether a previously issued createTable() is done.
        +
        +
        Parameters:
        +
        name - table's name
        +
        Returns:
        +
        a deferred object to track the progress of the isCreateTableDone command
        +
        +
      • +
      + + + +
        +
      • +

        deleteTable

        +
        public com.stumbleupon.async.Deferred<DeleteTableResponse> deleteTable(String name)
        +
        Delete a table on the cluster with the specified name.
        +
        +
        Parameters:
        +
        name - the table's name
        +
        Returns:
        +
        a deferred object to track the progress of the deleteTable command
        +
        +
      • +
      + + + +
        +
      • +

        alterTable

        +
        public com.stumbleupon.async.Deferred<AlterTableResponse> alterTable(String name,
        +                                                                     AlterTableOptions ato)
        +
        Alter a table on the cluster as specified by the builder.
        +
        +
        Parameters:
        +
        name - the table's name (old name if the table is being renamed)
        +
        ato - the alter table options
        +
        Returns:
        +
        a deferred object to track the progress of the alter command
        +
        +
      • +
      + + + +
        +
      • +

        isAlterTableDone

        +
        public com.stumbleupon.async.Deferred<IsAlterTableDoneResponse> isAlterTableDone(String name)
        +
        Check whether a previously issued alterTable() is done.
        +
        +
        Parameters:
        +
        name - table name
        +
        Returns:
        +
        a deferred object to track the progress of the isAlterTableDone command
        +
        +
      • +
      + + + +
        +
      • +

        listTabletServers

        +
        public com.stumbleupon.async.Deferred<ListTabletServersResponse> listTabletServers()
        +
        Get the list of running tablet servers.
        +
        +
        Returns:
        +
        a deferred object that yields a list of tablet servers
        +
        +
      • +
      + + + +
        +
      • +

        getTablesList

        +
        public com.stumbleupon.async.Deferred<ListTablesResponse> getTablesList()
        +
        Get the list of all the tables.
        +
        +
        Returns:
        +
        a deferred object that yields a list of all the tables
        +
        +
      • +
      + + + +
        +
      • +

        getTablesList

        +
        public com.stumbleupon.async.Deferred<ListTablesResponse> getTablesList(String nameFilter)
        +
        Get a list of table names. Passing a null filter returns all the tables. When a filter is + specified, it only returns tables that satisfy a substring match.
        +
        +
        Parameters:
        +
        nameFilter - an optional table name filter
        +
        Returns:
        +
        a deferred that yields the list of table names
        +
        +
      • +
      + + + +
        +
      • +

        tableExists

        +
        public com.stumbleupon.async.Deferred<Boolean> tableExists(String name)
        +
        Test if a table exists.
        +
        +
        Parameters:
        +
        name - a non-null table name
        +
        Returns:
        +
        true if the table exists, else false
        +
        +
      • +
      + + + +
        +
      • +

        openTable

        +
        public com.stumbleupon.async.Deferred<KuduTable> openTable(String name)
        +
        Open the table with the given name. + + New range partitions created by other clients will immediately be available + after opening the table.
        +
        +
        Parameters:
        +
        name - table to open
        +
        Returns:
        +
        a KuduTable if the table exists, else a MasterErrorException
        +
        +
      • +
      + + + +
        +
      • +

        exportAuthenticationCredentials

        +
        @InterfaceStability.Unstable
        +public com.stumbleupon.async.Deferred<byte[]> exportAuthenticationCredentials()
        +
        Export serialized authentication data that may be passed to a different + client instance and imported to provide that client the ability to connect + to the cluster.
        +
      • +
      + + + +
        +
      • +

        importAuthenticationCredentials

        +
        @InterfaceStability.Unstable
        +public void importAuthenticationCredentials(byte[] authnData)
        +
        Import data allowing this client to authenticate to the cluster. + This will typically be used before making any connections to servers + in the cluster. + + Note that, if this client has already been used by one user, this + method cannot be used to switch authenticated users. Attempts to + do so have undefined results, and may throw an exception.
        +
        +
        Parameters:
        +
        authnData - then authentication data provided by a prior call to + exportAuthenticationCredentials()
        +
        +
      • +
      + + + +
        +
      • +

        getDefaultOperationTimeoutMs

        +
        public long getDefaultOperationTimeoutMs()
        +
        Get the timeout used for operations on sessions and scanners.
        +
        +
        Returns:
        +
        a timeout in milliseconds
        +
        +
      • +
      + + + +
        +
      • +

        getDefaultAdminOperationTimeoutMs

        +
        public long getDefaultAdminOperationTimeoutMs()
        +
        Get the timeout used for admin operations.
        +
        +
        Returns:
        +
        a timeout in milliseconds
        +
        +
      • +
      + + + +
        +
      • +

        getDefaultSocketReadTimeoutMs

        +
        public long getDefaultSocketReadTimeoutMs()
        +
        Get the timeout used when waiting to read data from a socket. Will be triggered when nothing + has been read on a socket connected to a tablet server for timeout milliseconds.
        +
        +
        Returns:
        +
        a timeout in milliseconds
        +
        +
      • +
      + + + +
        +
      • +

        getMasterAddressesAsString

        +
        public String getMasterAddressesAsString()
        +
        +
        Returns:
        +
        the list of master addresses, stringified using commas to separate + them
        +
        +
      • +
      + + + +
        +
      • +

        isStatisticsEnabled

        +
        public boolean isStatisticsEnabled()
        +
        Check if statistics collection is enabled for this client.
        +
        +
        Returns:
        +
        true if it is enabled, else false
        +
        +
      • +
      + + + +
        +
      • +

        getStatistics

        +
        public Statistics getStatistics()
        +
        Get the statistics object of this client.
        +
        +
        Returns:
        +
        this client's Statistics object
        +
        Throws:
        +
        IllegalStateException - thrown if statistics collection has been disabled
        +
        +
      • +
      + + + + + + + +
        +
      • +

        newSession

        +
        public AsyncKuduSession newSession()
        +
        Create a new session for interacting with the cluster. + User is responsible for destroying the session object. + This is a fully local operation (no RPCs or blocking).
        +
        +
        Returns:
        +
        a new AsyncKuduSession
        +
        +
      • +
      + + + +
        +
      • +

        close

        +
        public void close()
        +           throws Exception
        +
        Invokes shutdown() and waits. This method returns void, so consider invoking + shutdown() directly if there's a need to handle dangling RPCs.
        +
        +
        Specified by:
        +
        close in interface AutoCloseable
        +
        Throws:
        +
        Exception - if an error happens while closing the connections
        +
        +
      • +
      + + + +
        +
      • +

        shutdown

        +
        public com.stumbleupon.async.Deferred<ArrayList<Void>> shutdown()
        +
        Performs a graceful shutdown of this instance. +

        +

          +
        • Flushes all buffered edits.
        • +
        • Cancels all the other requests.
        • +
        • Terminates all connections.
        • +
        • Releases all other resources.
        • +
        + Not calling this method before losing the last reference to this + instance may result in data loss and other unwanted side effects.
        +
        +
        Returns:
        +
        A Deferred, whose callback chain will be invoked once all + of the above have been done. If this callback chain doesn't fail, then + the clean shutdown will be successful, and all the data will be safe on + the Kudu side. In case of a failure (the "errback" is invoked) you will have + to open a new AsyncKuduClient if you want to retry those operations. + The Deferred doesn't actually hold any content.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018 The Apache Software Foundation. All rights reserved.

+ + http://git-wip-us.apache.org/repos/asf/kudu/blob/1fefa84c/releases/1.8.0/apidocs/org/apache/kudu/client/AsyncKuduScanner.AsyncKuduScannerBuilder.html ---------------------------------------------------------------------- diff --git a/releases/1.8.0/apidocs/org/apache/kudu/client/AsyncKuduScanner.AsyncKuduScannerBuilder.html b/releases/1.8.0/apidocs/org/apache/kudu/client/AsyncKuduScanner.AsyncKuduScannerBuilder.html new file mode 100644 index 0000000..192c03b --- /dev/null +++ b/releases/1.8.0/apidocs/org/apache/kudu/client/AsyncKuduScanner.AsyncKuduScannerBuilder.html @@ -0,0 +1,267 @@ + + + + + + +AsyncKuduScanner.AsyncKuduScannerBuilder (Kudu 1.8.0 API) + + + + + + + + + + + +
+
org.apache.kudu.client
+

Class AsyncKuduScanner.AsyncKuduScannerBuilder

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + + + + +

Copyright © 2018 The Apache Software Foundation. All rights reserved.

+ +