Package org.apache.helix.model

Examples of org.apache.helix.model.ClusterConstraints.addConstraintItem()


        LOG.error("Unsupported scope for adding a transition constraint: " + scope);
        return this;
      }
      ConstraintItem item = new ConstraintItemBuilder().addConstraintAttributes(attributes).build();
      ClusterConstraints constraints = getConstraintsInstance(ConstraintType.MESSAGE_CONSTRAINT);
      constraints.addConstraintItem(ConstraintId.from(scope, stateModelDefId, transition), item);
      return this;
    }

    /**
     * Add a state upper bound constraint
View Full Code Here


        LOG.error("Unsupported scope for adding a state constraint: " + scope);
        return this;
      }
      ConstraintItem item = new ConstraintItemBuilder().addConstraintAttributes(attributes).build();
      ClusterConstraints constraints = getConstraintsInstance(ConstraintType.STATE_CONSTRAINT);
      constraints.addConstraintItem(ConstraintId.from(scope, stateModelDefId, state), item);
      return this;
    }

    /**
     * Add a state model definition to the cluster
View Full Code Here

      public ZNRecord update(ZNRecord currentData) {
        ClusterConstraints constraints =
            currentData == null ? new ClusterConstraints(constraintType) : new ClusterConstraints(
                currentData);

        constraints.addConstraintItem(constraintId, constraintItem);
        return constraints.getRecord();
      }
    }, AccessOption.PERSISTENT);
  }
View Full Code Here

  public ClusterConstraints build() {
    ClusterConstraints constraints = new ClusterConstraints(_constraintType);
   
    for (String constraintId : _constraintBuilderMap.keySet()) {
      ConstraintItemBuilder builder = _constraintBuilderMap.get(constraintId);
      constraints.addConstraintItem(constraintId, builder.build());
    }
    return constraints;
  }
}
View Full Code Here

      public ZNRecord update(ZNRecord currentData)
      {
        ClusterConstraints constraints = currentData == null?
            new ClusterConstraints(constraintType) : new ClusterConstraints(currentData);

        constraints.addConstraintItem(constraintId, constraintItem);
        return constraints.getRecord();
      }
    }, AccessOption.PERSISTENT);
  }
 
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.