当前位置: 首页>>代码示例>>Java>>正文


Java ArrayBackedCollection类代码示例

本文整理汇总了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);
        }
    };
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:35,代码来源:EPRuntimeIsolatedImpl.java

示例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();
        }
    }
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:30,代码来源:EPRuntimeImpl.java

示例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>();
            }
        }
    };
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:37,代码来源:EPRuntimeImpl.java

示例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();
    }
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:33,代码来源:EPRuntimeImpl.java

示例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);
        }
    };
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:49,代码来源:EPRuntimeIsolatedImpl.java

示例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);
            }
        }
    };
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:51,代码来源:EPRuntimeImpl.java


注:本文中的com.espertech.esper.collection.ArrayBackedCollection类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。