Class DefaultCouchbaseBucketConfig

    • Field Detail

    • Constructor Detail

      • DefaultCouchbaseBucketConfig

        public DefaultCouchbaseBucketConfig​(long rev,
                                            String uuid,
                                            String name,
                                            String uri,
                                            String streamingUri,
                                            CouchbasePartitionInfo partitionInfo,
                                            List<NodeInfo> nodeInfos,
                                            List<PortInfo> portInfos,
                                            List<BucketCapabilities> bucketCapabilities,
                                            String origin)
        Creates a new CouchbaseBucketConfig.
        Parameters:
        rev - the revision of the config.
        name - the name of the bucket.
        uri - the URI for this bucket.
        streamingUri - the streaming URI for this bucket.
        partitionInfo - partition info for this bucket.
        nodeInfos - related node information.
        portInfos - port info for the nodes, including services.
    • Method Detail

      • tainted

        public boolean tainted()
        Description copied from interface: BucketConfig
        Returns true if the config indicates the cluster is undergoing a transition (such as a rebalance operation).
        Specified by:
        tainted in interface BucketConfig
        Returns:
        true if a transition is in progress.
      • hasPrimaryPartitionsOnNode

        public boolean hasPrimaryPartitionsOnNode​(String hostname)
        Description copied from interface: CouchbaseBucketConfig
        Checks if the given hostname has active primary partitions assigned to it.
        Specified by:
        hasPrimaryPartitionsOnNode in interface CouchbaseBucketConfig
        Parameters:
        hostname - the hostname of the node to check against.
        Returns:
        true if it has, false otherwise.
      • nodeIndexForMaster

        public short nodeIndexForMaster​(int partition,
                                        boolean useFastForward)
        Description copied from interface: CouchbaseBucketConfig
        Returns the node index for the given partition index and master.
        Specified by:
        nodeIndexForMaster in interface CouchbaseBucketConfig
        Parameters:
        partition - the index of the partition.
        useFastForward - if the fast forward config should be used.
        Returns:
        the index of the node.
      • nodeIndexForReplica

        public short nodeIndexForReplica​(int partition,
                                         int replica,
                                         boolean useFastForward)
        Description copied from interface: CouchbaseBucketConfig
        Returns the node index for the given partition index and the replica.
        Specified by:
        nodeIndexForReplica in interface CouchbaseBucketConfig
        Parameters:
        partition - the index of the partition.
        replica - the replica number.
        useFastForward - if the fast forward config should be used.
        Returns:
        the index of the node.
      • nodeAtIndex

        public NodeInfo nodeAtIndex​(int nodeIndex)
        Description copied from interface: CouchbaseBucketConfig
        Returns information for the node at the given index.
        Specified by:
        nodeAtIndex in interface CouchbaseBucketConfig
        Parameters:
        nodeIndex - the index of the node.
        Returns:
        the information of the node at this index.
      • rev

        public long rev()
        Description copied from interface: BucketConfig
        Revision number (optional) for that configuration.
        Specified by:
        rev in interface BucketConfig
        Returns:
        the rev number, might be 0.
      • hasFastForwardMap

        public boolean hasFastForwardMap()
        Description copied from interface: BucketConfig
        Returns true if the config has a fast forward map that describes what the topology of the cluster will be after the current rebalance operation completes.
        Specified by:
        hasFastForwardMap in interface BucketConfig
        Returns:
        true if it does, false otherwise.