Uploaded image for project: 'Couchbase Java Client'
  1. Couchbase Java Client
  2. JCBC-86

Remove getHashAlgorithm and verify correct behavior of client

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.1-beta
    • Component/s: None
    • Security Level: Public
    • Labels:
      None

      Description

      Current CacheConfig class has a getHashAlgorithm method and it seems to define native hash. Since there don't seem to be any uses of this, it should be removed or somehow refactored out.

      No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

        Hide
        daschl Michael Nitschinger added a comment -

        Investigations show that the getHashAlgorithm() is defined by the Cache interface, but actually never used throughout the codebase.

        michael@daschlbook ~/couchbase/couchbase-java-client $ grep -r 'getHashAlgorithm()' src/*
        src/main/java/com/couchbase/client/vbucket/config/CacheConfig.java: public HashAlgorithm getHashAlgorithm() {
        src/main/java/com/couchbase/client/vbucket/config/Config.java: HashAlgorithm getHashAlgorithm();
        src/main/java/com/couchbase/client/vbucket/config/DefaultConfig.java: public HashAlgorithm getHashAlgorithm() {

        Also, the CacheConfig never makes use of its defined hashAlgorithm. Therefore we, can either remove it from the interface alltogether (the getter), or just throw an unsupported method from the config?

        Show
        daschl Michael Nitschinger added a comment - Investigations show that the getHashAlgorithm() is defined by the Cache interface, but actually never used throughout the codebase. michael@daschlbook ~/couchbase/couchbase-java-client $ grep -r 'getHashAlgorithm()' src/* src/main/java/com/couchbase/client/vbucket/config/CacheConfig.java: public HashAlgorithm getHashAlgorithm() { src/main/java/com/couchbase/client/vbucket/config/Config.java: HashAlgorithm getHashAlgorithm(); src/main/java/com/couchbase/client/vbucket/config/DefaultConfig.java: public HashAlgorithm getHashAlgorithm() { Also, the CacheConfig never makes use of its defined hashAlgorithm. Therefore we, can either remove it from the interface alltogether (the getter), or just throw an unsupported method from the config?
        Hide
        daschl Michael Nitschinger added a comment -

        What do you think should we do in this case?

        Show
        daschl Michael Nitschinger added a comment - What do you think should we do in this case?
        Hide
        ingenthr Matt Ingenthron added a comment -

        I'm good either removing it or having it throw something. Your choice.

        Show
        ingenthr Matt Ingenthron added a comment - I'm good either removing it or having it throw something. Your choice.
        Show
        daschl Michael Nitschinger added a comment - http://review.couchbase.com/#/c/22586/
        Hide
        daschl Michael Nitschinger added a comment -

        Fixed and merged into master. Will be available in dp5!

        Show
        daschl Michael Nitschinger added a comment - Fixed and merged into master. Will be available in dp5!

          People

          • Assignee:
            daschl Michael Nitschinger
            Reporter:
            ingenthr Matt Ingenthron
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Gerrit Reviews

              There are no open Gerrit changes