本文整理匯總了Java中com.espertech.esper.util.AuditPath類的典型用法代碼示例。如果您正苦於以下問題:Java AuditPath類的具體用法?Java AuditPath怎麽用?Java AuditPath使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
AuditPath類屬於com.espertech.esper.util包,在下文中一共展示了AuditPath類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: print
import com.espertech.esper.util.AuditPath; //導入依賴的package包/類
private static void print(EvalAuditStateNode current, String patternExpression, String engineURI, String statementName, boolean added, int count) {
if (!AuditPath.isInfoEnabled()) {
return;
}
StringWriter writer = new StringWriter();
EvalAuditStateNode.writePatternExpr(current, patternExpression, writer);
if (added) {
writer.write(" increased to " + count);
} else {
writer.write(" decreased to " + count);
}
AuditPath.auditLog(engineURI, statementName, AuditEnum.PATTERNINSTANCES, writer.toString());
}
示例2: invoke
import com.espertech.esper.util.AuditPath; //導入依賴的package包/類
public Object invoke(Object proxy, Method m, Object[] args)
throws Throwable {
if (m.getName().equals("insert")) {
if (AuditPath.isInfoEnabled()) {
Object arg = args[0];
String events = "(undefined)";
if (arg instanceof EventBean[]) {
events = EventBeanSummarizer.summarize((EventBean[]) arg);
} else if (arg instanceof EventBean) {
events = EventBeanSummarizer.summarize((EventBean) arg);
}
AuditPath.auditLog(engineURI, statementName, AuditEnum.STREAM, eventTypeAndFilter + " inserted " + events);
}
}
return m.invoke(eventStream, args);
}
示例3: update
import com.espertech.esper.util.AuditPath; //導入依賴的package包/類
public void update(EventBean[] newData, EventBean[] oldData) {
if (audit) {
if (AuditPath.isInfoEnabled()) {
AuditPath.auditLog(exprEvaluatorContext.getEngineURI(), exprEvaluatorContext.getStatementName(), AuditEnum.STREAM, eventType.getName() + " insert {" + EventBeanSummarizer.summarize(newData) + "} remove {" + EventBeanSummarizer.summarize(oldData) + "}");
}
}
// if we have a filter for the named window,
if (filterList.length != 0) {
EventBean[] eventPerStream = new EventBean[1];
newData = passFilter(newData, true, exprEvaluatorContext, eventPerStream);
oldData = passFilter(oldData, false, exprEvaluatorContext, eventPerStream);
}
if (optPropertyEvaluator != null) {
newData = getUnpacked(newData);
oldData = getUnpacked(oldData);
}
if ((newData != null) || (oldData != null)) {
updateChildren(newData, oldData);
}
}
示例4: apply
import com.espertech.esper.util.AuditPath; //導入依賴的package包/類
public void apply(EventBean matchingEvent, EventBean[] eventsPerStream, OneEventCollection newData, OneEventCollection oldData, ExprEvaluatorContext exprEvaluatorContext) {
EventBean theEvent = insertHelper.process(eventsPerStream, true, true, exprEvaluatorContext);
if (insertIntoTableName != null) {
TableStateInstance tableStateInstance = tableService.getState(insertIntoTableName, exprEvaluatorContext.getAgentInstanceId());
if (audit) {
AuditPath.auditInsertInto(tableStateInstance.getAgentInstanceContext().getEngineURI(), statementHandle.getStatementName(), theEvent);
}
tableStateInstance.addEventUnadorned(theEvent);
return;
}
if (internalEventRouter == null) {
newData.add(theEvent);
return;
}
if (audit) {
AuditPath.auditInsertInto(internalEventRouteDest.getEngineURI(), statementHandle.getStatementName(), theEvent);
}
internalEventRouter.route(theEvent, statementHandle, internalEventRouteDest, exprEvaluatorContext, false);
}
示例5: route
import com.espertech.esper.util.AuditPath; //導入依賴的package包/類
private void route(EventBean[] events, ExprEvaluatorContext exprEvaluatorContext) {
for (EventBean routed : events) {
if (routed instanceof NaturalEventBean) {
NaturalEventBean natural = (NaturalEventBean) routed;
if (audit) {
AuditPath.auditInsertInto(agentInstanceContext.getEngineURI(), agentInstanceContext.getStatementName(), natural.getOptionalSynthetic());
}
if (tableStateInstance != null) {
tableStateInstance.addEventUnadorned(natural.getOptionalSynthetic());
} else {
parent.getInternalEventRouter().route(natural.getOptionalSynthetic(), parent.getEpStatementHandle(), agentInstanceContext.getStatementContext().getInternalEventEngineRouteDest(), exprEvaluatorContext, parent.isAddToFront());
}
} else {
if (audit) {
AuditPath.auditInsertInto(agentInstanceContext.getEngineURI(), agentInstanceContext.getStatementName(), routed);
}
if (tableStateInstance != null) {
ExprTableEvalLockUtil.obtainLockUnless(tableStateInstance.getTableLevelRWLock().writeLock(), exprEvaluatorContext);
tableStateInstance.addEventUnadorned(routed);
} else {
parent.getInternalEventRouter().route(routed, parent.getEpStatementHandle(), agentInstanceContext.getStatementContext().getInternalEventEngineRouteDest(), exprEvaluatorContext, parent.isAddToFront());
}
}
}
}
示例6: apply
import com.espertech.esper.util.AuditPath; //導入依賴的package包/類
public void apply(EventBean matchingEvent, EventBean[] eventsPerStream, TableStateInstance tableStateInstance, TableOnMergeViewChangeHandler changeHandlerAdded, TableOnMergeViewChangeHandler changeHandlerRemoved, ExprEvaluatorContext exprEvaluatorContext) {
EventBean theEvent = insertHelper.process(eventsPerStream, true, true, exprEvaluatorContext);
if (internalEventRouter == null) {
AggregationRowPair aggs = tableStateRowFactory.makeAggs(exprEvaluatorContext.getAgentInstanceId(), null, null, tableStateInstance.getAggregationServicePassThru());
((Object[]) theEvent.getUnderlying())[0] = aggs;
tableStateInstance.addEvent(theEvent);
if (changeHandlerAdded != null) {
changeHandlerAdded.add(theEvent, eventsPerStream, true, exprEvaluatorContext);
}
return;
}
if (audit) {
AuditPath.auditInsertInto(internalEventRouteDest.getEngineURI(), statementHandle.getStatementName(), theEvent);
}
internalEventRouter.route(theEvent, statementHandle, internalEventRouteDest, exprEvaluatorContext, false);
}
示例7: evaluateInternal
import com.espertech.esper.util.AuditPath; //導入依賴的package包/類
protected long evaluateInternal(EventBean theEvent, Collection<FilterHandle> matches) {
if (InstrumentationHelper.ENABLED) {
InstrumentationHelper.get().qFilter(theEvent);
}
long version = filtersVersion;
numEventsEvaluated.incrementAndGet();
// Finds all matching filters and return their callbacks.
retryableMatchEvent(theEvent, matches);
if ((AuditPath.isAuditEnabled) && (!filterServiceListeners.isEmpty())) {
for (FilterServiceListener listener : filterServiceListeners) {
listener.filtering(theEvent, matches, null);
}
}
if (InstrumentationHelper.ENABLED) {
InstrumentationHelper.get().aFilter(matches);
}
return version;
}
示例8: newContext
import com.espertech.esper.util.AuditPath; //導入依賴的package包/類
public StatementAgentInstanceFactoryResult newContext(final AgentInstanceContext agentInstanceContext, boolean isRecoveringResilient) {
if (!audit || agentInstanceContext.getAgentInstanceId() == -1) {
return newContextInternal(agentInstanceContext, isRecoveringResilient);
}
AuditPath.auditContextPartition(agentInstanceContext.getEngineURI(), agentInstanceContext.getStatementName(), true, agentInstanceContext.getAgentInstanceId());
StatementAgentInstanceFactoryResult result = newContextInternal(agentInstanceContext, isRecoveringResilient);
final StopCallback stopCallback = result.getStopCallback();
result.setStopCallback(new StopCallback() {
public void stop() {
AuditPath.auditContextPartition(agentInstanceContext.getEngineURI(), agentInstanceContext.getStatementName(), false, agentInstanceContext.getAgentInstanceId());
stopCallback.stop();
}
});
return result;
}
示例9: print
import com.espertech.esper.util.AuditPath; //導入依賴的package包/類
private static void print(EvalAuditStateNode current, String patternExpression, String engineURI, String statementName, boolean added, int count) {
if (!AuditPath.isInfoEnabled()) {
return;
}
StringWriter writer = new StringWriter();
EvalAuditStateNode.writePatternExpr(current, patternExpression, writer);
if (added) {
writer.write(" increased to " + count);
}
else {
writer.write(" decreased to " + count);
}
AuditPath.auditLog(engineURI, statementName, AuditEnum.PATTERNINSTANCES, writer.toString());
}
示例10: invoke
import com.espertech.esper.util.AuditPath; //導入依賴的package包/類
public Object invoke(Object proxy, Method m, Object[] args)
throws Throwable {
if (m.getName().equals("insert")) {
if (AuditPath.isInfoEnabled()) {
Object arg = args[0];
String events = "(undefined)";
if (arg instanceof EventBean[]) {
events = EventBeanUtility.summarize((EventBean[]) arg);
}
else if (arg instanceof EventBean) {
events = EventBeanUtility.summarize((EventBean) arg);
}
AuditPath.auditLog(engineURI, statementName, AuditEnum.STREAM, eventTypeAndFilter + " inserted " + events);
}
}
return m.invoke(eventStream, args);
}
示例11: update
import com.espertech.esper.util.AuditPath; //導入依賴的package包/類
public void update(EventBean[] newData, EventBean[] oldData)
{
if (audit) {
if (AuditPath.isInfoEnabled()) {
AuditPath.auditLog(exprEvaluatorContext.getEngineURI(), exprEvaluatorContext.getStatementName(), AuditEnum.STREAM, eventType.getName() + " insert {" + EventBeanUtility.summarize(newData) + "} remove {" + EventBeanUtility.summarize(oldData) + "}");
}
}
// if we have a filter for the named window,
if (filterList.length != 0)
{
EventBean[] eventPerStream = new EventBean[1];
newData = passFilter(newData, true, exprEvaluatorContext, eventPerStream);
oldData = passFilter(oldData, false, exprEvaluatorContext, eventPerStream);
}
if (optPropertyEvaluator != null) {
newData = getUnpacked(newData);
oldData = getUnpacked(oldData);
}
if ((newData != null) || (oldData != null))
{
updateChildren(newData, oldData);
}
}
示例12: route
import com.espertech.esper.util.AuditPath; //導入依賴的package包/類
private void route(EventBean[] events, ExprEvaluatorContext exprEvaluatorContext)
{
for (EventBean routed : events) {
if (routed instanceof NaturalEventBean) {
NaturalEventBean natural = (NaturalEventBean) routed;
if (audit) {
AuditPath.auditInsertInto(agentInstanceContext.getEngineURI(), agentInstanceContext.getStatementName(), natural.getOptionalSynthetic());
}
parent.getInternalEventRouter().route(natural.getOptionalSynthetic(), parent.getEpStatementHandle(), agentInstanceContext.getStatementContext().getInternalEventEngineRouteDest(), exprEvaluatorContext, parent.isAddToFront());
}
else {
if (audit) {
AuditPath.auditInsertInto(agentInstanceContext.getEngineURI(), agentInstanceContext.getStatementName(), routed);
}
parent.getInternalEventRouter().route(routed, parent.getEpStatementHandle(), agentInstanceContext.getStatementContext().getInternalEventEngineRouteDest(), exprEvaluatorContext, parent.isAddToFront());
}
}
}
示例13: evaluate
import com.espertech.esper.util.AuditPath; //導入依賴的package包/類
public final long evaluate(EventBean theEvent, Collection<FilterHandle> matches)
{
long version = filtersVersion;
numEventsEvaluated.incrementAndGet();
// Finds all matching filters and return their callbacks
eventTypeIndex.matchEvent(theEvent, matches);
if ((AuditPath.isAuditEnabled) && (!filterServiceListeners.isEmpty())) {
for (FilterServiceListener listener : filterServiceListeners) {
listener.filtering(theEvent, matches, null);
}
}
return version;
}
示例14: evaluateTrue
import com.espertech.esper.util.AuditPath; //導入依賴的package包/類
public final void evaluateTrue(MatchedEventMap matchEvent, EvalStateNode fromNode, boolean isQuitted, EventBean optionalTriggeringEvent) {
if (evalAuditNode.getFactoryNode().isAuditPattern() && AuditPath.isInfoEnabled()) {
String message = toStringEvaluateTrue(this, evalAuditNode.getFactoryNode().getPatternExpr(), matchEvent, fromNode, isQuitted);
AuditPath.auditLog(evalAuditNode.getContext().getStatementContext().getEngineURI(), evalAuditNode.getContext().getPatternContext().getStatementName(), AuditEnum.PATTERN, message);
}
this.getParentEvaluator().evaluateTrue(matchEvent, this, isQuitted, optionalTriggeringEvent);
if (isQuitted) {
evalAuditNode.getFactoryNode().decreaseRefCount(this, evalAuditNode.getContext().getPatternContext());
}
}
示例15: evaluateFalse
import com.espertech.esper.util.AuditPath; //導入依賴的package包/類
public final void evaluateFalse(EvalStateNode fromNode, boolean restartable) {
if (evalAuditNode.getFactoryNode().isAuditPattern() && AuditPath.isInfoEnabled()) {
String message = toStringEvaluateFalse(this, evalAuditNode.getFactoryNode().getPatternExpr(), fromNode);
AuditPath.auditLog(evalAuditNode.getContext().getStatementContext().getEngineURI(), evalAuditNode.getContext().getPatternContext().getStatementName(), AuditEnum.PATTERN, message);
}
evalAuditNode.getFactoryNode().decreaseRefCount(this, evalAuditNode.getContext().getPatternContext());
this.getParentEvaluator().evaluateFalse(this, restartable);
}