com.espertech.esper.schedule
Class ScheduleBucket

java.lang.Object
  extended by com.espertech.esper.schedule.ScheduleBucket

public class ScheduleBucket
extends java.lang.Object

This class acts as a buckets for sorting schedule service callbacks that are scheduled to occur at the same time. Each buckets constists of slots that callbacks are assigned to.

At the time of timer evaluation, callbacks that become triggerable are ordered using the bucket as the first-level order, and slot as the second-level order.

Each statement at statement creation time allocates a buckets, and each timer within the statement allocates a slot. Thus statements that depend on other statements (such as for insert-into), and timers within their statement (such as time window or output rate limit timers) behave deterministically.


Constructor Summary
ScheduleBucket(int bucketNum)
          Ctor.
 
Method Summary
 long allocateSlot()
          Returns a new slot in the bucket.
 long allocateSlot(int slotNumber)
          Returns a given slot in the bucket, given a slot number
static long toLong(int bucket, int slot)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScheduleBucket

public ScheduleBucket(int bucketNum)
Ctor.

Parameters:
bucketNum - is a simple integer number for this bucket by which buckets can be sorted
Method Detail

allocateSlot

public long allocateSlot()
Returns a new slot in the bucket.

Returns:
slot

allocateSlot

public long allocateSlot(int slotNumber)
Returns a given slot in the bucket, given a slot number

Returns:
slot

toLong

public static long toLong(int bucket,
                          int slot)

© 2006-2016 EsperTech Inc.
All rights reserved.
Visit us at espertech.com