Package com.couchbase.client.vbucket.config

Examples of com.couchbase.client.vbucket.config.Bucket


      monitor.deleteObserver(new ReconfigurableObserver(rec));
    }
  }

  public Config getLatestConfig(String bucketname) {
    Bucket bucket = getBucketConfiguration(bucketname);
    return bucket.getConfig();
  }
View Full Code Here


  public CouchbaseNodeOrder getStreamingNodeOrder() {
    return nodeOrder;
  }

  public Config getVBucketConfig() {
    Bucket config = configurationProvider.getBucketConfiguration(bucket);
    if(config == null) {
      throw new ConfigurationException("Could not fetch valid configuration "
        + "from provided nodes. Stopping.");
    } else if (config.isNotUpdating()) {
      LOGGER.warning("Noticed bucket configuration to be disconnected, "
        + "will attempt to reconnect");
      setConfigurationProvider(new ConfigurationProviderHTTP(storedBaseList,
        bucket, pass));
    }
View Full Code Here

      return false;
    }

    String appliedConfig = connection.replaceConfigWildcards(
      configs.get(0));
    Bucket config = configurationParser.parseBucket(appliedConfig);
    setConfig(config);
    binaryConnection.set(connection);
    return true;
  }
View Full Code Here

   *
   * @return true if the http bootstrap process was successful.
   */
  boolean bootstrapHttp() {
    try {
      Bucket config = httpProvider.get().getBucketConfiguration(bucket);
      setConfig(config);
      isBinary = false;
      return true;
    } catch(Exception ex) {
      getLogger().info("Could not fetch config from http seed nodes.", ex);
View Full Code Here

            bootstrap();
            return;
          }
          String appliedConfig = binaryConnection.get().replaceConfigWildcards(
            configs.get(0));
          Bucket config = configurationParser.parseBucket(appliedConfig);
          setConfig(config);
        } catch(Exception ex) {
          getLogger().info("Could not load config from existing "
            + "connection, rerunning bootstrap.", ex);
          bootstrap();
View Full Code Here

  /**
   * Take any action required when the monitor appears to be disconnected.
   */
  protected void notifyDisconnected() {
    Bucket bucket = provider.getBucketConfiguration(provider.getBucket());
    bucket.setIsNotUpdating();
    LOGGER.trace("Marked bucket " + bucket.getName()
      + " as not updating.  Notifying observers.");
    LOGGER.trace("There appear to be " + this.countObservers()
      + " observers waiting for notification");
    setChanged();
    notifyObservers(bucket);
View Full Code Here

    channel.write(request);
    try {
      String response = this.handler.getLastResponse();
      LOGGER.debug("Getting server list returns this last chunked response:\n"
          + response);
      Bucket bucketToMonitor = this.configParser.parseBucket(response);
      setChanged();
      notifyObservers(bucketToMonitor);
    } catch (ParseException ex) {
      LOGGER.warn("Invalid client configuration received from server. "
        + "Staying with existing configuration.", ex);
View Full Code Here

   * Replace the previously received configuration with the current one.
   */
  protected void replaceConfig() {
    try {
      String response = handler.getLastResponse();
      Bucket updatedBucket = this.configParser.updateBucket(
        response,
        provider.getBucketConfiguration(provider.getBucket())
      );
      setChanged();
      notifyObservers(updatedBucket);
View Full Code Here

    }

    String appliedConfig = connection.replaceConfigWildcards(
      configs.get(0));
    try {
        Bucket config = configurationParser.parseBucket(appliedConfig);
        setConfig(config);
    } catch(Exception ex) {
        getLogger().warn("Could not parse config, retrying bootstrap.", ex);
        connection.shutdown();
        return false;
View Full Code Here

      getLogger().info("Http bootstrap manually disabled, skipping.");
      return false;
    }

    try {
      Bucket config = httpProvider.get().getBucketConfiguration(bucket);
      setConfig(config);
      monitorBucket();
      isBinary = false;
      return true;
    } catch(Exception ex) {
View Full Code Here

TOP

Related Classes of com.couchbase.client.vbucket.config.Bucket

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.