com.metamatrix.dqp.service.metadata
Class QueryMetadataCache

java.lang.Object
  extended by com.metamatrix.dqp.service.metadata.QueryMetadataCache

public class QueryMetadataCache
extends java.lang.Object

This caches QueryMetadataInterface implementations for all vdbs, each implementation has access to metadata for a given vdb and the system vdb.

Since:
4.2

Nested Class Summary
protected  class QueryMetadataCache.QueryMetadataInterfaceHolder
          There a QMI holder per vdb, the holder shields metadata lookups by differrent thereads for differrent vdbs from having to wait for metadata being loaded for a single vdb.
 
Constructor Summary
QueryMetadataCache(byte[] sysemVdbContent)
          Constructor given the contents of a system vdb.
QueryMetadataCache(java.lang.String filePath)
          Constructor given the filePath to a system vdb.
QueryMetadataCache(java.net.URL systemVdbUrl)
          Constructor givena URL to a system vdb.
 
Method Summary
 void clearCache()
          Clears all state on this cache and also deletes any indexfiles associated with the cache.
 com.metamatrix.connector.metadata.internal.IObjectSource getCompositeMetadataObjectSource(java.lang.String vdbName, java.lang.String vdbVersion, VDBService vdbService)
           
 IndexSelector getCompositeSelector(java.lang.String vdbName, java.lang.String vdbVersion)
          Get the composite selector fot the given vdbName, version.
 boolean isValid()
          Check if this query metadata cache is valid, if the cache has been cleared it is no longer valid.
 QueryMetadataInterface lookupMetadata(java.lang.String vdbName, java.lang.String vdbVersion)
          Look up metadata for the given vdbName, version.
 QueryMetadataInterface lookupMetadata(java.lang.String vdbName, java.lang.String vdbVersion, byte[] vdbContent)
          Look up metadata for the given vdbName, version at the given filecontent.
 QueryMetadataInterface lookupMetadata(java.lang.String vdbName, java.lang.String vdbVersion, java.io.InputStream vdbContent)
          Look up metadata for the given vdbName, version at the given filecontent.
 void removeFromCache(java.lang.String vdbName, java.lang.String vdbVersion)
          Remove cache for a given vdb, called when a vdb is actually deleted.
 QueryMetadataInterface testLoadMetadata(java.lang.String vdbName, java.lang.String vdbVersion, java.lang.String filePath)
          Only to be used by UnitTests
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryMetadataCache

public QueryMetadataCache(java.net.URL systemVdbUrl)
                   throws MetaMatrixComponentException
Constructor givena URL to a system vdb.

Throws:
MetaMatrixComponentException
Since:
4.2

QueryMetadataCache

public QueryMetadataCache(byte[] sysemVdbContent)
                   throws MetaMatrixComponentException
Constructor given the contents of a system vdb.

Throws:
MetaMatrixComponentException
Since:
4.2

QueryMetadataCache

public QueryMetadataCache(java.lang.String filePath)
                   throws MetaMatrixComponentException
Constructor given the filePath to a system vdb.

Throws:
MetaMatrixComponentException
Since:
4.2
Method Detail

isValid

public boolean isValid()
Check if this query metadata cache is valid, if the cache has been cleared it is no longer valid.

Returns:
Since:
4.3

getCompositeSelector

public IndexSelector getCompositeSelector(java.lang.String vdbName,
                                          java.lang.String vdbVersion)
Get the composite selector fot the given vdbName, version.


getCompositeMetadataObjectSource

public com.metamatrix.connector.metadata.internal.IObjectSource getCompositeMetadataObjectSource(java.lang.String vdbName,
                                                                                                 java.lang.String vdbVersion,
                                                                                                 VDBService vdbService)

lookupMetadata

public QueryMetadataInterface lookupMetadata(java.lang.String vdbName,
                                             java.lang.String vdbVersion)
Look up metadata for the given vdbName, version. This method will return null if no cached QMI could be found.


lookupMetadata

public QueryMetadataInterface lookupMetadata(java.lang.String vdbName,
                                             java.lang.String vdbVersion,
                                             byte[] vdbContent)
                                      throws MetaMatrixComponentException
Look up metadata for the given vdbName, version at the given filecontent.

Throws:
MetaMatrixComponentException

lookupMetadata

public QueryMetadataInterface lookupMetadata(java.lang.String vdbName,
                                             java.lang.String vdbVersion,
                                             java.io.InputStream vdbContent)
                                      throws MetaMatrixComponentException
Look up metadata for the given vdbName, version at the given filecontent.

Throws:
MetaMatrixComponentException

clearCache

public void clearCache()
Clears all state on this cache and also deletes any indexfiles associated with the cache.

Since:
4.2

removeFromCache

public void removeFromCache(java.lang.String vdbName,
                            java.lang.String vdbVersion)
Remove cache for a given vdb, called when a vdb is actually deleted. Also deletes any temp files associated with the vdb.


testLoadMetadata

public QueryMetadataInterface testLoadMetadata(java.lang.String vdbName,
                                               java.lang.String vdbVersion,
                                               java.lang.String filePath)
                                        throws MetaMatrixComponentException
Only to be used by UnitTests

Throws:
MetaMatrixComponentException


Copyright © 2009. All Rights Reserved.