org.imemex.componentmappings
Class AbstractComponentReplicaWrapper<T>

java.lang.Object
  extended by org.imemex.componentmappings.AbstractComponentReplicaWrapper<T>
All Implemented Interfaces:
MappingSet, Replica
Direct Known Subclasses:
ContentComponentMappingWrapper, GroupComponentMappingWrapper, NameComponentMappingWrapper, TupleComponentMappingWrapper

public abstract class AbstractComponentReplicaWrapper<T>
extends java.lang.Object
implements Replica


Constructor Summary
AbstractComponentReplicaWrapper(ComponentMapping<T> mapping)
           
 
Method Summary
 void clear()
          Remove all (drop) index views.
 void close()
          Close this index.
 void flush()
          Flushe memory-resident index structures to disk in order to allow querying to take place after indexing.
 int getBufferSize()
          Get the number of elements which are buffered before being stored persistently by the index.
 void rebuild(boolean online)
          Rebuild and optimze this index.
 void remove(long oid)
          Remove the index view for given OID.
 void removeAll(PullOperator<java.lang.Long> oids)
          Remove the index views with given OIDs.
 long size()
          Return the number of entries in this index.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.imemex.componentmappings.Replica
entries, getEntry
 
Methods inherited from interface org.imemex.componentmappings.MappingSet
getComponentsAvailableFlags, insert, insertAll
 

Constructor Detail

AbstractComponentReplicaWrapper

public AbstractComponentReplicaWrapper(ComponentMapping<T> mapping)
Method Detail

remove

public final void remove(long oid)
Description copied from interface: MappingSet
Remove the index view for given OID. This method does nothing, if the given OID was not found in this index.

Specified by:
remove in interface MappingSet
Parameters:
oid - globally unique key used to identify a resource view in iMeMex.

removeAll

public final void removeAll(PullOperator<java.lang.Long> oids)
Description copied from interface: MappingSet
Remove the index views with given OIDs.

Specified by:
removeAll in interface MappingSet
Parameters:
oids - pull operator of OIDs of index views which should be removed. This method ignores OIDs that were not found in the index.

size

public final long size()
Description copied from interface: MappingSet
Return the number of entries in this index.

Specified by:
size in interface MappingSet
Returns:
number of entries.

clear

public final void clear()
Description copied from interface: MappingSet
Remove all (drop) index views.

Specified by:
clear in interface MappingSet

close

public final void close()
Description copied from interface: MappingSet
Close this index.

Specified by:
close in interface MappingSet

rebuild

public final void rebuild(boolean online)
                   throws OnlineRebuildNotSupportedException
Description copied from interface: MappingSet
Rebuild and optimze this index.

Specified by:
rebuild in interface MappingSet
Parameters:
online - if true allows concurrent modifications to this ComponentMapping while rebuilding. If false this index is locked and no modifications are allowed during the rebuild.
Throws:
OnlineRebuildNotSupportedException

flush

public final void flush()
Description copied from interface: MappingSet
Flushe memory-resident index structures to disk in order to allow querying to take place after indexing.

Specified by:
flush in interface MappingSet

getBufferSize

public final int getBufferSize()
Description copied from interface: MappingSet
Get the number of elements which are buffered before being stored persistently by the index.

Specified by:
getBufferSize in interface MappingSet
Returns:
the number of elements.