MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

ch.ethz.mxquery.update.store.llImpl
Class LLStoreSet

java.lang.Object
  extended by ch.ethz.mxquery.update.store.llImpl.LLStoreSet
All Implemented Interfaces:
StoreSet

public class LLStoreSet
extends java.lang.Object
implements StoreSet

A simple implementation (XML-Tokens as a doubly linked list without an index) of a store set.


Constructor Summary
LLStoreSet()
           
 
Method Summary
 void addCollection(java.lang.String uri, java.util.Vector coll)
          Add a collection to the storeset
 void addRollback(RollbackItem ri)
           
 void addStoreToSerialize(UpdateableStore store, java.lang.String uri)
          Adds a store to the list of stores to be serialized at PUL apply
 void cleanTransationStores(long transactionID)
          Remove all temporary stores that are connected to the give transaction ID
 StoreSet copy()
          Create a shallow copy of this Store Set, retaining all the contained stores and collections
 FullTextStore createFulltextStore(java.lang.String uri, XDMIterator initialDataIterator)
          Creates a full text store Note: An additional version of this function will be implemented later, where the types of full-text indexes can be chosen (currently, all indexes are always generated)
 Source createStore(java.lang.String uri, XDMIterator initialDataIterator, boolean maybeSerialized)
          Creates a Store with the passed URI.
 Source createStore(XDMIterator initialDataIterator)
          Creates a Store with an automatically generated URI.
 StreamStore createStreamStore(int type, java.lang.String uri)
          Create a stream store, in which the XDM data can be possibly infinite, contents are lazily materialized and there are optimizations for access patterns and other parameters In this version, the store type is explicitly requested
 StreamStore createStreamStore(StreamStoreSettings sts, java.lang.String uri)
          Create a stream store, in which the XDM data can be possibly infinite, contents are lazily materialized and there are optimizations for access patterns and other parameters In this version, the store type is explicitly requested
 UpdateableStore createTransactionStore(long transactionID)
          Creates a temporary Store that belongs to a particular transaction, e.g.
 UpdateableStore createUpdateableStore(java.lang.String uri, XDMIterator initialDataIterator, boolean newIds, boolean serializeable)
          Creates an updateable store.
 void deleteCollection(java.lang.String uri)
          Delete a collection
 void freeRessources()
          Discard all stores and collections that have been generated inside this store set
 ActiveStore[] getActiveStores()
          Get all active stores in this store set, i.e.
 Source[] getAllStores()
          Returns all stores
 XDMIterator[] getCollection(java.lang.String uri)
          Get the contents of a collection
 FullTextStore[] getFulltextStores()
          Retrieve all fulltext stores in this store set
 UpdateableStore getNewStoreForItem(Identifier item, java.lang.String uri, boolean serializeable)
          Create a new updateable store (copy) for an existing item
 Identifier getParentId(Identifier id)
          Returns the Identifier of the event with the passed identifier.
 Source getStore(java.lang.String uri)
          Returns the Store which has the passed URI as identifier
 StreamStore[] getStreamStores()
          Retrieve all streams/stream stores associated with this store set
 UpdateableStore[] getUpdateableStores()
          Returns all updateable stores
 boolean hasParent(Identifier id)
          Returns true if the event with the passed identifier has a parent.
 boolean isAtomicMode()
           
 boolean isUseFulltextStores()
          Check if fulltext stores are used
 boolean isUseUpdateStores()
          Check if updateable stores are used
 void removeStore(Source store)
          Remove store from this store set
 void serializeStores(boolean createBackup, java.lang.String baseURI)
          Serialize the stores in this storeset into an XML file.
 void setSerializeStores(boolean serializeStores)
           
 void setUseFulltextStores(boolean fulltextStores)
          Stores created without additional parameters should support fulltext operations
 void setUseUpdateStores(boolean updateStores)
          Stores created without additional parameters should be updateable
 java.lang.String toString()
           
 java.lang.String toString(boolean printReferencers)
          Gives the possibility to add to each source the number of referencers.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LLStoreSet

public LLStoreSet()
Method Detail

createStore

public Source createStore(XDMIterator initialDataIterator)
                   throws MXQueryException
Description copied from interface: StoreSet
Creates a Store with an automatically generated URI.

Specified by:
createStore in interface StoreSet
Parameters:
initialDataIterator - TODO
Returns:
created data source
Throws:
MXQueryException

createStore

public Source createStore(java.lang.String uri,
                          XDMIterator initialDataIterator,
                          boolean maybeSerialized)
                   throws MXQueryException
Description copied from interface: StoreSet
Creates a Store with the passed URI.

Specified by:
createStore in interface StoreSet
initialDataIterator - Iterator to load the initial contents of this store from
maybeSerialized - TODO
Returns:
created data source
Throws:
MXQueryException

createTransactionStore

public UpdateableStore createTransactionStore(long transactionID)
Description copied from interface: StoreSet
Creates a temporary Store that belongs to a particular transaction, e.g. for data to be inserted/snapshots

Specified by:
createTransactionStore in interface StoreSet
Parameters:
transactionID - Identifier for a transaction
Returns:
Store instance associated with transaction and store set

cleanTransationStores

public void cleanTransationStores(long transactionID)
Description copied from interface: StoreSet
Remove all temporary stores that are connected to the give transaction ID

Specified by:
cleanTransationStores in interface StoreSet

getStore

public Source getStore(java.lang.String uri)
Description copied from interface: StoreSet
Returns the Store which has the passed URI as identifier

Specified by:
getStore in interface StoreSet
Parameters:
uri - The identifier of the store
Returns:
Store Data Source, if uri present, otherwise null

getAllStores

public Source[] getAllStores()
Description copied from interface: StoreSet
Returns all stores

Specified by:
getAllStores in interface StoreSet
Returns:
a sequence of all stores in the store set

getUpdateableStores

public UpdateableStore[] getUpdateableStores()
Description copied from interface: StoreSet
Returns all updateable stores

Specified by:
getUpdateableStores in interface StoreSet
Returns:
a sequence of all updateable stores in the store set

getParentId

public Identifier getParentId(Identifier id)
                       throws MXQueryException
Description copied from interface: StoreSet
Returns the Identifier of the event with the passed identifier.

Specified by:
getParentId in interface StoreSet
Returns:
parent identifier
Throws:
MXQueryException

hasParent

public boolean hasParent(Identifier id)
                  throws MXQueryException
Description copied from interface: StoreSet
Returns true if the event with the passed identifier has a parent.

Specified by:
hasParent in interface StoreSet
Returns:
true for has parent
Throws:
MXQueryException

removeStore

public void removeStore(Source store)
Description copied from interface: StoreSet
Remove store from this store set

Specified by:
removeStore in interface StoreSet

isAtomicMode

public boolean isAtomicMode()

addRollback

public void addRollback(RollbackItem ri)

freeRessources

public void freeRessources()
Description copied from interface: StoreSet
Discard all stores and collections that have been generated inside this store set

Specified by:
freeRessources in interface StoreSet

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(boolean printReferencers)
Gives the possibility to add to each source the number of referencers.

Parameters:
printReferencers -
Returns:
the contents of the store in an XML string

copy

public StoreSet copy()
Description copied from interface: StoreSet
Create a shallow copy of this Store Set, retaining all the contained stores and collections

Specified by:
copy in interface StoreSet
Returns:
a copy of the store set

getNewStoreForItem

public UpdateableStore getNewStoreForItem(Identifier item,
                                          java.lang.String uri,
                                          boolean serializeable)
                                   throws MXQueryException
Description copied from interface: StoreSet
Create a new updateable store (copy) for an existing item

Specified by:
getNewStoreForItem in interface StoreSet
Parameters:
item - the node identifier of the item
uri - identifier of store, for serializeable stores the location URI
serializeable - shall this store be considered for serialization/persistence to disk
Returns:
A new updateable store for this item
Throws:
MXQueryException

addStoreToSerialize

public void addStoreToSerialize(UpdateableStore store,
                                java.lang.String uri)
Adds a store to the list of stores to be serialized at PUL apply

Specified by:
addStoreToSerialize in interface StoreSet
Parameters:
store - Store to serialize
uri - Location where to store the contents of the store

serializeStores

public void serializeStores(boolean createBackup,
                            java.lang.String baseURI)
                     throws MXQueryException
Description copied from interface: StoreSet
Serialize the stores in this storeset into an XML file. This affects only stores that serializable and have been modified

Specified by:
serializeStores in interface StoreSet
Parameters:
createBackup - Create backup file of the overwritten files
Throws:
MXQueryException

setSerializeStores

public void setSerializeStores(boolean serializeStores)
Specified by:
setSerializeStores in interface StoreSet
Parameters:
serializeStores - if true, stores to be serialized should be collected, otherwise they are not

setUseFulltextStores

public void setUseFulltextStores(boolean fulltextStores)
Description copied from interface: StoreSet
Stores created without additional parameters should support fulltext operations

Specified by:
setUseFulltextStores in interface StoreSet
Parameters:
fulltextStores - if true, use fulltext Stores,

setUseUpdateStores

public void setUseUpdateStores(boolean updateStores)
Description copied from interface: StoreSet
Stores created without additional parameters should be updateable

Specified by:
setUseUpdateStores in interface StoreSet

createUpdateableStore

public UpdateableStore createUpdateableStore(java.lang.String uri,
                                             XDMIterator initialDataIterator,
                                             boolean newIds,
                                             boolean serializeable)
Description copied from interface: StoreSet
Creates an updateable store. The contents are materialized completely on the first request for data

Specified by:
createUpdateableStore in interface StoreSet
Parameters:
uri - identifier of store, for serializeable stores the location URI
initialDataIterator - source of initial
newIds - Shall new node IDs be assigned ?
serializeable - shall this store be considered for serialization/persistence to disk
Returns:
A Updateable store instance. If the identifier already exists, the existing store will be used

isUseFulltextStores

public boolean isUseFulltextStores()
Description copied from interface: StoreSet
Check if fulltext stores are used

Specified by:
isUseFulltextStores in interface StoreSet
Returns:
true, if fulltext stores are used by default

isUseUpdateStores

public boolean isUseUpdateStores()
Description copied from interface: StoreSet
Check if updateable stores are used

Specified by:
isUseUpdateStores in interface StoreSet
Returns:
true, if updateable stores are used by default

getCollection

public XDMIterator[] getCollection(java.lang.String uri)
Description copied from interface: StoreSet
Get the contents of a collection

Specified by:
getCollection in interface StoreSet
Parameters:
uri - The identifier of the collection
Returns:
null if collection does not exist, the set of iterator

addCollection

public void addCollection(java.lang.String uri,
                          java.util.Vector coll)
                   throws MXQueryException
Description copied from interface: StoreSet
Add a collection to the storeset

Specified by:
addCollection in interface StoreSet
Parameters:
uri - Collection identifier
coll - Vector of iterators representing the contents of the collection
Throws:
MXQueryException

deleteCollection

public void deleteCollection(java.lang.String uri)
                      throws MXQueryException
Description copied from interface: StoreSet
Delete a collection

Specified by:
deleteCollection in interface StoreSet
Parameters:
uri - Collection identifier
Throws:
MXQueryException

createFulltextStore

public FullTextStore createFulltextStore(java.lang.String uri,
                                         XDMIterator initialDataIterator)
                                  throws MXQueryException
Description copied from interface: StoreSet
Creates a full text store Note: An additional version of this function will be implemented later, where the types of full-text indexes can be chosen (currently, all indexes are always generated)

Specified by:
createFulltextStore in interface StoreSet
Parameters:
uri - identifier of store
Returns:
A fulltext store If the identifier already exists, the existing store will be used
Throws:
MXQueryException

createStreamStore

public StreamStore createStreamStore(int type,
                                     java.lang.String uri)
                              throws MXQueryException
Description copied from interface: StoreSet
Create a stream store, in which the XDM data can be possibly infinite, contents are lazily materialized and there are optimizations for access patterns and other parameters In this version, the store type is explicitly requested

Specified by:
createStreamStore in interface StoreSet
Parameters:
type - A SMS store type
uri - the identifier of this stream
Returns:
A stream store fullfilling the requested paramers
Throws:
MXQueryException

createStreamStore

public StreamStore createStreamStore(StreamStoreSettings sts,
                                     java.lang.String uri)
                              throws MXQueryException
Description copied from interface: StoreSet
Create a stream store, in which the XDM data can be possibly infinite, contents are lazily materialized and there are optimizations for access patterns and other parameters In this version, the store type is explicitly requested

Specified by:
createStreamStore in interface StoreSet
Parameters:
sts - the stream store settings for this store
uri - the identifier for this store
Returns:
a stream store with the requested properties
Throws:
MXQueryException

getFulltextStores

public FullTextStore[] getFulltextStores()
Description copied from interface: StoreSet
Retrieve all fulltext stores in this store set

Specified by:
getFulltextStores in interface StoreSet
Returns:
all fulltext stores in the store set

getStreamStores

public StreamStore[] getStreamStores()
Description copied from interface: StoreSet
Retrieve all streams/stream stores associated with this store set

Specified by:
getStreamStores in interface StoreSet
Returns:
all stream stores in this store set

getActiveStores

public ActiveStore[] getActiveStores()
Description copied from interface: StoreSet
Get all active stores in this store set, i.e. all stores that gather there their input under their own control, not by the calling expressions

Specified by:
getActiveStores in interface StoreSet
Returns:
all active stores in the store set

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich