if (!liveParticipant.getLiveInstance().getSessionId().equals(message.getTgtSessionId())) {
continue;
}
ResourceId resourceId = message.getResourceId();
ResourceConfig resource = resourceMap.get(resourceId);
if (resource == null) {
continue;
}
IdealState idealState = resource.getIdealState();
if (!message.getBatchMessageMode()) {
PartitionId partitionId = message.getPartitionId();
if (idealState.getPartitionIdSet().contains(partitionId)) {
currentStateOutput.setPendingState(resourceId, partitionId, participantId,
message.getTypedToState());
} else {
// log
}
} else {
List<PartitionId> partitionNames = message.getPartitionIds();
if (!partitionNames.isEmpty()) {
for (PartitionId partitionId : partitionNames) {
if (idealState.getPartitionIdSet().contains(partitionId)) {
currentStateOutput.setPendingState(resourceId, partitionId, participantId,
message.getTypedToState());
} else {
// log
}
}
}
}
}
// add current state
SessionId sessionId = SessionId.from(liveParticipant.getLiveInstance().getSessionId());
Map<ResourceId, CurrentState> curStateMap = liveParticipant.getCurrentStateMap();
for (CurrentState curState : curStateMap.values()) {
if (!sessionId.equals(curState.getTypedSessionId())) {
continue;
}
ResourceId resourceId = curState.getResourceId();
StateModelDefId stateModelDefId = curState.getStateModelDefId();
ResourceConfig resource = resourceMap.get(resourceId);
if (resource == null) {
continue;
}