Examples of CurrentState


Examples of com.linkedin.helix.model.CurrentState

      stateModelFactory.createAndAddStateModel(partitionKey);
      stateModel = stateModelFactory.getStateModel(partitionKey);
      stateModel.updateState(initState);
    }

    CurrentState currentStateDelta = new CurrentState(resourceName);
    currentStateDelta.setSessionId(sessionId);
    currentStateDelta.setStateModelDefRef(stateModelName);
    currentStateDelta.setStateModelFactoryName(factoryName);
    currentStateDelta.setBucketSize(bucketSize);

    currentStateDelta.setState(partitionKey, (stateModel.getCurrentState() == null)
        ? initState : stateModel.getCurrentState());

    return new HelixStateTransitionHandler(stateModel,
                                           message,
                                           context,
View Full Code Here

Examples of io.fabric8.kubernetes.api.model.CurrentState

        }
        Filter<PodSchema> filter = KubernetesHelper.createPodFilter(filterText.getValue());
        for (PodSchema item : items) {
            if (filter.matches(item)) {
                String id = item.getId();
                CurrentState currentState = item.getCurrentState();
                String status = "";
                String host = "";
                if (currentState != null) {
                    status = currentState.getStatus();
                    host = currentState.getHost();
                }
                Map<String, String> labelMap = item.getLabels();
                String labels = KubernetesHelper.toLabelsString(labelMap);
                DesiredState desiredState = item.getDesiredState();
                if (desiredState != null) {
View Full Code Here

Examples of org.apache.helix.model.CurrentState

  }
 
  public int getBucketSize(String resource)
  {
    int bucketSize = 0;
    CurrentState curStateMeta = _curStateMetaMap.get(resource);
    if (curStateMeta != null)
    {
      bucketSize = curStateMeta.getBucketSize()
    }
   
    return bucketSize;
  }
View Full Code Here

Examples of org.apache.helix.model.CurrentState

    Builder keyBuilder = accessor.keyBuilder();

    String instanceName = manager.getInstanceName();
    String partition = _message.getPartitionName();
    String resourceName = _message.getResourceName();
    CurrentState currentStateDelta = new CurrentState(resourceName);

    StateTransitionError error = new StateTransitionError(type, code, e);
    _stateModel.rollbackOnError(_message, _notificationContext, error);
    // if the transition is not canceled, it should go into error state
    if (code == ErrorCode.ERROR)
    {
      currentStateDelta.setState(partition, "ERROR");
      _stateModel.updateState("ERROR");

      accessor.updateProperty(keyBuilder.currentState(instanceName,
                                                      _message.getTgtSessionId(),
                                                      resourceName),
View Full Code Here

Examples of org.apache.helix.model.CurrentState

      }
    }

    // check partition is in ERROR state
    String sessionId = liveInstance.getSessionId();
    CurrentState curState =
        accessor.getProperty(keyBuilder.currentState(instanceName,
                                                     sessionId,
                                                     resourceName));
    for (String partitionName : resetPartitionNames)
    {
      if (!curState.getState(partitionName).equals("ERROR"))
      {
        throw new HelixException("Can't reset state for " + resourceName + "/"
            + partitionNames + " on " + instanceName + ", because not all "
            + partitionNames + " are in ERROR state");
      }
View Full Code Here

Examples of org.apache.helix.model.CurrentState

    NotificationContext context;
    executor.registerMessageHandlerFactory(MessageType.TASK_REPLY.toString(),
                                           new AsyncCallbackService());
    // String clusterName =" testcluster";
    context = new NotificationContext(manager);
    CurrentState currentStateDelta = new CurrentState("TestDB");
    currentStateDelta.setState("TestDB_0", "OFFLINE");
    HelixStateTransitionHandler handler =
        new HelixStateTransitionHandler(stateModel,
                                        message,
                                        context,
                                        currentStateDelta,
View Full Code Here

Examples of org.apache.helix.model.CurrentState

        List<String> sessionIds =
            accessor.getChildNames(keyBuilder.sessions(instanceName));

        for (String sessionId : sessionIds)
        {
          CurrentState curState =
              accessor.getProperty(keyBuilder.currentState(instanceName,
                                                           sessionId,
                                                           resourceName));

          if (curState != null && curState.getRecord().getMapFields().size() != 0)
          {
            return false;
          }
        }
View Full Code Here

Examples of org.apache.helix.model.CurrentState

        String sessionId = manager.getSessionId();

        // get resource name from partition key: "PARTICIPANT_LEADER_XXX_0"
        String resourceName = _partitionKey.substring(0, _partitionKey.lastIndexOf('_'));

        CurrentState curState =
            accessor.getProperty(keyBuilder.currentState(instance,
                                                         sessionId,
                                                         resourceName));
        if (curState == null)
        {
          return;
        }

        String state = curState.getState(_partitionKey);
        if (state == null || !state.equalsIgnoreCase("LEADER"))
        {
          return;
        }
      }
View Full Code Here

Examples of org.apache.helix.model.CurrentState

    return _resourceStateModelMap.get(resourceName);
  }

  public void setBucketSize(String resource, int bucketSize)
  {
    CurrentState curStateMeta = _curStateMetaMap.get(resource);
    if (curStateMeta == null)
    {
      curStateMeta = new CurrentState(resource);
      _curStateMetaMap.put(resource, curStateMeta);
    }
    curStateMeta.setBucketSize(bucketSize);
  }
View Full Code Here

Examples of org.apache.helix.model.CurrentState

        generator.generateConfigForMasterSlave());
    Builder keyBuilder = accessor.keyBuilder();
    accessor.setProperty(keyBuilder.stateModelDef("MasterSlave"), stateModelDef);

    context = new NotificationContext(manager);
    CurrentState currentStateDelta = new CurrentState("TestDB");
    currentStateDelta.setState("TestDB_0", "OFFLINE");

    HelixStateTransitionHandler stHandler = new HelixStateTransitionHandler(stateModel, message,
        context, currentStateDelta, executor);
    HelixTask handler;
    handler = new HelixTask(message, context, stHandler, executor);
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.