public StreamWindow createWindow(long start, long end, long margin, StorageType type) { StreamWindow ret; switch (type) { case ONHEAP: ret = new StreamSortedWindowOnHeap(start, end, margin); break; default: ret = new StreamSortedWindowInMapDB( start, end, margin, createMapDB(type), UUID.randomUUID().toString() ); break; } if (LOG.isDebugEnabled()) { LOG.debug("Created new {}, type: {}", ret, type); } return ret; }
public synchronized boolean add(PartitionedEvent event) { long timestamp = event.getEvent().getTimestamp(); if (accept(timestamp)) { boolean absent = btreeMap.putIfAbsentBoolean(timestamp, new PartitionedEvent[] {event}); if (!absent) {