本文整理匯總了Java中com.espertech.esper.epl.spec.SelectClauseStreamSelectorEnum類的典型用法代碼示例。如果您正苦於以下問題:Java SelectClauseStreamSelectorEnum類的具體用法?Java SelectClauseStreamSelectorEnum怎麽用?Java SelectClauseStreamSelectorEnum使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
SelectClauseStreamSelectorEnum類屬於com.espertech.esper.epl.spec包,在下文中一共展示了SelectClauseStreamSelectorEnum類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: hasRelevantResults
import com.espertech.esper.epl.spec.SelectClauseStreamSelectorEnum; //導入依賴的package包/類
private boolean hasRelevantResults(UniformPair<EventBean[]> newOldEvents) {
if (newOldEvents == null) {
return false;
}
if (parent.getSelectClauseStreamSelectorEnum() == SelectClauseStreamSelectorEnum.ISTREAM_ONLY) {
if (newOldEvents.getFirst() == null) {
return false; // nothing to indicate
}
} else if (parent.getSelectClauseStreamSelectorEnum() == SelectClauseStreamSelectorEnum.RSTREAM_ISTREAM_BOTH) {
if (newOldEvents.getFirst() == null && newOldEvents.getSecond() == null) {
return false; // nothing to indicate
}
} else {
if (newOldEvents.getSecond() == null) {
return false; // nothing to indicate
}
}
return true;
}
示例2: setUp
import com.espertech.esper.epl.spec.SelectClauseStreamSelectorEnum; //導入依賴的package包/類
public void setUp() throws Exception
{
List<SelectClauseExprCompiledSpec> selectList = SupportSelectExprFactory.makeNoAggregateSelectList();
EventAdapterService eventAdapterService = SupportEventAdapterService.getService();
SupportValueAddEventService vaeService = new SupportValueAddEventService();
SelectExprEventTypeRegistry selectExprEventTypeRegistry = new SelectExprEventTypeRegistry(new HashSet<String>());
MethodResolutionService methodResolutionService = new MethodResolutionServiceImpl(new EngineImportServiceImpl(true, true, true), null);
methodOne = new SelectExprProcessorHelper(Collections.<Integer>emptyList(), selectList, Collections.<SelectExprStreamDesc>emptyList(), null, false, new SupportStreamTypeSvc1Stream(), eventAdapterService, vaeService, selectExprEventTypeRegistry, methodResolutionService, null, null, new Configuration());
InsertIntoDesc insertIntoDesc = new InsertIntoDesc(SelectClauseStreamSelectorEnum.ISTREAM_ONLY, "Hello");
insertIntoDesc.add("a");
insertIntoDesc.add("b");
methodTwo = new SelectExprProcessorHelper(Collections.<Integer>emptyList(), selectList, Collections.<SelectExprStreamDesc>emptyList(), insertIntoDesc, false, new SupportStreamTypeSvc1Stream(), eventAdapterService, vaeService, selectExprEventTypeRegistry, methodResolutionService, null, null, new Configuration());
}
示例3: output
import com.espertech.esper.epl.spec.SelectClauseStreamSelectorEnum; //導入依賴的package包/類
public void output(boolean forceUpdate, UniformPair<EventBean[]> result, UpdateDispatchView finalView) {
EventBean[] newEvents = result != null ? result.getFirst() : null;
EventBean[] oldEvents = result != null ? result.getSecond() : null;
// route first
if (parent.isRoute()) {
if ((newEvents != null) && (parent.getInsertIntoStreamSelector().isSelectsIStream())) {
route(newEvents, agentInstanceContext);
}
if ((oldEvents != null) && (parent.getInsertIntoStreamSelector().isSelectsRStream())) {
route(oldEvents, agentInstanceContext);
}
}
// discard one side of results
if (parent.getSelectStreamDirEnum() == SelectClauseStreamSelectorEnum.RSTREAM_ONLY) {
newEvents = oldEvents;
oldEvents = null;
} else if (parent.getSelectStreamDirEnum() == SelectClauseStreamSelectorEnum.ISTREAM_ONLY) {
oldEvents = null; // since the insert-into may require rstream
}
// dispatch
if (newEvents != null || oldEvents != null) {
finalView.newResult(new UniformPair<EventBean[]>(newEvents, oldEvents));
} else if (forceUpdate) {
finalView.newResult(new UniformPair<EventBean[]>(null, null));
}
}
示例4: OutputStrategyPostProcessFactory
import com.espertech.esper.epl.spec.SelectClauseStreamSelectorEnum; //導入依賴的package包/類
public OutputStrategyPostProcessFactory(boolean route, SelectClauseStreamSelectorEnum insertIntoStreamSelector, SelectClauseStreamSelectorEnum selectStreamDirEnum, InternalEventRouter internalEventRouter, EPStatementHandle epStatementHandle, boolean addToFront, TableService tableService, String tableName) {
isRoute = route;
this.insertIntoStreamSelector = insertIntoStreamSelector;
this.selectStreamDirEnum = selectStreamDirEnum;
this.internalEventRouter = internalEventRouter;
this.epStatementHandle = epStatementHandle;
this.addToFront = addToFront;
this.tableService = tableService;
this.tableName = tableName;
}
示例5: OutputProcessViewConditionFactory
import com.espertech.esper.epl.spec.SelectClauseStreamSelectorEnum; //導入依賴的package包/類
public OutputProcessViewConditionFactory(StatementContext statementContext, OutputStrategyPostProcessFactory postProcessFactory, boolean distinct, ExprTimePeriod afterTimePeriod, Integer afterConditionNumberOfEvents, EventType resultEventType, OutputConditionFactory outputConditionFactory, int streamCount, ResultSetProcessorOutputConditionType conditionType, OutputLimitLimitType outputLimitLimitType, boolean terminable, boolean hasAfter, boolean isUnaggregatedUngrouped, SelectClauseStreamSelectorEnum selectClauseStreamSelectorEnum, ResultSetProcessorHelperFactory resultSetProcessorHelperFactory) {
super(statementContext, postProcessFactory, resultSetProcessorHelperFactory, distinct, afterTimePeriod, afterConditionNumberOfEvents, resultEventType);
this.outputConditionFactory = outputConditionFactory;
this.streamCount = streamCount;
this.conditionType = conditionType;
this.outputLimitLimitType = outputLimitLimitType;
this.terminable = terminable;
this.hasAfter = hasAfter;
this.isUnaggregatedUngrouped = isUnaggregatedUngrouped;
this.selectClauseStreamSelectorEnum = selectClauseStreamSelectorEnum;
this.resultSetProcessorHelperFactory = resultSetProcessorHelperFactory;
}
示例6: toExpression
import com.espertech.esper.epl.spec.SelectClauseStreamSelectorEnum; //導入依賴的package包/類
public static ExprForge toExpression(String hint, StatementContext statementContext) throws ExprValidationException {
String toCompile = "select * from java.lang.Object#time(" + hint + ")";
StatementSpecRaw raw = EPAdministratorHelper.compileEPL(toCompile, hint, false, null,
SelectClauseStreamSelectorEnum.ISTREAM_ONLY, statementContext.getEngineImportService(),
statementContext.getVariableService(),
statementContext.getEngineURI(), statementContext.getConfigSnapshot(),
new PatternNodeFactoryImpl(), new ContextManagementServiceImpl(statementContext.getEngineURI()),
new ExprDeclaredServiceImpl(), new TableServiceImpl());
ExprNode expr = raw.getStreamSpecs().get(0).getViewSpecs()[0].getObjectParameters().get(0);
ExprNode validated = EPLValidationUtil.validateSimpleGetSubtree(ExprNodeOrigin.HINT, expr, statementContext, OAEXPRESSIONTYPE, false);
return validated.getForge();
}
示例7: newContextInternal
import com.espertech.esper.epl.spec.SelectClauseStreamSelectorEnum; //導入依賴的package包/類
public StatementAgentInstanceFactoryCreateVariableResult newContextInternal(final AgentInstanceContext agentInstanceContext, boolean isRecoveringResilient) {
StopCallback stopCallback = new StopCallback() {
public void stop() {
services.getVariableService().deallocateVariableState(variableMetaData.getVariableName(), agentInstanceContext.getAgentInstanceId());
}
};
services.getVariableService().allocateVariableState(variableMetaData.getVariableName(), agentInstanceContext.getAgentInstanceId(), statementContext.getStatementExtensionServicesContext(), isRecoveringResilient);
final CreateVariableView createView = new CreateVariableView(statementContext.getStatementId(), services.getEventAdapterService(), services.getVariableService(), createDesc.getVariableName(), statementContext.getStatementResultService(), agentInstanceContext.getAgentInstanceId());
services.getVariableService().registerCallback(createDesc.getVariableName(), agentInstanceContext.getAgentInstanceId(), createView);
statementContext.getStatementStopService().addSubscriber(new StatementStopCallback() {
public void statementStopped() {
services.getVariableService().unregisterCallback(createDesc.getVariableName(), 0, createView);
}
});
// Create result set processor, use wildcard selection
statementSpec.getSelectClauseSpec().setSelectExprList(new SelectClauseElementWildcard());
statementSpec.setSelectStreamDirEnum(SelectClauseStreamSelectorEnum.RSTREAM_ISTREAM_BOTH);
StreamTypeService typeService = new StreamTypeServiceImpl(new EventType[]{createView.getEventType()}, new String[]{"create_variable"}, new boolean[]{true}, services.getEngineURI(), false, false);
OutputProcessViewBase outputViewBase;
try {
ResultSetProcessorFactoryDesc resultSetProcessorPrototype = ResultSetProcessorFactoryFactory.getProcessorPrototype(
statementSpec, statementContext, typeService, null, new boolean[0], true, ContextPropertyRegistryImpl.EMPTY_REGISTRY, null, services.getConfigSnapshot(), services.getResultSetProcessorHelperFactory(), false, false);
ResultSetProcessor resultSetProcessor = EPStatementStartMethodHelperAssignExpr.getAssignResultSetProcessor(agentInstanceContext, resultSetProcessorPrototype, false, null, false);
// Attach output view
OutputProcessViewFactory outputViewFactory = OutputProcessViewFactoryFactory.make(statementSpec, services.getInternalEventRouter(), agentInstanceContext.getStatementContext(), resultSetProcessorPrototype.getResultEventType(), null, services.getTableService(), resultSetProcessorPrototype.getResultSetProcessorType(), services.getResultSetProcessorHelperFactory(), services.getStatementVariableRefService());
outputViewBase = outputViewFactory.makeView(resultSetProcessor, agentInstanceContext);
createView.addView(outputViewBase);
} catch (ExprValidationException ex) {
throw new EPException("Unexpected exception in create-variable context allocation: " + ex.getMessage(), ex);
}
return new StatementAgentInstanceFactoryCreateVariableResult(outputViewBase, stopCallback, agentInstanceContext);
}
示例8: createEPLStatementId
import com.espertech.esper.epl.spec.SelectClauseStreamSelectorEnum; //導入依賴的package包/類
public EPStatement createEPLStatementId(String eplStatement, String statementName, Object userObject, Integer optionalStatementId) throws EPException {
SelectClauseStreamSelectorEnum defaultStreamSelector = StatementSpecMapper.mapFromSODA(unisolatedServices.getConfigSnapshot().getEngineDefaults().getStreamSelection().getDefaultStreamSelector());
StatementSpecRaw statementSpec = EPAdministratorHelper.compileEPL(eplStatement, eplStatement, true, statementName, unisolatedServices, defaultStreamSelector);
EPStatement statement = unisolatedServices.getStatementLifecycleSvc().createAndStart(statementSpec, eplStatement, false, statementName, userObject, services, optionalStatementId, null);
EPStatementSPI stmtSpi = (EPStatementSPI) statement;
stmtSpi.getStatementContext().setInternalEventEngineRouteDest(isolatedRuntime);
stmtSpi.setServiceIsolated(isolatedServiceName);
statementNames.add(stmtSpi.getName());
return statement;
}
示例9: setUp
import com.espertech.esper.epl.spec.SelectClauseStreamSelectorEnum; //導入依賴的package包/類
public void setUp() throws Exception {
List<SelectClauseExprCompiledSpec> selectList = SupportSelectExprFactory.makeNoAggregateSelectList();
EventAdapterService eventAdapterService = SupportEventAdapterService.getService();
SupportValueAddEventService vaeService = new SupportValueAddEventService();
SelectExprEventTypeRegistry selectExprEventTypeRegistry = new SelectExprEventTypeRegistry("abc", new StatementEventTypeRefImpl());
EngineImportService engineImportService = SupportEngineImportServiceFactory.make();
methodOne = new SelectExprProcessorHelper(Collections.<Integer>emptyList(), selectList, Collections.<SelectExprStreamDesc>emptyList(), null, null, false, new SupportStreamTypeSvc1Stream(), eventAdapterService, vaeService, selectExprEventTypeRegistry, engineImportService, 1, "stmtname", null, new Configuration(), null, new TableServiceImpl(), null);
InsertIntoDesc insertIntoDesc = new InsertIntoDesc(SelectClauseStreamSelectorEnum.ISTREAM_ONLY, "Hello");
insertIntoDesc.add("a");
insertIntoDesc.add("b");
methodTwo = new SelectExprProcessorHelper(Collections.<Integer>emptyList(), selectList, Collections.<SelectExprStreamDesc>emptyList(), insertIntoDesc, null, false, new SupportStreamTypeSvc1Stream(), eventAdapterService, vaeService, selectExprEventTypeRegistry, engineImportService, 1, "stmtname", null, new Configuration(), null, new TableServiceImpl(), null);
}
示例10: output
import com.espertech.esper.epl.spec.SelectClauseStreamSelectorEnum; //導入依賴的package包/類
public void output(boolean forceUpdate, UniformPair<EventBean[]> result, UpdateDispatchView finalView)
{
EventBean[] newEvents = result != null ? result.getFirst() : null;
EventBean[] oldEvents = result != null ? result.getSecond() : null;
// route first
if (parent.isRoute())
{
if ((newEvents != null) && (parent.getInsertIntoStreamSelector().isSelectsIStream()))
{
route(newEvents, agentInstanceContext);
}
if ((oldEvents != null) && (parent.getInsertIntoStreamSelector().isSelectsRStream()))
{
route(oldEvents, agentInstanceContext);
}
}
// discard one side of results
if (parent.getSelectStreamDirEnum() == SelectClauseStreamSelectorEnum.RSTREAM_ONLY)
{
newEvents = oldEvents;
oldEvents = null;
}
else if (parent.getSelectStreamDirEnum() == SelectClauseStreamSelectorEnum.ISTREAM_ONLY)
{
oldEvents = null; // since the insert-into may require rstream
}
// dispatch
if(newEvents != null || oldEvents != null)
{
finalView.newResult(new UniformPair<EventBean[]>(newEvents, oldEvents));
}
else if(forceUpdate)
{
finalView.newResult(new UniformPair<EventBean[]>(null, null));
}
}
示例11: OutputStrategyPostProcessFactory
import com.espertech.esper.epl.spec.SelectClauseStreamSelectorEnum; //導入依賴的package包/類
public OutputStrategyPostProcessFactory(boolean route, SelectClauseStreamSelectorEnum insertIntoStreamSelector, SelectClauseStreamSelectorEnum selectStreamDirEnum, InternalEventRouter internalEventRouter, EPStatementHandle epStatementHandle, boolean addToFront) {
isRoute = route;
this.insertIntoStreamSelector = insertIntoStreamSelector;
this.selectStreamDirEnum = selectStreamDirEnum;
this.internalEventRouter = internalEventRouter;
this.epStatementHandle = epStatementHandle;
this.addToFront = addToFront;
}
示例12: createEPLStatementId
import com.espertech.esper.epl.spec.SelectClauseStreamSelectorEnum; //導入依賴的package包/類
public EPStatement createEPLStatementId(String eplStatement, String statementName, Object userObject, String statementId) throws EPException
{
SelectClauseStreamSelectorEnum defaultStreamSelector = SelectClauseStreamSelectorEnum.mapFromSODA(unisolatedServices.getConfigSnapshot().getEngineDefaults().getStreamSelection().getDefaultStreamSelector());
StatementSpecRaw statementSpec = EPAdministratorHelper.compileEPL(eplStatement, eplStatement, true, statementName, unisolatedServices, defaultStreamSelector);
EPStatement statement = unisolatedServices.getStatementLifecycleSvc().createAndStart(statementSpec, eplStatement, false, statementName, userObject, services, statementId, null);
EPStatementSPI stmtSpi = (EPStatementSPI) statement;
stmtSpi.getStatementContext().setInternalEventEngineRouteDest(isolatedRuntime);
stmtSpi.setServiceIsolated(isolatedServiceName);
statementNames.add(stmtSpi.getName());
return statement;
}
示例13: EPAdministratorContext
import com.espertech.esper.epl.spec.SelectClauseStreamSelectorEnum; //導入依賴的package包/類
/**
* Ctor.
* @param runtimeSPI
* @param services engine services
* @param configurationOperations configuration snapshot
* @param defaultStreamSelector default stream selection
*/
public EPAdministratorContext(EPRuntimeSPI runtimeSPI, EPServicesContext services, ConfigurationOperations configurationOperations, SelectClauseStreamSelectorEnum defaultStreamSelector)
{
this.runtimeSPI = runtimeSPI;
this.configurationOperations = configurationOperations;
this.defaultStreamSelector = defaultStreamSelector;
this.services = services;
}
示例14: getInsertIntoStreamSelector
import com.espertech.esper.epl.spec.SelectClauseStreamSelectorEnum; //導入依賴的package包/類
public SelectClauseStreamSelectorEnum getInsertIntoStreamSelector() {
return insertIntoStreamSelector;
}
示例15: getSelectStreamDirEnum
import com.espertech.esper.epl.spec.SelectClauseStreamSelectorEnum; //導入依賴的package包/類
public SelectClauseStreamSelectorEnum getSelectStreamDirEnum() {
return selectStreamDirEnum;
}