code: private DcpChannel masterChannelByPartition(short partition) {
      CouchbaseBucketConfig config = currentConfig.get();
      int index = config.nodeIndexForMaster(partition, false);
      NodeInfo node = config.nodeAtIndex(index);
      int port = (env.sslEnabled() ? node.sslServices() : node.services()).get(ServiceType.BINARY);
      InetSocketAddress address = new InetSocketAddress(node.hostname().nameOrAddress(), port);
      for (DcpChannel ch : channels) {
        if (ch.address().equals(address)) {
          return ch;
        }
      }
  
      throw new IllegalStateException("No DcpChannel found for partition " + partition);
    }
docs: Returns the dcp channel responsible for a given vbucket id according to the current
  configuration.
  <p>
  Note that this doesn't mean that the partition is enabled there, it just checks the current
  mapping.