本文整理汇总了Java中com.espertech.esper.epl.spec.ContextDetailCategoryItem类的典型用法代码示例。如果您正苦于以下问题:Java ContextDetailCategoryItem类的具体用法?Java ContextDetailCategoryItem怎么用?Java ContextDetailCategoryItem使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ContextDetailCategoryItem类属于com.espertech.esper.epl.spec包,在下文中一共展示了ContextDetailCategoryItem类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deletePath
import com.espertech.esper.epl.spec.ContextDetailCategoryItem; //导入依赖的package包/类
public void deletePath(ContextPartitionIdentifier identifier) {
ContextPartitionIdentifierCategory category = (ContextPartitionIdentifierCategory) identifier;
int count = 0;
for (ContextDetailCategoryItem cat : factory.getCategorySpec().getItems()) {
if (cat.getName().equals(category.getLabel())) {
handleCategories.remove(count);
break;
}
count++;
}
}
示例2: activate
import com.espertech.esper.epl.spec.ContextDetailCategoryItem; //导入依赖的package包/类
public void activate(EventBean optionalTriggeringEvent, Map<String, Object> optionalTriggeringPattern, ContextControllerState controllerState, ContextInternalFilterAddendum activationFilterAddendum, Integer importPathId) {
if (factory.getFactoryContext().getNestingLevel() == 1) {
controllerState = ContextControllerStateUtil.getRecoveryStates(factory.getFactoryContext().getStateCache(), factory.getFactoryContext().getOutermostContextName());
}
if (controllerState == null) {
int count = 0;
for (ContextDetailCategoryItem category : factory.getCategorySpec().getItems()) {
Map<String, Object> context = ContextPropertyEventType.getCategorizedBean(factory.getFactoryContext().getContextName(), 0, category.getName());
currentSubpathId++;
// merge filter addendum, if any
ContextInternalFilterAddendum filterAddendumToUse = activationFilterAddendum;
if (factory.hasFiltersSpecsNestedContexts()) {
filterAddendumToUse = activationFilterAddendum != null ? activationFilterAddendum.deepCopy() : new ContextInternalFilterAddendum();
factory.populateContextInternalFilterAddendums(filterAddendumToUse, count);
}
ContextControllerInstanceHandle handle = activationCallback.contextPartitionInstantiate(null, currentSubpathId, null, this, optionalTriggeringEvent, optionalTriggeringPattern, count, context, controllerState, filterAddendumToUse, factory.getFactoryContext().isRecoveringResilient(), ContextPartitionState.STARTED, () -> new ContextPartitionIdentifierCategory(category.getName()));
handleCategories.put(count, handle);
factory.getFactoryContext().getStateCache().addContextPath(factory.getFactoryContext().getOutermostContextName(), factory.getFactoryContext().getNestingLevel(), pathId, currentSubpathId, handle.getContextPartitionOrPathId(), count, factory.getBinding());
count++;
}
return;
}
int pathIdToUse = importPathId != null ? importPathId : pathId;
initializeFromState(optionalTriggeringEvent, optionalTriggeringPattern, activationFilterAddendum, controllerState, pathIdToUse, null, false);
}
示例3: addAddendums
import com.espertech.esper.epl.spec.ContextDetailCategoryItem; //导入依赖的package包/类
private static void addAddendums(IdentityHashMap<FilterSpecCompiled, FilterValueSetParam[][]> addendums, FilterSpecCompiled filtersSpec, ContextDetailCategoryItem category, ContextDetailCategory categorySpec) {
FilterValueSetParam[][] categoryEventFilters = categorySpec.getFilterParamsCompiled();
FilterValueSetParam[][] categoryItemFilters = category.getCompiledFilterParam();
FilterValueSetParam[][] addendum = FilterAddendumUtil.multiplyAddendum(categoryEventFilters, categoryItemFilters);
FilterValueSetParam[][] existingFilters = addendums.get(filtersSpec);
if (existingFilters != null) {
addendum = FilterAddendumUtil.multiplyAddendum(existingFilters, addendum);
}
addendums.put(filtersSpec, addendum);
}
示例4: findCategoryForName
import com.espertech.esper.epl.spec.ContextDetailCategoryItem; //导入依赖的package包/类
private ContextDetailCategoryItem findCategoryForName(String categoryLabel) {
for (ContextDetailCategoryItem item : categorySpec.getItems()) {
if (item.getName().equals(categoryLabel)) {
return item;
}
}
throw new IllegalStateException("Failed to find category '" + categoryLabel + "'");
}
示例5: getSelectedContextPartitionPathIds
import com.espertech.esper.epl.spec.ContextDetailCategoryItem; //导入依赖的package包/类
public Collection<Integer> getSelectedContextPartitionPathIds(ContextPartitionSelector contextPartitionSelector) {
if (contextPartitionSelector instanceof ContextPartitionSelectorFiltered) {
ContextPartitionSelectorFiltered filter = (ContextPartitionSelectorFiltered) contextPartitionSelector;
ContextPartitionIdentifierCategory identifier = new ContextPartitionIdentifierCategory();
List<Integer> accepted = new ArrayList<Integer>();
for (Map.Entry<Integer, ContextControllerInstanceHandle> entry : handleCategories.entrySet()) {
identifier.setContextPartitionId(entry.getValue().getContextPartitionOrPathId());
identifier.setLabel(factory.getCategorySpec().getItems().get(entry.getKey()).getName());
if (filter.filter(identifier)) {
accepted.add(entry.getValue().getContextPartitionOrPathId());
}
}
return accepted;
}
if (contextPartitionSelector instanceof ContextPartitionSelectorCategory) {
ContextPartitionSelectorCategory category = (ContextPartitionSelectorCategory) contextPartitionSelector;
if (category.getLabels() == null || category.getLabels().isEmpty()) {
return Collections.emptyList();
}
List<Integer> items = new ArrayList<Integer>();
int count = 0;
for (ContextDetailCategoryItem item : factory.getCategorySpec().getItems()) {
if (category.getLabels().contains(item.getName())) {
ContextControllerInstanceHandle handle = handleCategories.get(count);
if (handle != null) {
items.add(handle.getContextPartitionOrPathId());
}
}
count++;
}
return items;
}
throw ContextControllerSelectorUtil.getInvalidSelector(new Class[] {ContextPartitionSelectorCategory.class}, contextPartitionSelector);
}
示例6: initializeFromState
import com.espertech.esper.epl.spec.ContextDetailCategoryItem; //导入依赖的package包/类
private void initializeFromState(EventBean optionalTriggeringEvent,
Map<String, Object> optionalTriggeringPattern,
ContextInternalFilterAddendum activationFilterAddendum,
ContextControllerState controllerState,
int pathIdToUse,
AgentInstanceSelector agentInstanceSelector,
boolean loadingExistingState) {
TreeMap<ContextStatePathKey, ContextStatePathValue> states = controllerState.getStates();
NavigableMap<ContextStatePathKey, ContextStatePathValue> childContexts = ContextControllerStateUtil.getChildContexts(factory.getFactoryContext(), pathIdToUse, states);
int maxSubpathId = Integer.MIN_VALUE;
for (Map.Entry<ContextStatePathKey, ContextStatePathValue> entry : childContexts.entrySet()) {
int categoryNumber = (Integer) factory.getBinding().byteArrayToObject(entry.getValue().getBlob(), null);
ContextDetailCategoryItem category = factory.getCategorySpec().getItems().get(categoryNumber);
// merge filter addendum, if any
ContextInternalFilterAddendum filterAddendumToUse = activationFilterAddendum;
if (factory.hasFiltersSpecsNestedContexts()) {
filterAddendumToUse = activationFilterAddendum != null ? activationFilterAddendum.deepCopy() : new ContextInternalFilterAddendum();
factory.populateContextInternalFilterAddendums(filterAddendumToUse, categoryNumber);
}
// check if exists already
if (controllerState.isImported()) {
ContextControllerInstanceHandle existingHandle = handleCategories.get(categoryNumber);
if (existingHandle != null) {
activationCallback.contextPartitionNavigate(existingHandle, this, controllerState, entry.getValue().getOptionalContextPartitionId(), filterAddendumToUse, agentInstanceSelector, entry.getValue().getBlob(), loadingExistingState);
continue;
}
}
Map<String, Object> context = ContextPropertyEventType.getCategorizedBean(factory.getFactoryContext().getContextName(), 0, category.getName());
int contextPartitionId = entry.getValue().getOptionalContextPartitionId();
int assignedSubPathId = !controllerState.isImported() ? entry.getKey().getSubPath() : ++currentSubpathId;
ContextControllerInstanceHandle handle = activationCallback.contextPartitionInstantiate(contextPartitionId, assignedSubPathId, entry.getKey().getSubPath(), this, null, null, categoryNumber, context, controllerState, filterAddendumToUse, loadingExistingState || factory.getFactoryContext().isRecoveringResilient(), entry.getValue().getState(), () -> new ContextPartitionIdentifierCategory(category.getName()));
handleCategories.put(categoryNumber, handle);
if (entry.getKey().getSubPath() > maxSubpathId) {
maxSubpathId = assignedSubPathId;
}
}
if (!controllerState.isImported()) {
currentSubpathId = maxSubpathId != Integer.MIN_VALUE ? maxSubpathId : 0;
}
}
示例7: populateFilterAddendums
import com.espertech.esper.epl.spec.ContextDetailCategoryItem; //导入依赖的package包/类
public void populateFilterAddendums(IdentityHashMap<FilterSpecCompiled, FilterValueSetParam[][]> filterAddendum, ContextControllerStatementDesc statement, Object categoryIndex, int contextId) {
ContextControllerStatementCtxCacheFilters statementInfo = (ContextControllerStatementCtxCacheFilters) statement.getCaches()[factoryContext.getNestingLevel() - 1];
ContextDetailCategoryItem category = categorySpec.getItems().get((Integer) categoryIndex);
getAddendumFilters(filterAddendum, category, categorySpec, statementInfo.getFilterSpecs(), statement);
}
示例8: populateContextInternalFilterAddendums
import com.espertech.esper.epl.spec.ContextDetailCategoryItem; //导入依赖的package包/类
public void populateContextInternalFilterAddendums(ContextInternalFilterAddendum filterAddendum, Object categoryIndex) {
ContextDetailCategoryItem category = categorySpec.getItems().get((Integer) categoryIndex);
getAddendumFilters(filterAddendum.getFilterAddendum(), category, categorySpec, filtersSpecsNestedContexts, null);
}
示例9: populateFilterAddendums
import com.espertech.esper.epl.spec.ContextDetailCategoryItem; //导入依赖的package包/类
public void populateFilterAddendums(IdentityHashMap<FilterSpecCompiled, List<FilterValueSetParam>> filterAddendum, ContextControllerStatementDesc statement, Object categoryLabel, int contextId) {
ContextControllerStatementCtxCacheFilters statementInfo = (ContextControllerStatementCtxCacheFilters) statement.getCaches()[factoryContext.getNestingLevel() - 1];
ContextDetailCategoryItem category = findCategoryForName((String) categoryLabel);
getAddendumFilters(filterAddendum, category, categorySpec, statementInfo.getFilterSpecs(), statement);
}
示例10: populateContextInternalFilterAddendums
import com.espertech.esper.epl.spec.ContextDetailCategoryItem; //导入依赖的package包/类
public void populateContextInternalFilterAddendums(ContextInternalFilterAddendum filterAddendum, Object categoryLabel) {
ContextDetailCategoryItem category = findCategoryForName((String) categoryLabel);
getAddendumFilters(filterAddendum.getFilterAddendum(), category, categorySpec, filtersSpecsNestedContexts, null);
}