Sha256: 57de3efa32a1f5848a93ce68a42abe86bd7f0fe7104793592b7ad4a198c19468

Contents?: true

Size: 1.44 KB

Versions: 16

Compression:

Stored size: 1.44 KB

Contents

#    Copyright 2020 Couchbase, Inc.
#
#  Licensed under the Apache License, Version 2.0 (the "License");
#  you may not use this file except in compliance with the License.
#  You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.

module Couchbase
  class MutationToken
    # @return [Integer]
    attr_accessor :partition_id
    # @return [Integer]
    attr_accessor :partition_uuid
    # @return [Integer]
    attr_accessor :sequence_number
    # @return [String] name of the bucket
    attr_accessor :bucket_name

    # @yieldparam [MutationToken] self
    def initialize
      yield self if block_given?
    end
  end

  class MutationState
    attr_accessor :tokens

    # Create a mutation state from one or more MutationTokens
    #
    # @param [Array<MutationToken>] mutation_tokens the mutation tokens
    def initialize(*mutation_tokens)
      @tokens = []
      add(*mutation_tokens)
    end

    # Add one or more Mutation tokens to this state
    #
    # @param [Array<MutationToken>] mutation_tokens the mutation tokens
    def add(*mutation_tokens)
      @tokens |= mutation_tokens
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
couchbase-3.0.0.alpha.5-x86_64-linux lib/couchbase/mutation_state.rb
couchbase-3.0.0.alpha.5-universal-darwin-19 lib/couchbase/mutation_state.rb
couchbase-3.0.0.alpha.5-x86_64-darwin-19 lib/couchbase/mutation_state.rb
couchbase-3.0.0.alpha.5 lib/couchbase/mutation_state.rb
couchbase-3.0.0.alpha.4-x86_64-linux lib/couchbase/mutation_state.rb
couchbase-3.0.0.alpha.4-x86_64-darwin-19 lib/couchbase/mutation_state.rb
couchbase-3.0.0.alpha.4-universal-darwin-19 lib/couchbase/mutation_state.rb
couchbase-3.0.0.alpha.4 lib/couchbase/mutation_state.rb
couchbase-3.0.0.alpha.3-x86_64-linux lib/couchbase/mutation_state.rb
couchbase-3.0.0.alpha.3-x86_64-darwin-19 lib/couchbase/mutation_state.rb
couchbase-3.0.0.alpha.3-universal-darwin-19 lib/couchbase/mutation_state.rb
couchbase-3.0.0.alpha.3 lib/couchbase/mutation_state.rb
couchbase-3.0.0.alpha.2-x86_64-linux lib/couchbase/mutation_state.rb
couchbase-3.0.0.alpha.2-x86_64-darwin-19 lib/couchbase/mutation_state.rb
couchbase-3.0.0.alpha.2-universal-darwin-19 lib/couchbase/mutation_state.rb
couchbase-3.0.0.alpha.2 lib/couchbase/mutation_state.rb