Examples of keyBuilder()


Examples of org.apache.helix.HelixDataAccessor.keyBuilder()

    Assert.assertEquals(instances.get(0).getInstanceName(), manager.getInstanceName());
    // Update data in the live instance node, should trigger another live instance change
    // event
    HelixDataAccessor helixDataAccessor = manager.getHelixDataAccessor();
    PropertyKey propertyKey =
        helixDataAccessor.keyBuilder().liveInstance(manager.getInstanceName());
    LiveInstance instance = helixDataAccessor.getProperty(propertyKey);

    Map<String, String> map = new TreeMap<String, String>();
    map.put("k1", "v1");
    instance.getRecord().setMapField("test", map);
View Full Code Here

Examples of org.apache.helix.HelixDataAccessor.keyBuilder()

  private static void printStatus(final HelixManager manager)
  {
    System.out.println("CLUSTER STATUS");
    HelixDataAccessor helixDataAccessor = manager.getHelixDataAccessor();
    Builder keyBuilder = helixDataAccessor.keyBuilder();
    System.out.println("External View \n"
        + helixDataAccessor.getProperty(keyBuilder.externalView("repository")));
  }

  private static void addConfiguration(ClusterSetup setup, String baseDir,
View Full Code Here

Examples of org.apache.helix.HelixDataAccessor.keyBuilder()

            messageTemplate,
            callback,
            timeOut);
      }
      HelixDataAccessor accessor = _manager.getHelixDataAccessor();
      Builder keyBuilder = accessor.keyBuilder();

      // Record the number of messages sent into status updates
      Map<String, String> sendSummary = new HashMap<String, String>();
      sendSummary.put("MessageCount", "" + nMsgsSent);
     
View Full Code Here

Examples of org.apache.helix.HelixDataAccessor.keyBuilder()

      _routingTableRef.set(newRoutingTable);
      return;
    }
   
    HelixDataAccessor accessor = changeContext.getManager().getHelixDataAccessor();
    Builder keyBuilder = accessor.keyBuilder();
    List<ExternalView> externalViewList = accessor.getChildValues(keyBuilder.externalViews());
    refresh(externalViewList, changeContext);   
  }
 
  private void refresh(List<ExternalView> externalViewList, NotificationContext changeContext)
View Full Code Here

Examples of org.apache.helix.HelixDataAccessor.keyBuilder()

  }
 
  private void refresh(List<ExternalView> externalViewList, NotificationContext changeContext)
  {
    HelixDataAccessor accessor = changeContext.getManager().getHelixDataAccessor();
    Builder keyBuilder = accessor.keyBuilder();
   
    List<InstanceConfig> configList = accessor.getChildValues(keyBuilder.instanceConfigs());
    Map<String, InstanceConfig> instanceConfigMap = new HashMap<String, InstanceConfig>();
    for (InstanceConfig config : configList)
    {
View Full Code Here

Examples of org.apache.helix.HelixDataAccessor.keyBuilder()

      {
        Message nopMsg = new Message(MessageType.NO_OP, UUID.randomUUID().toString());
        nopMsg.setSrcName(_manager.getInstanceName());

        HelixDataAccessor accessor = _manager.getHelixDataAccessor();
        Builder keyBuilder = accessor.keyBuilder();

        if (_manager.getInstanceType() == InstanceType.CONTROLLER
            || _manager.getInstanceType() == InstanceType.CONTROLLER_PARTICIPANT)
        {
          nopMsg.setTgtName("Controller");
View Full Code Here

Examples of org.apache.helix.HelixDataAccessor.keyBuilder()

    // check if the state model definition exists and cache it
    if (!_stateModelDefs.containsKey(stateModelName))
    {
      HelixDataAccessor accessor = _manager.getHelixDataAccessor();
      Builder keyBuilder = accessor.keyBuilder();
      StateModelDefinition stateModelDef =
          accessor.getProperty(keyBuilder.stateModelDef(stateModelName));
      if (stateModelDef == null)
      {
        throw new HelixException("stateModelDef for " + stateModelName
View Full Code Here

Examples of org.apache.helix.Mocks.MockAccessor.keyBuilder()

    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>>();
      ClusterDataCache cache = new ClusterDataCache();
      MockAccessor accessor = new MockAccessor();
      Builder keyBuilder = accessor.keyBuilder();
      for (String node : _liveNodes) {
        LiveInstance liveInstance = new LiveInstance(node);
        liveInstance.setSessionId("testSession");
        accessor.setProperty(keyBuilder.liveInstance(node), liveInstance);
      }
View Full Code Here

Examples of org.apache.helix.manager.zk.ZKHelixDataAccessor.keyBuilder()

                                            String clusterName,
                                            String instanceName)
  {
    ZKHelixDataAccessor accessor =
        new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(zkClient));
    Builder keyBuilder = accessor.keyBuilder();

    ZNRecord liveInstance =
        accessor.getProperty(keyBuilder.liveInstance(instanceName)).getRecord();

    return liveInstance.getSimpleField(LiveInstanceProperty.SESSION_ID.toString());
View Full Code Here

Examples of org.apache.helix.manager.zk.ZKHelixDataAccessor.keyBuilder()

  // clear status update for error partition so verify() will not fail on
  // old
  // errors
  ZKHelixDataAccessor accessor = new ZKHelixDataAccessor(clusterName,
    new ZkBaseDataAccessor<ZNRecord>(_gZkClient));
  Builder keyBuilder = accessor.keyBuilder();

  LiveInstance liveInstance = accessor.getProperty(keyBuilder
    .liveInstance(instance));
  accessor.removeProperty(keyBuilder.stateTransitionStatus(instance,
    liveInstance.getSessionId(), resource, partition));
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.