Package org.apache.helix.model

Examples of org.apache.helix.model.ClusterConfiguration.addNamespacedConfig()


    // allow auto join to cluster configuration
    ClusterId clusterId = ClusterId.from("clusterId");
    UserConfig userConfig = new UserConfig(Scope.cluster(clusterId));
    userConfig.setSimpleField(KEY1, VALUE1);
    ClusterConfiguration clusterConfiguration = new ClusterConfiguration(clusterId);
    clusterConfiguration.addNamespacedConfig(userConfig);
    clusterConfiguration.getRecord().setSimpleField(KEY2, VALUE2);
    clusterConfiguration.setAutoJoinAllowed(true);

    // there should be key1 and key2, but not auto join
    UserConfig result = clusterConfiguration.getUserConfig();
View Full Code Here


      // Update the main config
      final ClusterConfig deltaConfig = _builder.build();
      ClusterConfiguration config = new ClusterConfiguration(deltaConfig.getId());
      config.setAutoJoinAllowed(deltaConfig.autoJoinAllowed());
      if (deltaConfig.getUserConfig() != null) {
        config.addNamespacedConfig(deltaConfig.getUserConfig());
      }
      accessor.updateProperty(accessor.keyBuilder().clusterConfig(), config);

      // Update paused status
      if (_paused != null) {
View Full Code Here

    // allow auto join to cluster configuration
    ClusterId clusterId = ClusterId.from("clusterId");
    UserConfig userConfig = new UserConfig(Scope.cluster(clusterId));
    userConfig.setSimpleField(KEY1, VALUE1);
    ClusterConfiguration clusterConfiguration = new ClusterConfiguration(clusterId);
    clusterConfiguration.addNamespacedConfig(userConfig);
    clusterConfiguration.getRecord().setSimpleField(KEY2, VALUE2);
    clusterConfiguration.setAutoJoinAllowed(true);

    // there should be key1 and key2, but not auto join
    UserConfig result = clusterConfiguration.getUserConfig();
View Full Code Here

   * @param userConfig the user config key-value pairs to add
   * @return true if the user config was updated, false otherwise
   */
  public boolean updateUserConfig(UserConfig userConfig) {
    ClusterConfiguration clusterConfig = new ClusterConfiguration(_clusterId);
    clusterConfig.addNamespacedConfig(userConfig);
    return _accessor.updateProperty(_keyBuilder.clusterConfig(), clusterConfig);
  }

  /**
   * pause controller of cluster
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.