statePriorityList.add(OFFLINE_STATE); statePriorityList.add(DROPPED_STATE); record.setListField(StateModelDefinitionProperty.STATE_PRIORITY_LIST.toString(), statePriorityList); stateTransitionPriorityList.add("OFFLINE-DROPPED"); record.setListField(StateModelDefinitionProperty.STATE_TRANSITION_PRIORITYLIST.toString(), stateTransitionPriorityList);
statePriorityList.add(OFFLINE_STATE); statePriorityList.add(DROPPED_STATE); record.setListField(StateModelDefinitionProperty.STATE_PRIORITY_LIST.toString(), statePriorityList); stateTransitionPriorityList.add("OFFLINE-DROPPED"); record.setListField(StateModelDefinitionProperty.STATE_TRANSITION_PRIORITYLIST.toString(), stateTransitionPriorityList);
statePriorityList.add("OFFLINE"); statePriorityList.add("DROPPED"); record.setListField(StateModelDefinitionProperty.STATE_PRIORITY_LIST.toString(), statePriorityList); for (String state : statePriorityList) { stateTransitionPriorityList.add("OFFLINE-DROPPED"); record.setListField(StateModelDefinitionProperty.STATE_TRANSITION_PRIORITYLIST.toString(), stateTransitionPriorityList); return record;
/** * Set the preference list of a partition * * @param partitionName the name of the partition * @param instanceList the instance preference list */ public void setPreferenceList(String partitionName, List<String> instanceList) { _record.setListField(partitionName, instanceList); }
/** * Set the preference list of a partition * * @param partitionName the name of the partition * @param instanceList the instance preference list */ public void setPreferenceList(String partitionName, List<String> instanceList) { _record.setListField(partitionName, instanceList); }
public void add(String partitionName) { if (_record.getListField(partitionName) == null) { _record.setListField(partitionName, new ArrayList<String>()); } }
public SemiAutoModeISBuilder add(String partitionName) { if (_record.getListField(partitionName) == null) { _record.setListField(partitionName, new ArrayList<String>()); } return this; }
/** * Add a partition, Helix will automatically assign the placement and state * for this partition at runtime. * @param partitionName */ public AutoRebalanceModeISBuilder add(String partitionName) { if (_record.getListField(partitionName) == null) { _record.setListField(partitionName, new ArrayList<String>()); } return this; } }
/** * Add a partition, Helix will automatically assign the placement and state * for this partition at runtime. * @param partitionName */ public FullAutoModeISBuilder add(String partitionName) { if (_record.getListField(partitionName) == null) { _record.setListField(partitionName, new ArrayList<String>()); } return this; } }
/** * Add a partition, Helix will automatically assign the placement and state * for this partition at runtime. * @param partitionName */ public AutoRebalanceModeISBuilder add(String partitionName) { if (_record.getListField(partitionName) == null) { _record.setListField(partitionName, new ArrayList<String>()); } return this; } }
public void add(String partitionName) { if (_record.getListField(partitionName) == null) { _record.setListField(partitionName, new ArrayList<String>()); } }
public SemiAutoModeISBuilder add(String partitionName) { if (_record.getListField(partitionName) == null) { _record.setListField(partitionName, new ArrayList<String>()); } return this; }
/** * Add a partition, Helix will automatically assign the placement and state * for this partition at runtime. * @param partitionName */ public FullAutoModeISBuilder add(String partitionName) { if (_record.getListField(partitionName) == null) { _record.setListField(partitionName, new ArrayList<String>()); } return this; } }
private ZNRecord emptyMapping(IdealState idealState) { ZNRecord emptyMapping = new ZNRecord(idealState.getResourceName()); for (String partition : idealState.getPartitionSet()) { emptyMapping.setListField(partition, new ArrayList<String>()); } return emptyMapping; }
private ZNRecord emptyMapping(IdealState idealState) { ZNRecord emptyMapping = new ZNRecord(idealState.getResourceName()); for (String partition : idealState.getPartitionSet()) { emptyMapping.setListField(partition, new ArrayList<String>()); } return emptyMapping; }
public void setLastScheduledSingleWorkflow(String workflow) { _record.setSimpleField(WorkflowContextProperties.LAST_SCHEDULED_WORKFLOW.name(), workflow); // Record scheduled workflow into the history list as well List<String> workflows = getScheduledWorkflows(); if (workflows == null) { workflows = new ArrayList<String>(); _record.setListField(WorkflowContextProperties.SCHEDULED_WORKFLOWS.name(), workflows); } workflows.add(workflow); }
public void setLastScheduledSingleWorkflow(String workflow) { _record.setSimpleField(WorkflowContextProperties.LAST_SCHEDULED_WORKFLOW.name(), workflow); // Record scheduled workflow into the history list as well List<String> workflows = getScheduledWorkflows(); if (workflows == null) { workflows = new ArrayList<String>(); _record.setListField(WorkflowContextProperties.SCHEDULED_WORKFLOWS.name(), workflows); } workflows.add(workflow); }
private IdealState buildWorkflowIdealState(String workflow) { CustomModeISBuilder IsBuilder = new CustomModeISBuilder(workflow); IsBuilder.setRebalancerMode(IdealState.RebalanceMode.TASK).setNumReplica(1) .setNumPartitions(1).setStateModel(TaskConstants.STATE_MODEL_NAME).disableExternalView(); IdealState is = IsBuilder.build(); is.getRecord().setListField(workflow, new ArrayList<String>()); is.getRecord().setMapField(workflow, new HashMap<String, String>()); is.setRebalancerClassName(WorkflowRebalancer.class.getName()); return is; }
private IdealState buildWorkflowIdealState(String workflow) { CustomModeISBuilder IsBuilder = new CustomModeISBuilder(workflow); IsBuilder.setRebalancerMode(IdealState.RebalanceMode.TASK).setNumReplica(1) .setNumPartitions(1).setStateModel(TaskConstants.STATE_MODEL_NAME).disableExternalView(); IdealState is = IsBuilder.build(); is.getRecord().setListField(workflow, new ArrayList<String>()); is.getRecord().setMapField(workflow, new HashMap<String, String>()); is.setRebalancerClassName(WorkflowRebalancer.class.getName()); return is; }
private void createIS(HelixDataAccessor accessor, String resourceId, String stateModelDefRef, RebalanceMode rebalanceMode) { IdealState idealState = new IdealState(resourceId); idealState.setRebalanceMode(rebalanceMode); idealState.setStateModelDefRef(stateModelDefRef); idealState.setNumPartitions(1); idealState.setReplicas("1"); idealState.getRecord().setListField(resourceId + "_0", ImmutableList.of(PARTICIPANT)); idealState.getRecord().setMapField(resourceId + "_0", ImmutableMap.of(PARTICIPANT, STATE)); accessor.setProperty(accessor.keyBuilder().idealStates(resourceId), idealState); }