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

Make the Java clients AutoCloseable

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: Private Beta
    • Fix Version/s: None
    • Component/s: api, client
    • Labels:

      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

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

              Dates

              • Due:
                Created:
                Updated:
                Resolved: