Examples of ClusterConfig


Examples of org.apache.helix.api.config.ClusterConfig

    final String key1 = "key1";
    final String key2 = "key2";

    // set up the cluster (non-atomically since this concurrency comes later)
    ClusterAccessor accessor = new ClusterAccessor(clusterId, helixAccessor);
    ClusterConfig config = new ClusterConfig.Builder(clusterId).build();
    boolean created = accessor.createCluster(config);
    Assert.assertTrue(created);

    // thread that will update the cluster in one way
    Thread t1 = new Thread() {
View Full Code Here

Examples of org.apache.helix.api.config.ClusterConfig

      final Map<PartitionId, Map<ParticipantId, State>> mapResult =
          new HashMap<PartitionId, Map<ParticipantId, State>>();
      ClusterId clusterId = ClusterId.from("clusterId");
      ClusterConfig.Builder clusterConfigBuilder =
          new ClusterConfig.Builder(clusterId).addStateModelDefinition(_stateModelDef);
      ClusterConfig clusterConfig = clusterConfigBuilder.build();
      for (String partition : _partitions) {
        PartitionId partitionId = PartitionId.from(partition);
        Set<ParticipantId> disabledParticipantsForPartition = Collections.emptySet();
        Map<MessageId, Message> messageMap = Collections.emptyMap();
        Map<ResourceId, CurrentState> currentStateMap = Collections.emptyMap();
View Full Code Here

Examples of org.apache.helix.api.config.ClusterConfig

    private Map<String, Map<String, String>> getMapping(final Map<String, List<String>> listResult) {
      final Map<String, Map<String, String>> mapResult = new HashMap<String, Map<String, String>>();
      for (String partition : _partitions) {
        Map<String, String> rawCurStateMap = _currentMapping.get(partition);
        ClusterConfig cluster =
            new ClusterConfig.Builder(ClusterId.from("cluster")).addStateModelDefinition(
                _stateModelDef).build();
        Set<ParticipantId> liveParticipantSet = Sets.newHashSet();
        for (String node : _liveNodes) {
          liveParticipantSet.add(ParticipantId.from(node));
View Full Code Here

Examples of org.apache.jackrabbit.core.config.ClusterConfig

     * Initialize this cluster node (overridable).
     *
     * @throws ClusterException if an error occurs
     */
    protected void init() throws ClusterException {
        ClusterConfig cc = clusterContext.getClusterConfig();
        clusterNodeId = getClusterNodeId(cc.getId());
        syncDelay = cc.getSyncDelay();

        try {
            journal = (Journal) cc.getJournalConfig().newInstance();
            journal.init(clusterNodeId, new SyncListener(), clusterContext.getNamespaceResovler());
        } catch (ConfigurationException e) {
            throw new ClusterException(e.getMessage(), e.getCause());
        }
    }
View Full Code Here

Examples of org.apache.jackrabbit.core.config.ClusterConfig

     * Initialize this cluster node (overridable).
     *
     * @throws ClusterException if an error occurs
     */
    protected void init() throws ClusterException {
        ClusterConfig cc = clusterContext.getClusterConfig();
        clusterNodeId = cc.getId();
        syncDelay = cc.getSyncDelay();

        try {
            journal = cc.getJournal(clusterContext.getNamespaceResolver());
            instanceRevision = journal.getInstanceRevision();
            journal.register(this);
            producer = journal.getProducer(PRODUCER_ID);
        } catch (RepositoryException e) {
            throw new ClusterException(
View Full Code Here

Examples of org.apache.jackrabbit.core.config.ClusterConfig

     * Initialize this cluster node (overridable).
     *
     * @throws ClusterException if an error occurs
     */
    protected void init() throws ClusterException {
        ClusterConfig cc = clusterContext.getClusterConfig();
        clusterNodeId = getClusterNodeId(cc.getId());
        syncDelay = cc.getSyncDelay();

        try {
            JournalConfig jc = cc.getJournalConfig();
            journal = (Journal) jc.newInstance();
            setRepositoryHome(journal, clusterContext.getRepositoryHome());
            journal.init(clusterNodeId, clusterContext.getNamespaceResolver());
            instanceRevision = journal.getInstanceRevision();
            journal.register(this);
View Full Code Here

Examples of org.apache.jackrabbit.core.config.ClusterConfig

     * Initialize this cluster node (overridable).
     *
     * @throws ClusterException if an error occurs
     */
    protected void init() throws ClusterException {
        ClusterConfig cc = clusterContext.getClusterConfig();
        clusterNodeId = cc.getId();
        syncDelay = cc.getSyncDelay();
        stopDelay = syncDelay * 2;

        try {
            journal = cc.getJournal(clusterContext.getNamespaceResolver());
            instanceRevision = journal.getInstanceRevision();
            journal.register(this);
            producer = journal.getProducer(PRODUCER_ID);
        } catch (RepositoryException e) {
            throw new ClusterException(
View Full Code Here

Examples of org.apache.jackrabbit.core.config.ClusterConfig

    private ClusterNode createClusterNode(String id, ArrayList records)
            throws ClusterException {

        BeanConfig bc = new BeanConfig(MemoryJournal.class.getName(), new Properties());
        JournalConfig jc = new JournalConfig(bc);
        ClusterConfig cc = new ClusterConfig(id, SYNC_DELAY, jc);
        SimpleClusterContext context = new SimpleClusterContext(cc);

        ClusterNode clusterNode = new ClusterNode();
        clusterNode.init(context);
        if (records != null) {
View Full Code Here

Examples of org.apache.jackrabbit.core.config.ClusterConfig

     * Initialize this cluster node (overridable).
     *
     * @throws ClusterException if an error occurs
     */
    protected void init() throws ClusterException {
        ClusterConfig cc = clusterContext.getClusterConfig();
        clusterNodeId = cc.getId();
        syncDelay = cc.getSyncDelay();

        try {
            journal = cc.getJournal(clusterContext.getNamespaceResolver());
            instanceRevision = journal.getInstanceRevision();
            journal.register(this);
            producer = journal.getProducer(PRODUCER_ID);
        } catch (RepositoryException e) {
            throw new ClusterException(
View Full Code Here

Examples of org.apache.jackrabbit.core.config.ClusterConfig

     * Initialize this cluster node (overridable).
     *
     * @throws ClusterException if an error occurs
     */
    protected void init() throws ClusterException {
        ClusterConfig cc = clusterContext.getClusterConfig();
        clusterNodeId = cc.getId();
        syncDelay = cc.getSyncDelay();

        try {
            journal = cc.getJournal(clusterContext.getNamespaceResolver());
            instanceRevision = journal.getInstanceRevision();
            journal.register(this);
            producer = journal.getProducer(PRODUCER_ID);
        } catch (RepositoryException e) {
            throw new ClusterException(
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.