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

Changing configPollingInterval returns core config, should be overridden maybe

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • Major
    • None
    • None
    • None
    • None

    Description

      Right now, if one wants to change the configPollingInterval, one needs to add an explicit cast. Consider this bit of code:

              CouchbaseEnvironment env = DefaultCouchbaseEnvironment
                      .builder()
                      .mutationTokensEnabled(true)
                      .computationPoolSize(5)
                      .build();
              Cluster cluster = CouchbaseCluster.create(env, "localhost");
      

      That's good, but to compile properly one needs to add a cast since the property is changed at the core.

              CouchbaseEnvironment env = (CouchbaseEnvironment) DefaultCouchbaseEnvironment
                      .builder()
                      .mutationTokensEnabled(true)
                      .computationPoolSize(5)
                      .configPollInterval(2500)
                      .build();
              Cluster cluster = CouchbaseCluster.create(env, "localhost");
      

      That's a bit smelly since we're basically asking the compiler to override type checking. I think I should be able to add .configPollInterval() there inline. Should it be overridden in the builder rather than just passing through?

      Attachments

        Issue Links

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

          Activity

            People

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

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty