Package org.apache.helix

Examples of org.apache.helix.ZNRecord.merge()


    IdealState is1 = helixAccessor.getProperty(helixAccessor.keyBuilder().idealStates("TestDB"));
    idealStateOld1.merge(is1.getRecord());

    IdealState is2 = helixAccessor.getProperty(helixAccessor.keyBuilder().idealStates("MyDB"));
    idealStateOld2.merge(is2.getRecord());

    String instanceName = "localhost_" + (START_PORT + 0);
    _setupTool.getClusterManagementTool().enableInstance(CLUSTER_NAME, instanceName, false);

    boolean result =
View Full Code Here


          if (lastRecordProcessed != null) {
            localEndSeq = (int) lastRecordProcessed.txid;
          }
          newRec.setSimpleField("prevGenEndSeq", "" + localEndSeq);
        }
        newRec.merge(currentData);
      } else {
        newRec.setSimpleField("currentGen", Integer.toString(1));
        newRec.setSimpleField("currentGenStartSeq", Integer.toString(1));
      }
      return newRec;
View Full Code Here

    Map<String, String> paraMap = new HashMap<String, String>();

    paraMap.put(JsonParameters.MANAGEMENT_COMMAND, ClusterSetup.addStateModelDef);

    ZNRecord r = new ZNRecord("Test");
    r.merge(zn);

    httpUrlBase = "http://localhost:" + ADMIN_PORT + "/clusters/" + clusterName + "/StateModelDefs";
    resourceRef = new Reference(httpUrlBase);
    request = new Request(Method.POST, resourceRef);
    request.setEntity(
View Full Code Here

    Map<String, String> paraMap = new HashMap<String, String>();

    paraMap.put(JsonParameters.MANAGEMENT_COMMAND, ClusterSetup.addStateModelDef);

    ZNRecord r = new ZNRecord("Test");
    r.merge(zn);
    StateModelDefinition newStateModel = new StateModelDefinition(r);

    httpUrlBase = "http://localhost:" + ADMIN_PORT + "/clusters/" + clusterName + "/StateModelDefs";
    resourceRef = new Reference(httpUrlBase);
    request = new Request(Method.POST, resourceRef);
View Full Code Here

    if (_liveInstanceInfoProvider != null) {
      LOG.info("invoke liveInstanceInfoProvider");
      ZNRecord additionalLiveInstanceInfo =
          _liveInstanceInfoProvider.getAdditionalLiveInstanceInfo();
      if (additionalLiveInstanceInfo != null) {
        additionalLiveInstanceInfo.merge(liveInstance.getRecord());
        ZNRecord mergedLiveInstance = new ZNRecord(additionalLiveInstanceInfo, _instanceName);
        liveInstance = new LiveInstance(mergedLiveInstance);
        LOG.info("instanceName: " + _instanceName + ", mergedLiveInstance: " + liveInstance);
      }
    }
View Full Code Here

          if (lastRecordProcessed != null) {
            localEndSeq = (int) lastRecordProcessed.txid;
          }
          newRec.setSimpleField("prevGenEndSeq", "" + localEndSeq);
        }
        newRec.merge(currentData);
      } else {
        newRec.setSimpleField("currentGen", Integer.toString(1));
        newRec.setSimpleField("currentGenStartSeq", Integer.toString(1));
      }
      return newRec;
View Full Code Here

    if (_liveInstanceInfoProvider != null) {
      LOG.info("Additional live instance information is provided: " + _liveInstanceInfoProvider);
      ZNRecord additionalLiveInstanceInfo =
          _liveInstanceInfoProvider.getAdditionalLiveInstanceInfo();
      if (additionalLiveInstanceInfo != null) {
        additionalLiveInstanceInfo.merge(liveInstance.getRecord());
        ZNRecord mergedLiveInstance =
            new ZNRecord(additionalLiveInstanceInfo, _participantId.stringify());
        liveInstance = new LiveInstance(mergedLiveInstance);
        LOG.info("Participant: " + _participantId + ", mergedLiveInstance: " + liveInstance);
      }
View Full Code Here

    if (_liveInstanceInfoProvider != null) {
      LOG.info("invoke liveInstanceInfoProvider");
      ZNRecord additionalLiveInstanceInfo =
          _liveInstanceInfoProvider.getAdditionalLiveInstanceInfo();
      if (additionalLiveInstanceInfo != null) {
        additionalLiveInstanceInfo.merge(liveInstance.getRecord());
        ZNRecord mergedLiveInstance = new ZNRecord(additionalLiveInstanceInfo, _instanceName);
        liveInstance = new LiveInstance(mergedLiveInstance);
        LOG.info("instanceName: " + _instanceName + ", mergedLiveInstance: " + liveInstance);
      }
    }
View Full Code Here

          if (lastRecordProcessed != null) {
            localEndSeq = (int) lastRecordProcessed.txid;
          }
          newRec.setSimpleField("prevGenEndSeq", "" + localEndSeq);
        }
        newRec.merge(currentData);
      } else {
        newRec.setSimpleField("currentGen", Integer.toString(1));
        newRec.setSimpleField("currentGenStartSeq", Integer.toString(1));
      }
      return newRec;
View Full Code Here

    paraMap.put(JsonParameters.MANAGEMENT_COMMAND,
                ClusterSetup.addStateModelDef);

    ZNRecord r = new ZNRecord("Test");
    r.merge(zn);
    StateModelDefinition newStateModel = new StateModelDefinition(r);

    httpUrlBase =
        "http://localhost:" + ADMIN_PORT + "/clusters/" + clusterName + "/StateModelDefs";
    resourceRef = new Reference(httpUrlBase);
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.