API Docs for: 2.2.2
Show:

FetchCounter.Builder Class

A builder for constructing FetchCounter instances.

Rather than having to manually construct the options and instantiating a FetchCounter directly, this builder may be used.

var fetch = new FetchCounter.Builder()
                 .withBucketType('myBucketType')
                 .withBucket('myBucket')
                 .withKey('myKey')
                 .withCallback(myCallback)
                 .build();

Constructor

FetchCounter.Builder

()

Methods

build

() FetchCounter

Construct a FetchCounter instance.

Returns:

withBasicQuorum

(
  • useBasicQuorum
)
chainable

Set the basic_quorum value. The parameter controls whether a read request should return early in some fail cases. E.g. If a quorum of nodes has already returned notfound/error, don't wait around for the rest.

Parameters:

  • useBasicQuorum Boolean

    the basic_quorum value.

withBucket

(
  • bucket
)
chainable

Set the bucket.

Parameters:

  • bucket String

    the bucket in Riak

withBucketType

(
  • bucketType
)
chainable

Set the bucket type. If not supplied, 'default' is used.

Parameters:

  • bucketType String

    the bucket type in riak

withCallback

(
  • callback
)
chainable

Set the callback to be executed when the operation completes.

Parameters:

  • callback Function

    The callback to execute

    • err String

      An error message. Will be null if no error.

    • response Object

      The response from Riak

      • counterValue Number
        The counter value in Riak.
      • isNotFound Boolean
        True if there was no counter in Riak.

withKey

(
  • key
)
chainable

Set the key.

Parameters:

  • key String

    the key in riak.

withPr

(
  • pr
)
chainable

Set the PR value. If not asSet the bucket default is used.

Parameters:

  • pr Number

    the PR value.

withR

(
  • r
)
chainable

Set the R value. If not asSet the bucket default is used.

Parameters:

  • r Number

    the R value.

withTimeout

(
  • timeout
)
chainable

Set a timeout for this operation.

Parameters:

  • timeout Number

    a timeout in milliseconds.