MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

ch.ethz.mxquery.sms.MMimpl
Class IndexRandomStore

java.lang.Object
  extended by ch.ethz.mxquery.sms.MMimpl.RandomStore
      extended by ch.ethz.mxquery.sms.MMimpl.IndexRandomStore
All Implemented Interfaces:
Source, ActiveStore, IndexInterface, IndexRead, RandomUpdate, ReadInterface, StreamStore

public class IndexRandomStore
extends RandomStore
implements IndexRead, ActiveStore

TO DO


Field Summary
 
Fields inherited from class ch.ethz.mxquery.sms.MMimpl.RandomStore
id
 
Constructor Summary
IndexRandomStore(XDMIterator it, int secondsToStoreData, java.lang.String name)
           
IndexRandomStore(XDMIterator it, int secondsToStoreData, java.lang.String name, boolean wait, int size, WindowBuffer container)
          Store constructor
 
Method Summary
 void buffer(Token tok, int event)
          materialize a new token from the stream; event for avoiding subsequent check for type
 int compare(Source store)
           
 Source copySource(Context ctx, java.util.Vector nestedPredCtxStack)
           
 void delete(IndexSchema schema, Token[] values)
           
 void deleteItems(int[] ids)
           
 Token get(int pos)
          Get Token at given position
 Window getIterator(Context ctx)
          Returns Iterator that points on the first token in the store.
 java.lang.String getURI()
          Returns the URI of the source.
 void newItem()
          Specify the beginning of a new item
 void printDebugAccidents()
           
 IndexSchema registerIndex(IndexSchema schema)
          register index schemas
 XDMIterator retrieve(IndexSchema schema, Token[] tokens)
           
 void setIterator(XDMIterator it)
          For pull stores, add the iterator from which they should pull their data
 void start()
          Start the gathering of the active store
 
Methods inherited from class ch.ethz.mxquery.sms.MMimpl.RandomStore
getMyId
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexRandomStore

public IndexRandomStore(XDMIterator it,
                        int secondsToStoreData,
                        java.lang.String name,
                        boolean wait,
                        int size,
                        WindowBuffer container)
Store constructor

Parameters:
it - Iterator to pull the data from
secondsToStoreData - Wait until access to storage is permitted (supposes the existence of a "miunute" attr)
name - Store's name
wait - Synchronization condition (minute) - more than one items per "minute"

IndexRandomStore

public IndexRandomStore(XDMIterator it,
                        int secondsToStoreData,
                        java.lang.String name)
Method Detail

registerIndex

public IndexSchema registerIndex(IndexSchema schema)
register index schemas

Specified by:
registerIndex in interface IndexInterface
Parameters:
schema - for index construction
Returns:
-1 if error, else unique index id value ( id >= 0)

start

public void start()
Description copied from interface: ActiveStore
Start the gathering of the active store

Specified by:
start in interface ActiveStore

retrieve

public XDMIterator retrieve(IndexSchema schema,
                            Token[] tokens)
Specified by:
retrieve in interface IndexRead
Returns:
iterator with requested data

buffer

public void buffer(Token tok,
                   int event)
materialize a new token from the stream; event for avoiding subsequent check for type

Specified by:
buffer in interface StreamStore

printDebugAccidents

public void printDebugAccidents()

delete

public void delete(IndexSchema schema,
                   Token[] values)
Specified by:
delete in interface RandomUpdate

deleteItems

public void deleteItems(int[] ids)
Specified by:
deleteItems in interface RandomUpdate

get

public Token get(int pos)
          throws MXQueryException
Description copied from interface: StreamStore
Get Token at given position

Specified by:
get in interface StreamStore
Parameters:
pos - Unique id given to the token inside this store instance (token position
Returns:
the Token at the given position
Throws:
MXQueryException

newItem

public void newItem()
Description copied from interface: StreamStore
Specify the beginning of a new item

Specified by:
newItem in interface StreamStore

compare

public int compare(Source store)
Specified by:
compare in interface Source

copySource

public Source copySource(Context ctx,
                         java.util.Vector nestedPredCtxStack)
                  throws MXQueryException
Specified by:
copySource in interface Source
Throws:
MXQueryException

getURI

public java.lang.String getURI()
Description copied from interface: Source
Returns the URI of the source.

Specified by:
getURI in interface Source
Returns:
a String representing the URI/Identifier of this source

getIterator

public Window getIterator(Context ctx)
                   throws MXQueryException
Description copied from interface: Source
Returns Iterator that points on the first token in the store.

Specified by:
getIterator in interface Source
Returns:
Iterator a (Window) Iterator to access the contents of this source
Throws:
MXQueryException

setIterator

public void setIterator(XDMIterator it)
Description copied from interface: StreamStore
For pull stores, add the iterator from which they should pull their data

Specified by:
setIterator in interface StreamStore

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich