本文整理匯總了Java中com.espertech.esper.client.context.ContextPartitionIdentifier類的典型用法代碼示例。如果您正苦於以下問題:Java ContextPartitionIdentifier類的具體用法?Java ContextPartitionIdentifier怎麽用?Java ContextPartitionIdentifier使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ContextPartitionIdentifier類屬於com.espertech.esper.client.context包,在下文中一共展示了ContextPartitionIdentifier類的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: filter
import com.espertech.esper.client.context.ContextPartitionIdentifier; //導入依賴的package包/類
public boolean filter(ContextPartitionIdentifier contextPartitionIdentifier) {
ContextPartitionIdentifierInitiatedTerminated id = (ContextPartitionIdentifierInitiatedTerminated) contextPartitionIdentifier;
if (matchP00Value == null && cpids.contains(id.getContextPartitionId())) {
throw new RuntimeException("Already exists context id: " + id.getContextPartitionId());
}
cpids.add(id.getContextPartitionId());
startTimes.add(id.getStartTime());
String p00Value = (String) ((EventBean) id.getProperties().get("s0")).get("p00");
p00PropertyValues.add(p00Value);
lastValue = id;
return matchP00Value != null && matchP00Value.equals(p00Value);
}
示例2: visit
import com.espertech.esper.client.context.ContextPartitionIdentifier; //導入依賴的package包/類
public void visit(int nestingLevel, int pathId, ContextStatePathValueBinding binding, Object payload, ContextController contextController, ContextControllerInstanceHandle instanceHandle) {
ContextStatePathKey key = new ContextStatePathKey(nestingLevel, pathId, instanceHandle.getSubPathId());
int maxNestingLevel = nestedFactories.length;
int contextPartitionOrSubPath = instanceHandle.getContextPartitionOrPathId();
if (contextController.getFactory().getFactoryContext().getNestingLevel() == maxNestingLevel) {
List<LeafDesc> agentInstances = controllerAgentInstances.get(contextController);
if (agentInstances == null) {
agentInstances = new ArrayList<LeafDesc>();
controllerAgentInstances.put(contextController, agentInstances);
}
ContextStatePathValue value = new ContextStatePathValue(contextPartitionOrSubPath, binding.toByteArray(payload), instanceHandle.getInstances().getState());
agentInstances.add(new LeafDesc(key, value));
// generate a nice payload text from the paths of keys
ContextControllerTreeEntry entry = subcontexts.get(contextController);
ContextPartitionIdentifier[] keys = ContextManagerNested.getTreeCompositeKey(nestedFactories, payload, entry, subcontexts);
ContextPartitionDescriptor descriptor = new ContextPartitionDescriptor(contextPartitionOrSubPath, new ContextPartitionIdentifierNested(keys), value.getState());
agentInstanceInfo.put(contextPartitionOrSubPath, descriptor);
states.put(key, value);
} else {
// handle non-leaf
subpaths.add(contextPartitionOrSubPath);
states.put(key, new ContextStatePathValue(contextPartitionOrSubPath, binding.toByteArray(payload), ContextPartitionState.STARTED));
}
}
示例3: visit
import com.espertech.esper.client.context.ContextPartitionIdentifier; //導入依賴的package包/類
public void visit(int nestingLevel, int pathId, ContextStatePathValueBinding binding, Object payload, ContextController contextController, ContextControllerInstanceHandle instanceHandle) {
ContextStatePathKey key = new ContextStatePathKey(nestingLevel, pathId, instanceHandle.getSubPathId());
int agentInstanceId = instanceHandle.getContextPartitionOrPathId();
states.put(key, new ContextStatePathValue(agentInstanceId, binding.toByteArray(payload), instanceHandle.getInstances().getState()));
ContextPartitionState state = instanceHandle.getInstances().getState();
ContextPartitionIdentifier identifier = contextController.getFactory().keyPayloadToIdentifier(payload);
ContextPartitionDescriptor descriptor = new ContextPartitionDescriptor(agentInstanceId, identifier, state);
contextPartitionInfo.put(agentInstanceId, descriptor);
}
示例4: contextPartitionInstantiate
import com.espertech.esper.client.context.ContextPartitionIdentifier; //導入依賴的package包/類
public ContextControllerInstanceHandle contextPartitionInstantiate(Integer optionalContextPartitionId,
int subpath,
Integer importSubpathId, ContextController originator, EventBean optionalTriggeringEvent,
Map<String, Object> optionalTriggeringPattern,
Object partitionKey,
Map<String, Object> contextProperties,
ContextControllerState states,
ContextInternalFilterAddendum filterAddendum,
boolean isRecoveringResilient,
ContextPartitionState state,
Supplier<ContextPartitionIdentifier> identifier);
示例5: keyPayloadToIdentifier
import com.espertech.esper.client.context.ContextPartitionIdentifier; //導入依賴的package包/類
public ContextPartitionIdentifier keyPayloadToIdentifier(Object payload) {
ContextControllerInitTermState state = (ContextControllerInitTermState) payload;
return new ContextPartitionIdentifierInitiatedTerminated(
state == null ? null : state.getPatternData(),
state == null ? 0 : state.getStartTime(),
null);
}
示例6: keyPayloadToIdentifier
import com.espertech.esper.client.context.ContextPartitionIdentifier; //導入依賴的package包/類
public ContextPartitionIdentifier keyPayloadToIdentifier(Object payload) {
if (payload instanceof Object[]) {
return new ContextPartitionIdentifierPartitioned((Object[]) payload);
}
if (payload instanceof MultiKeyUntyped) {
return new ContextPartitionIdentifierPartitioned(((MultiKeyUntyped) payload).getKeys());
}
if (payload instanceof ContextControllerPartitionedState) {
return new ContextPartitionIdentifierPartitioned(((ContextControllerPartitionedState) payload).getPartitionKey());
}
return new ContextPartitionIdentifierPartitioned(new Object[]{payload});
}
示例7: filter
import com.espertech.esper.client.context.ContextPartitionIdentifier; //導入依賴的package包/類
public boolean filter(ContextPartitionIdentifier contextPartitionIdentifier) {
ContextPartitionIdentifierInitiatedTerminated id = (ContextPartitionIdentifierInitiatedTerminated) contextPartitionIdentifier;
if (matchP00Value == null && cpids.contains(id.getContextPartitionId())) {
throw new RuntimeException("Already exists context id: " + id.getContextPartitionId());
}
cpids.add(id.getContextPartitionId());
startTimes.add(id.getStartTime());
String p00Value = (String) ((EventBean)id.getProperties().get("s0")).get("p00");
p00PropertyValues.add(p00Value);
lastValue = id;
return matchP00Value != null && matchP00Value.equals(p00Value);
}
示例8: keyPayloadToIdentifier
import com.espertech.esper.client.context.ContextPartitionIdentifier; //導入依賴的package包/類
public ContextPartitionIdentifier keyPayloadToIdentifier(Object payload) {
return new ContextPartitionIdentifierHash((Integer) payload);
}
示例9: keyPayloadToIdentifier
import com.espertech.esper.client.context.ContextPartitionIdentifier; //導入依賴的package包/類
public ContextPartitionIdentifier keyPayloadToIdentifier(Object payload) {
int index = (Integer) payload;
return new ContextPartitionIdentifierCategory(categorySpec.getItems().get(index).getName());
}
示例10: keyPayloadToIdentifier
import com.espertech.esper.client.context.ContextPartitionIdentifier; //導入依賴的package包/類
public ContextPartitionIdentifier keyPayloadToIdentifier(Object payload);
示例11: deletePath
import com.espertech.esper.client.context.ContextPartitionIdentifier; //導入依賴的package包/類
public void deletePath(ContextPartitionIdentifier identifier);