|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eigenbase.util.CompoundClosableAllocation net.sf.farrago.util.FarragoCompoundAllocation net.sf.farrago.db.FarragoDbSessionIndexMap
class FarragoDbSessionIndexMap
FarragoDbSessionIndexMap implements FarragoSessionIndexMap
, resolving
indexes for both permanent and temporary tables.
Field Summary | |
---|---|
private FarragoDbSession |
dbSession
|
private FarragoDataWrapperCache |
privateDataWrapperCache
Cache for local data wrappers used to manage indexes. |
private FarragoRepos |
repos
Repos for this session. |
private Map<String,Long> |
tempIndexRootMap
Map from index MOF ID to root PageId for temporary tables. |
Fields inherited from class org.eigenbase.util.CompoundClosableAllocation |
---|
allocations |
Constructor Summary | |
---|---|
FarragoDbSessionIndexMap(FarragoAllocationOwner owner,
FarragoDbSession dbSession,
FarragoRepos repos)
Creates a new FarragoDbSessionIndexMap. |
Method Summary | |
---|---|
void |
closeAllocation()
Closes this object. |
FarragoMedLocalIndexStats |
computeIndexStats(FarragoDataWrapperCache wrapperCache,
FemLocalIndex index,
boolean estimate)
Verifies an index and records returns page count for the index. |
void |
createIndexStorage(FarragoDataWrapperCache wrapperCache,
FemLocalIndex index)
Creates an index and records its root in this map. |
long |
createIndexStorage(FarragoDataWrapperCache wrapperCache,
FemLocalIndex index,
boolean updateMap)
Creates an index and optionally records its root in this map. |
void |
dropIndexStorage(FarragoDataWrapperCache wrapperCache,
FemLocalIndex index,
boolean truncate)
Drops an index and removes its root from this map. |
void |
dropIndexStorage(FarragoDataWrapperCache wrapperCache,
String indexMofId,
boolean truncate)
Drops an index by MOFID and removes its root from this map. |
private void |
dropIndexStorageImpl(FarragoDataWrapperCache wrapperCache,
FemLocalIndex index,
String indexMofId,
boolean truncate)
|
FemLocalIndex |
getIndexById(long id)
Gets an index by its repository ID. |
private FarragoMedLocalDataServer |
getIndexDataServer(FarragoDataWrapperCache wrapperCache,
FemLocalIndex index)
|
long |
getIndexRoot(FemLocalIndex index)
Gets the root PageId of an index to be used for reading. |
long |
getIndexRoot(FemLocalIndex index,
boolean write)
Gets the root PageId of an index to be used for reading or for writing. |
CwmTable |
getOldTableStructure()
For ALTER TABLE ADD COLUMN, retrieves the old table structure corresponding to the table being modified. |
CwmTable |
getReloadTable()
For ALTER TABLE ADD COLUMN or REBUILD, retrieves the target table. |
void |
instantiateTemporaryTable(FarragoDataWrapperCache wrapperCache,
CwmTable table)
Called on every reference to a temporary table. |
void |
onCommit()
Commit hook: truncates any indexes for tables defined with ON COMMIT DELETE ROWS. |
void |
setIndexRoot(FemLocalIndex index,
long root)
Sets the root PageId of an index. |
void |
versionIndexRoot(FarragoDataWrapperCache wrapperCache,
FemLocalIndex index,
Long newRoot)
Versions an index root page. |
Methods inherited from class org.eigenbase.util.CompoundClosableAllocation |
---|
addAllocation, forgetAllocation, hasAllocations |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eigenbase.util.ClosableAllocationOwner |
---|
addAllocation |
Field Detail |
---|
private FarragoDbSession dbSession
private Map<String,Long> tempIndexRootMap
private FarragoRepos repos
private FarragoDataWrapperCache privateDataWrapperCache
Constructor Detail |
---|
public FarragoDbSessionIndexMap(FarragoAllocationOwner owner, FarragoDbSession dbSession, FarragoRepos repos)
owner
- FarragoAllocationOwner which will own this map; on
closeAllocation, any temporary indexes will be deleted automaticallydbSession
- FarragoDbSession contextrepos
- the repos for this sessionMethod Detail |
---|
public long getIndexRoot(FemLocalIndex index)
FarragoSessionIndexMap
getIndexRoot
in interface FarragoSessionIndexMap
index
- the index of interest
public long getIndexRoot(FemLocalIndex index, boolean write)
FarragoSessionIndexMap
getIndexRoot
in interface FarragoSessionIndexMap
index
- the index of interestwrite
- whether to access a root for reading or writing. A root for
reading reflects the index before modifications. A root for writing may
be the same root, or may reflect an updated index, depending on the
implementation of the session index map.
public void setIndexRoot(FemLocalIndex index, long root)
FarragoSessionIndexMap
setIndexRoot
in interface FarragoSessionIndexMap
index
- the index to be updatedroot
- the root PageIdpublic void instantiateTemporaryTable(FarragoDataWrapperCache wrapperCache, CwmTable table)
FarragoSessionIndexMap
instantiateTemporaryTable
in interface FarragoSessionIndexMap
wrapperCache
- cache for looking up data wrapperstable
- the temporary tablepublic CwmTable getReloadTable()
FarragoSessionIndexMap
getReloadTable
in interface FarragoSessionIndexMap
public CwmTable getOldTableStructure()
FarragoSessionIndexMap
getOldTableStructure
in interface FarragoSessionIndexMap
public void closeAllocation()
ClosableAllocation
closeAllocation
in interface ClosableAllocation
closeAllocation
in class CompoundClosableAllocation
public void onCommit()
onCommit
in interface FarragoSessionIndexMap
public void createIndexStorage(FarragoDataWrapperCache wrapperCache, FemLocalIndex index)
FarragoSessionIndexMap
createIndexStorage
in interface FarragoSessionIndexMap
wrapperCache
- cache for looking up data wrappersindex
- the index to createpublic long createIndexStorage(FarragoDataWrapperCache wrapperCache, FemLocalIndex index, boolean updateMap)
FarragoSessionIndexMap
createIndexStorage
in interface FarragoSessionIndexMap
wrapperCache
- cache for looking up data wrappersindex
- the index to createupdateMap
- whether to record the new root in the map
public void dropIndexStorage(FarragoDataWrapperCache wrapperCache, FemLocalIndex index, boolean truncate)
FarragoSessionIndexMap
dropIndexStorage
in interface FarragoSessionIndexMap
wrapperCache
- cache for looking up data wrappersindex
- the index to droptruncate
- if true, only truncate storage; if false, drop storage
entirelypublic void dropIndexStorage(FarragoDataWrapperCache wrapperCache, String indexMofId, boolean truncate)
FarragoSessionIndexMap
dropIndexStorage
in interface FarragoSessionIndexMap
wrapperCache
- cache for looking up data wrappersindexMofId
- MOFID of the index to droptruncate
- if true, only truncate storage; if false, drop storage
entirelyprivate void dropIndexStorageImpl(FarragoDataWrapperCache wrapperCache, FemLocalIndex index, String indexMofId, boolean truncate)
public FarragoMedLocalIndexStats computeIndexStats(FarragoDataWrapperCache wrapperCache, FemLocalIndex index, boolean estimate)
FarragoSessionIndexMap
computeIndexStats
in interface FarragoSessionIndexMap
wrapperCache
- cache for looking up data wrappersindex
- the index to verify
public FemLocalIndex getIndexById(long id)
FarragoSessionIndexMap
getIndexById
in interface FarragoSessionIndexMap
id
- index ID in repository
private FarragoMedLocalDataServer getIndexDataServer(FarragoDataWrapperCache wrapperCache, FemLocalIndex index)
public void versionIndexRoot(FarragoDataWrapperCache wrapperCache, FemLocalIndex index, Long newRoot)
FarragoSessionIndexMap
versionIndexRoot
in interface FarragoSessionIndexMap
wrapperCache
- Wrapper cacheindex
- Index definitionnewRoot
- new index root ids
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |