com.metamatrix.query.processor
Class TempTableDataManager

java.lang.Object
  extended by com.metamatrix.query.processor.TempTableDataManager
All Implemented Interfaces:
ProcessorDataManager

public class TempTableDataManager
extends java.lang.Object
implements ProcessorDataManager

This proxy ProcessorDataManager is used during XML query processing to handle temporary groups in the document model. Temp groups are materialized during processing, and their tuple sources are cached, so this proxy shortcuts the need to go to the DataTierManager and immediately returns the tuple source (synchronously) if a temp group's source is what's being requested.


Constructor Summary
TempTableDataManager(ProcessorDataManager processorDataManager, TempTableStore tempTableStore)
          Constructor takes the "real" ProcessorDataManager that this object will be a proxy to, and will pass most calls through to transparently.
 
Method Summary
 void clearCodeTables()
           
 java.lang.Object lookupCodeValue(CommandContext context, java.lang.String codeTableName, java.lang.String returnElementName, java.lang.String keyElementName, java.lang.Object keyValue)
          Lookup a value from a cached code table.
 TupleSource registerRequest(java.lang.Object processorID, Command command, java.lang.String modelName, java.lang.String connectorBindingId, int nodeID)
          This is the magic method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TempTableDataManager

public TempTableDataManager(ProcessorDataManager processorDataManager,
                            TempTableStore tempTableStore)
Constructor takes the "real" ProcessorDataManager that this object will be a proxy to, and will pass most calls through to transparently. Only when a request is registered for a temp group will this proxy do it's thing. A ProcessorEnvironment is needed to to access cached information about temp groups

Parameters:
processorDataManager - the real ProcessorDataManager that this object is a proxy to
env - a ProcessorEnvironment implementation
Method Detail

registerRequest

public TupleSource registerRequest(java.lang.Object processorID,
                                   Command command,
                                   java.lang.String modelName,
                                   java.lang.String connectorBindingId,
                                   int nodeID)
                            throws MetaMatrixComponentException,
                                   MetaMatrixProcessingException
This is the magic method. If the command is selecting from a temporary group, that temporary groups tuple source (which is cached in the ProcessorEnvironment) will be retrieved and immediately (synchronously) delivered to the QueryProcessor. If a temp group is not being selected from, then this request will be passed through to the underlying ProcessorDataManager.

Specified by:
registerRequest in interface ProcessorDataManager
Throws:
MetaMatrixProcessingException
MetaMatrixComponentException
See Also:
com.metamatrix.query.processor.ProcessorDataManager#registerRequest(Object, Command, String, String, TupleSourceID)

lookupCodeValue

public java.lang.Object lookupCodeValue(CommandContext context,
                                        java.lang.String codeTableName,
                                        java.lang.String returnElementName,
                                        java.lang.String keyElementName,
                                        java.lang.Object keyValue)
                                 throws BlockedException,
                                        MetaMatrixComponentException,
                                        MetaMatrixProcessingException
Description copied from interface: ProcessorDataManager
Lookup a value from a cached code table. If the code table is not loaded, it will be loaded on the first query. Code tables should be cached based on a combination of the codeTableName, returnElementName, and keyElementName. If the table is not loaded, a request will be made and the method should throw a BlockedException.

Specified by:
lookupCodeValue in interface ProcessorDataManager
Throws:
BlockedException
MetaMatrixComponentException
MetaMatrixProcessingException

clearCodeTables

public void clearCodeTables()
Specified by:
clearCodeTables in interface ProcessorDataManager


Copyright © 2009. All Rights Reserved.