Java Doc for ResultCache.java in  » Database-JDBC-Connection-Pool » sequoia-2.10.9 » org » continuent » sequoia » controller » cache » result » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database JDBC Connection Pool » sequoia 2.10.9 » org.continuent.sequoia.controller.cache.result 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.continuent.sequoia.controller.cache.result.AbstractResultCache
      org.continuent.sequoia.controller.cache.result.ResultCache

All known Subclasses:   org.continuent.sequoia.controller.cache.result.ResultCacheColumnUnique,  org.continuent.sequoia.controller.cache.result.ResultCacheTable,  org.continuent.sequoia.controller.cache.result.ResultCacheDatabase,  org.continuent.sequoia.controller.cache.result.ResultCacheColumn,
ResultCache
abstract public class ResultCache extends AbstractResultCache (Code)
This is a query cache implementation with tunable granularity.
Cache invalidation granularity can take on of the following values:
  • NO_INVALIDATE: no invalidation, the cache is inconsistent and this should just be used to determine hit ratio upper bound.
  • DATABASE: the cache is flushed each time the database is updated (every INSERT, UPDATE, DELETE, ... statement).
  • TABLE: table granularity, entries in the cache are invalidated based on table dependencies.
  • COLUMN: column granularity, entries in the cache are invalidated based on column dependencies
  • COLUMN_UNIQUE: same as COLUMN except that UNIQUE queries that selects a single row based on a key are invalidated only when needed.

author:
   Emmanuel Cecchet
author:
   Julie Marguerite
author:
   Sara Bouchenak
author:
   Nicolas Modrzyk
version:
   1.0


Field Summary
protected  CacheDatabaseSchemacdbs
    

Constructor Summary
public  ResultCache(int maxEntries, int pendingTimeout)
     Creates a new Cache instance.

Method Summary
public  voidaddCachingRule(ResultCacheRule rule)
    
public  voidaddToCache(SelectRequest request, ControllerResultSet result)
     Adds an entry request/reply to the cache.
public  voidcommit(long transactionId)
     Commit a transaction given its id.
public  voidflushCache()
     Removes all entries from the cache.
public  String[][]getCacheData()
    
public  longgetCacheSize()
    
public  CacheStatisticsgetCacheStatistics()
    
public  String[][]getCacheStatsData()
    
public  ResultCacheRulegetDefaultRule()
    
public  ArrayListgetEagerCache()
     Returns the eagerCache value.
public  AbstractResultCacheEntrygetFromCache(SelectRequest request, boolean addToPendingQueries)
     Gets the result to the given request from the cache.
abstract public  StringgetName()
    
public  intgetParsingGranularity()
     Gets the needed query parsing granularity.
public  intgetPendingQueryTimeout()
     Returns the pending query timeout in seconds.
public  HashMapgetQueries()
    
public  ArrayListgetRelaxedCache()
     Returns the relaxedCache value.
protected  StringgetXmlImpl()
    
abstract public  booleanisUpdateNecessary(UpdateRequest request)
    
public  voidmergeDatabaseSchema(DatabaseSchema dbs)
     Merge the given DatabaseSchema with the current one.
public  boolean[]needInvalidate(ControllerResultSet result, UpdateRequest request)
     Do we need invalidation after an update request, given a ControllerResultSet.
abstract protected  voidprocessAddToCache(AbstractResultCacheEntry qe)
     Process the add to cache to update implementation specific data structures.
abstract protected  voidprocessWriteNotify(AbstractWriteRequest request)
     Implementation specific invalidation of the cache.
public  voidremoveFromCache(SelectRequest request)
     Removes an entry from the cache (both request and reply are dropped).
public  voidremoveFromPendingQueries(SelectRequest request)
     Removes an entry from the pending query list.
public  voidrollback(long transactionId)
     Rollback a transaction given its id.
public  voidsetDatabaseSchema(DatabaseSchema dbs)
     Sets the DatabaseSchema of the current virtual database.
public  voidsetDefaultRule(ResultCacheRule defaultRule)
    
public  voidsetPendingQueryTimeout(int pendingQueryTimeout)
     Sets the pending query timeout in seconds.
public synchronized  voidshutdown()
     Shutdown the result cache and all its threads.
public  voidwriteNotify(AbstractWriteRequest request)
     Notifies the cache that this write request has been issued, so that cache coherency can be maintained.

Field Detail
cdbs
protected CacheDatabaseSchema cdbs(Code)




Constructor Detail
ResultCache
public ResultCache(int maxEntries, int pendingTimeout)(Code)
Creates a new Cache instance.
Parameters:
  maxEntries - maximum number of cache entries
Parameters:
  pendingTimeout - pending queries timeout




Method Detail
addCachingRule
public void addCachingRule(ResultCacheRule rule)(Code)
Add a rule for this ResultCache
Parameters:
  rule - that contains information on the action to perform for aspecific query



addToCache
public void addToCache(SelectRequest request, ControllerResultSet result) throws CacheException(Code)
Adds an entry request/reply to the cache. Note that if the request was already in the cache, only the result is updated.
Parameters:
  request - the request
Parameters:
  result - the result corresponding to the request
exception:
  CacheException - if an error occurs



commit
public void commit(long transactionId) throws CacheException(Code)
Commit a transaction given its id.
Parameters:
  transactionId - the transaction id
throws:
  CacheException - if an error occurs



flushCache
public void flushCache()(Code)
Removes all entries from the cache.



getCacheData
public String[][] getCacheData() throws CacheException(Code)

See Also:   org.continuent.sequoia.controller.cache.result.AbstractResultCache.getCacheData



getCacheSize
public long getCacheSize()(Code)
Get Cache size the approximate size of the cache in bytes



getCacheStatistics
public CacheStatistics getCacheStatistics()(Code)
Returns the stats.



getCacheStatsData
public String[][] getCacheStatsData() throws CacheException(Code)

See Also:   org.continuent.sequoia.controller.cache.result.AbstractResultCache.getCacheStatsData



getDefaultRule
public ResultCacheRule getDefaultRule()(Code)

See Also:   org.continuent.sequoia.controller.cache.result.AbstractResultCache.getDefaultRule



getEagerCache
public ArrayList getEagerCache()(Code)
Returns the eagerCache value. Returns the eagerCache.



getFromCache
public AbstractResultCacheEntry getFromCache(SelectRequest request, boolean addToPendingQueries)(Code)
Gets the result to the given request from the cache. The returned AbstractResultCacheEntry is null if the request is not present in the cache.

An invalid AbstractResultCacheEntry may be returned (it means that the result is null) but the already parsed query can be retrieved from the cache entry.
Parameters:
  request - an SQL select request
Parameters:
  addToPendingQueries - true if the request must be addedto the pending query list on a cache miss the AbstractResultCacheEntry if found, elsenull




getName
abstract public String getName()(Code)
Retrieve the name of this cache name



getParsingGranularity
public int getParsingGranularity()(Code)
Gets the needed query parsing granularity. needed query parsing granularity



getPendingQueryTimeout
public int getPendingQueryTimeout()(Code)
Returns the pending query timeout in seconds. the pending query timeout.
See Also:   ResultCache.setPendingQueryTimeout



getQueries
public HashMap getQueries()(Code)
Possibly we want to access the queries in the cache for timing purposes the HashMap of queries (not synchronized)



getRelaxedCache
public ArrayList getRelaxedCache()(Code)
Returns the relaxedCache value. Returns the relaxedCache.



getXmlImpl
protected String getXmlImpl()(Code)
Gets information about the request cache String containing information



isUpdateNecessary
abstract public boolean isUpdateNecessary(UpdateRequest request) throws CacheException(Code)

See Also:   org.continuent.sequoia.controller.cache.result.AbstractResultCache.isUpdateNecessary(org.continuent.sequoia.controller.requests.UpdateRequest)



mergeDatabaseSchema
public void mergeDatabaseSchema(DatabaseSchema dbs)(Code)
Merge the given DatabaseSchema with the current one.
Parameters:
  dbs - a DatabaseSchema value
See Also:   org.continuent.sequoia.controller.cache.result.schema.CacheDatabaseSchema



needInvalidate
public boolean[] needInvalidate(ControllerResultSet result, UpdateRequest request)(Code)
Do we need invalidation after an update request, given a ControllerResultSet. Note that this method is meant to be used with unique queries where the ControllerResultSet is the result of a pk selection (like an Entity Bean).
Parameters:
  result - that could be in the cache
Parameters:
  request - the update we want to get updated values from boolean[] {needInvalidate,needToSendQuery}



processAddToCache
abstract protected void processAddToCache(AbstractResultCacheEntry qe)(Code)
Process the add to cache to update implementation specific data structures.
Parameters:
  qe - to add to the cache.



processWriteNotify
abstract protected void processWriteNotify(AbstractWriteRequest request)(Code)
Implementation specific invalidation of the cache.
Parameters:
  request - Write request that invalidates the cache.



removeFromCache
public void removeFromCache(SelectRequest request)(Code)
Removes an entry from the cache (both request and reply are dropped). The request is NOT removed from the pending query list, but it shouldn't be in this list.
Parameters:
  request - a SelectRequest



removeFromPendingQueries
public void removeFromPendingQueries(SelectRequest request)(Code)
Removes an entry from the pending query list.
Parameters:
  request - a SelectRequest



rollback
public void rollback(long transactionId) throws CacheException(Code)
Rollback a transaction given its id.
Parameters:
  transactionId - the transaction id
throws:
  CacheException - if an error occurs



setDatabaseSchema
public void setDatabaseSchema(DatabaseSchema dbs)(Code)
Sets the DatabaseSchema of the current virtual database.
Parameters:
  dbs - a DatabaseSchema value
See Also:   org.continuent.sequoia.controller.cache.result.schema.CacheDatabaseSchema



setDefaultRule
public void setDefaultRule(ResultCacheRule defaultRule)(Code)

See Also:   org.continuent.sequoia.controller.cache.result.AbstractResultCache.setDefaultRule(ResultCacheRule)



setPendingQueryTimeout
public void setPendingQueryTimeout(int pendingQueryTimeout)(Code)
Sets the pending query timeout in seconds.
Parameters:
  pendingQueryTimeout - the pending query timeout to set.
See Also:   ResultCache.getPendingQueryTimeout



shutdown
public synchronized void shutdown()(Code)
Shutdown the result cache and all its threads.



writeNotify
public void writeNotify(AbstractWriteRequest request) throws CacheException(Code)
Notifies the cache that this write request has been issued, so that cache coherency can be maintained. If the cache is distributed, this method is reponsible for broadcasting this information to other caches.
Parameters:
  request - an AbstractRequest value
exception:
  CacheException - if an error occurs



Fields inherited from org.continuent.sequoia.controller.cache.result.AbstractResultCache
protected static Trace logger(Code)(Java Doc)
protected int parsingGranularity(Code)(Java Doc)

Methods inherited from org.continuent.sequoia.controller.cache.result.AbstractResultCache
abstract public void addCachingRule(ResultCacheRule rule)(Code)(Java Doc)
abstract public void addToCache(SelectRequest request, ControllerResultSet result) throws CacheException(Code)(Java Doc)
abstract public void commit(long transactionId) throws CacheException(Code)(Java Doc)
abstract public void flushCache()(Code)(Java Doc)
abstract public String[][] getCacheData() throws CacheException(Code)(Java Doc)
abstract public long getCacheSize()(Code)(Java Doc)
abstract public CacheStatistics getCacheStatistics()(Code)(Java Doc)
abstract public String[][] getCacheStatsData() throws CacheException(Code)(Java Doc)
abstract public ResultCacheRule getDefaultRule()(Code)(Java Doc)
abstract public AbstractResultCacheEntry getFromCache(SelectRequest request, boolean addToPendingQueries)(Code)(Java Doc)
public int getParsingGranularity()(Code)(Java Doc)
public String getXml()(Code)(Java Doc)
abstract protected String getXmlImpl()(Code)(Java Doc)
abstract public boolean isUpdateNecessary(UpdateRequest request) throws CacheException(Code)(Java Doc)
public void mergeDatabaseSchema(DatabaseSchema dbs)(Code)(Java Doc)
abstract public void removeFromCache(SelectRequest request)(Code)(Java Doc)
abstract public void removeFromPendingQueries(SelectRequest request)(Code)(Java Doc)
abstract public void rollback(long transactionId) throws CacheException(Code)(Java Doc)
public void setDatabaseSchema(DatabaseSchema dbs)(Code)(Java Doc)
abstract public void setDefaultRule(ResultCacheRule defaultRule)(Code)(Java Doc)
public void setParsingGranularity(int parsingGranularity)(Code)(Java Doc)
abstract public void shutdown()(Code)(Java Doc)
abstract public void writeNotify(AbstractWriteRequest request) throws CacheException(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.