|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.imemex.componentmappings.impl.AbstractComponentReplica<T>
public abstract class AbstractComponentReplica<T>
Sample default implementation of ComponentReplica based on a HashMap. The HashMap is used to provide efficient access for methods requiring the internalRVID. The query simply returns all elements contained in the HashMap. This class uses the Template Method pattern to make replication and persistence behaviour definable by its subclasses.
| Constructor Summary | |
|---|---|
AbstractComponentReplica(java.io.File storageDir)
Instantiates a new AbstractComponentReplica. |
|
| Method Summary | |
|---|---|
void |
clear()
Clears (drops) this ComponentMap. |
void |
close()
Closes this ComponentMap. |
PullOperator<Mapping<T>> |
entries()
Returns all entries stored by this replica. |
void |
flushMapping()
Flushes memory-resident index structures to disk in order to allow querying to take place after indexing. |
int |
getBufferSize()
since all elements are buffered in the hashmap before calling close() we set the buffer size to Integer.MAX_VALUE |
T |
getEntry(long oid)
Returns the component entry for the given resource view specified by oid. |
boolean |
insert(long internalRVID,
T newEntry)
Inserts the given mapping into this ComponentMap. |
boolean |
insertAll(PullOperator<Mapping<T>> entries)
Inserts all entries of the given PullOperator into this ComponentMap. |
boolean |
isEmpty()
Returns true if this instance does not contain any entries. |
boolean |
isLoadingReplica()
|
void |
read(java.io.DataInput dataInput)
Reads the state of this instance from the given |
void |
rebuildMapping(boolean online)
Rebuilds and optimzes the mapping (for instance an index). |
void |
remove(long internalRVID)
Removes the given entries for resource view internalRVID. |
void |
removeAll(PullOperator<java.lang.Long> oids)
Removes the given entries for resource view internalRVID. |
long |
size()
Returns the number of entries. |
void |
write(java.io.DataOutput dataOutput)
Writes the state of this instance to the gieven |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractComponentReplica(java.io.File storageDir)
| Method Detail |
|---|
public boolean insert(long internalRVID,
T newEntry)
ComponentMappingnewEntry instances. This is
very important for ComponentReplicas.
insert in interface ComponentMapping<T>internalRVID - - globally unique key used to identify a resource view in iMeMexnewEntry - - the instance to index
public void remove(long internalRVID)
ComponentMappinginternalRVID.
remove in interface ComponentMapping<T>internalRVID - - globally unique key used to identify a resource view in iMeMexpublic boolean insertAll(PullOperator<Mapping<T>> entries)
ComponentMappingnewEntry instances. This is very important for ComponentReplicas.
insertAll in interface ComponentMapping<T>entries - - is a PullOperator with Map.Entry instances.
Map.Entrypublic boolean isEmpty()
ComponentMapping
isEmpty in interface ComponentMapping<T>public long size()
ComponentMapping
size in interface ComponentMapping<T>public void clear()
ComponentMapping
clear in interface ComponentMapping<T>
public void rebuildMapping(boolean online)
throws OnlineRebuildNotSupportedException
ComponentMapping
rebuildMapping in interface ComponentMapping<T>online - - if true allows concurrent modifications to this ComponentMapping while rebuilding. If false this
ComponentMapping is locked and no modifications are allowed during the rebuild.
OnlineRebuildNotSupportedExceptionpublic void close()
ComponentMapping
close in interface ComponentMapping<T>public T getEntry(long oid)
ComponentReplicaoid. Implementations of this interface represent
replicated components (caches, copies, materialized views, etc.) that may
be used to speed up query processing.
getEntry in interface ComponentReplica<T>oid - - globally unique key used to identify a resource
view in iMeMex.
oid.public PullOperator<Mapping<T>> entries()
ComponentReplica
entries in interface ComponentReplica<T>org.imemex.resourceviewmanager.componentmappings.Mapping
public void read(java.io.DataInput dataInput)
throws java.io.IOException
Persistable
read in interface Persistablejava.io.IOException
public void write(java.io.DataOutput dataOutput)
throws java.io.IOException
Persistable
write in interface Persistablejava.io.IOExceptionpublic void removeAll(PullOperator<java.lang.Long> oids)
ComponentMappinginternalRVID.
removeAll in interface ComponentMapping<T>oids - - a PullOperator of Long instances representing internalRVIDspublic void flushMapping()
ComponentMapping
flushMapping in interface ComponentMapping<T>public int getBufferSize()
getBufferSize in interface ComponentMapping<T>public boolean isLoadingReplica()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||