本文整理汇总了Java中com.espertech.esper.collection.ArrayBackedCollection类的典型用法代码示例。如果您正苦于以下问题:Java ArrayBackedCollection类的具体用法?Java ArrayBackedCollection怎么用?Java ArrayBackedCollection使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ArrayBackedCollection类属于com.espertech.esper.collection包,在下文中一共展示了ArrayBackedCollection类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initThreadLocals
import com.espertech.esper.collection.ArrayBackedCollection; //导入依赖的package包/类
private void initThreadLocals() {
matchesPerStmtThreadLocal =
new ThreadLocal<Map<EPStatementAgentInstanceHandle, ArrayDeque<FilterHandleCallback>>>() {
protected synchronized Map<EPStatementAgentInstanceHandle, ArrayDeque<FilterHandleCallback>> initialValue() {
if (isPrioritized) {
return new TreeMap<EPStatementAgentInstanceHandle, ArrayDeque<FilterHandleCallback>>(EPStatementAgentInstanceHandleComparator.INSTANCE);
} else {
return new HashMap<EPStatementAgentInstanceHandle, ArrayDeque<FilterHandleCallback>>();
}
}
};
schedulePerStmtThreadLocal = new ThreadLocal<Map<EPStatementAgentInstanceHandle, Object>>() {
protected synchronized Map<EPStatementAgentInstanceHandle, Object> initialValue() {
if (isPrioritized) {
return new TreeMap<EPStatementAgentInstanceHandle, Object>(EPStatementAgentInstanceHandleComparator.INSTANCE);
} else {
return new HashMap<EPStatementAgentInstanceHandle, Object>();
}
}
};
matchesArrayThreadLocal = new ThreadLocal<ArrayBackedCollection<FilterHandle>>() {
protected synchronized ArrayBackedCollection<FilterHandle> initialValue() {
return new ArrayBackedCollection<FilterHandle>(100);
}
};
scheduleArrayThreadLocal = new ThreadLocal<ArrayBackedCollection<ScheduleHandle>>() {
protected synchronized ArrayBackedCollection<ScheduleHandle> initialValue() {
return new ArrayBackedCollection<ScheduleHandle>(100);
}
};
}
示例2: processSchedule
import com.espertech.esper.collection.ArrayBackedCollection; //导入依赖的package包/类
private void processSchedule(long time) {
if (InstrumentationHelper.ENABLED) {
InstrumentationHelper.get().qTime(time, services.getEngineURI());
}
ArrayBackedCollection<ScheduleHandle> handles = scheduleArrayThreadLocal.get();
// Evaluation of schedules is protected by an optional scheduling service lock and then the engine lock
// We want to stay in this order for allowing the engine lock as a second-order lock to the
// services own lock, if it has one.
services.getEventProcessingRWLock().acquireReadLock();
try {
services.getSchedulingService().evaluate(handles);
} finally {
services.getEventProcessingRWLock().releaseReadLock();
}
services.getEventProcessingRWLock().acquireReadLock();
try {
processScheduleHandles(handles);
} catch (RuntimeException ex) {
handles.clear();
throw ex;
} finally {
services.getEventProcessingRWLock().releaseReadLock();
if (InstrumentationHelper.ENABLED) {
InstrumentationHelper.get().aTime();
}
}
}
示例3: initThreadLocals
import com.espertech.esper.collection.ArrayBackedCollection; //导入依赖的package包/类
private void initThreadLocals() {
removeFromThreadLocals();
matchesArrayThreadLocal = new ThreadLocal<ArrayBackedCollection<FilterHandle>>() {
protected synchronized ArrayBackedCollection<FilterHandle> initialValue() {
return new ArrayBackedCollection<FilterHandle>(100);
}
};
scheduleArrayThreadLocal = new ThreadLocal<ArrayBackedCollection<ScheduleHandle>>() {
protected synchronized ArrayBackedCollection<ScheduleHandle> initialValue() {
return new ArrayBackedCollection<ScheduleHandle>(100);
}
};
matchesPerStmtThreadLocal =
new ThreadLocal<Map<EPStatementAgentInstanceHandle, Object>>() {
protected synchronized Map<EPStatementAgentInstanceHandle, Object> initialValue() {
if (isPrioritized) {
return new TreeMap<EPStatementAgentInstanceHandle, Object>(EPStatementAgentInstanceHandleComparator.INSTANCE);
} else {
return new HashMap<EPStatementAgentInstanceHandle, Object>();
}
}
};
schedulePerStmtThreadLocal = new ThreadLocal<Map<EPStatementAgentInstanceHandle, Object>>() {
protected synchronized Map<EPStatementAgentInstanceHandle, Object> initialValue() {
if (isPrioritized) {
return new TreeMap<EPStatementAgentInstanceHandle, Object>(EPStatementAgentInstanceHandleComparator.INSTANCE);
} else {
return new HashMap<EPStatementAgentInstanceHandle, Object>();
}
}
};
}
示例4: processSchedule
import com.espertech.esper.collection.ArrayBackedCollection; //导入依赖的package包/类
private void processSchedule()
{
ArrayBackedCollection<ScheduleHandle> handles = scheduleArrayThreadLocal.get();
// Evaluation of schedules is protected by an optional scheduling service lock and then the engine lock
// We want to stay in this order for allowing the engine lock as a second-order lock to the
// services own lock, if it has one.
services.getEventProcessingRWLock().acquireReadLock();
try
{
services.getSchedulingService().evaluate(handles);
}
finally
{
services.getEventProcessingRWLock().releaseReadLock();
}
services.getEventProcessingRWLock().acquireReadLock();
try
{
processScheduleHandles(handles);
}
catch (RuntimeException ex)
{
handles.clear();
throw ex;
}
finally
{
services.getEventProcessingRWLock().releaseReadLock();
}
}
示例5: initThreadLocals
import com.espertech.esper.collection.ArrayBackedCollection; //导入依赖的package包/类
private void initThreadLocals() {
matchesPerStmtThreadLocal =
new ThreadLocal<Map<EPStatementAgentInstanceHandle, ArrayDeque<FilterHandleCallback>>>()
{
protected synchronized Map<EPStatementAgentInstanceHandle, ArrayDeque<FilterHandleCallback>> initialValue()
{
if (isPrioritized)
{
return new TreeMap<EPStatementAgentInstanceHandle, ArrayDeque<FilterHandleCallback>>(EPStatementAgentInstanceHandleComparator.INSTANCE);
}
else
{
return new HashMap<EPStatementAgentInstanceHandle, ArrayDeque<FilterHandleCallback>>(10000);
}
}
};
schedulePerStmtThreadLocal = new ThreadLocal<Map<EPStatementAgentInstanceHandle, Object>>()
{
protected synchronized Map<EPStatementAgentInstanceHandle, Object> initialValue()
{
if (isPrioritized)
{
return new TreeMap<EPStatementAgentInstanceHandle, Object>(EPStatementAgentInstanceHandleComparator.INSTANCE);
}
else
{
return new HashMap<EPStatementAgentInstanceHandle, Object>(10000);
}
}
};
matchesArrayThreadLocal = new ThreadLocal<ArrayBackedCollection<FilterHandle>>()
{
protected synchronized ArrayBackedCollection<FilterHandle> initialValue()
{
return new ArrayBackedCollection<FilterHandle>(100);
}
};
scheduleArrayThreadLocal = new ThreadLocal<ArrayBackedCollection<ScheduleHandle>>()
{
protected synchronized ArrayBackedCollection<ScheduleHandle> initialValue()
{
return new ArrayBackedCollection<ScheduleHandle>(100);
}
};
}
示例6: initThreadLocals
import com.espertech.esper.collection.ArrayBackedCollection; //导入依赖的package包/类
private void initThreadLocals() {
removeFromThreadLocals();
matchesArrayThreadLocal = new ThreadLocal<ArrayBackedCollection<FilterHandle>>()
{
protected synchronized ArrayBackedCollection<FilterHandle> initialValue()
{
return new ArrayBackedCollection<FilterHandle>(100);
}
};
scheduleArrayThreadLocal = new ThreadLocal<ArrayBackedCollection<ScheduleHandle>>()
{
protected synchronized ArrayBackedCollection<ScheduleHandle> initialValue()
{
return new ArrayBackedCollection<ScheduleHandle>(100);
}
};
matchesPerStmtThreadLocal =
new ThreadLocal<Map<EPStatementAgentInstanceHandle, ArrayDeque<FilterHandleCallback>>>()
{
protected synchronized Map<EPStatementAgentInstanceHandle, ArrayDeque<FilterHandleCallback>> initialValue()
{
if (isPrioritized)
{
return new TreeMap<EPStatementAgentInstanceHandle, ArrayDeque<FilterHandleCallback>>(EPStatementAgentInstanceHandleComparator.INSTANCE);
}
else
{
return new HashMap<EPStatementAgentInstanceHandle, ArrayDeque<FilterHandleCallback>>(10000);
}
}
};
schedulePerStmtThreadLocal = new ThreadLocal<Map<EPStatementAgentInstanceHandle, Object>>()
{
protected synchronized Map<EPStatementAgentInstanceHandle, Object> initialValue()
{
if (isPrioritized)
{
return new TreeMap<EPStatementAgentInstanceHandle, Object>(EPStatementAgentInstanceHandleComparator.INSTANCE);
}
else
{
return new HashMap<EPStatementAgentInstanceHandle, Object>(10000);
}
}
};
}