public void newEvent(long bucketKey,T event){
  int bucketIdx=(int)(bucketKey % noOfBuckets);
  Bucket<T> bucket=buckets[bucketIdx];
  if (bucket == null || bucket.bucketKey != bucketKey) {
    if (bucket != null) {
      dirtyBuckets.put(bucket.bucketKey,bucket);
    }
    bucket=createBucket(bucketKey);
    buckets[bucketIdx]=bucket;
  }
  Object key=event.getEventKey();
  Set<Long> keyBuckets=key2Buckets.get(key);
  if (keyBuckets == null) {
    keyBuckets=new HashSet<Long>();
    keyBuckets.add(bucketKey);
    key2Buckets.put(key,keyBuckets);
  }
 else {
    keyBuckets.add(bucketKey);
  }
  bucket.addNewEvent(key,event);
}

public void newEvent ( long bucketKey , T event ) { int bucketIdx = ( int ) ( bucketKey % noOfBuckets ) ; Bucket < T > bucket = buckets [ bucketIdx ] ; if ( bucket == null || bucket . bucketKey != bucketKey ) { if ( bucket != null ) { dirtyBuckets . put ( bucket . bucketKey , bucket ) ; } bucket = createBucket ( bucketKey ) ; buckets [ bucketIdx ] = bucket ; } Object key = event . getEventKey ( ) ; Set < Long > keyBuckets = key2Buckets . get ( key ) ; if ( keyBuckets == null ) { keyBuckets = new HashSet < Long > ( ) ; keyBuckets . add ( bucketKey ) ; key2Buckets . put ( key , keyBuckets ) ; } else { keyBuckets . add ( bucketKey ) ; } bucket . addNewEvent ( key , event ) ; }
insert the event into the specified bucketkey
