Uploaded image for project: 'Kudu'
  1. Kudu
  2. KUDU-1142

Make the Java clients AutoCloseable

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • Private Beta
    • None
    • api, client

    Description

      Following the principle of least surprise the Java KuduClient (and potentially the KuduAsyncClient) should rename their teardown methods from shutdown to close.

      If my understanding is correct, the shutdown name seems to hint the implementation of the async client with a background thread. However, looking at typical Java patterns typically try / catch / finally client.close() seems to be used.

      In addition, having a non-standard name will lead to running out of file descriptors because the user searched the code completion for close and didn't find it but the client spins up threads and sockets which are not correctly closed .

      Refactoring this should be easy at least in Java

      Attachments

        Activity

          People

            jdcryans Jean-Daniel Cryans
            mgrund Martin Grund
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: