Java Doc for Cleaner.java in  » JMX » je » com » sleepycat » je » cleaner » 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 » JMX » je » com.sleepycat.je.cleaner 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sleepycat.je.cleaner.Cleaner

Cleaner
public class Cleaner implements DaemonRunner,EnvConfigObserver(Code)
The Cleaner is responsible for effectively garbage collecting the JE log. It looks through log files and locates log records (IN's and LN's of all flavors) that are superceded by later versions. Those that are "current" are propagated to a newer log file so that older log files can be deleted.


Field Summary
final static  StringCLEAN_IN
    
final static  StringCLEAN_LN
    
final static  StringCLEAN_MIGRATE_LN
    
final static  StringCLEAN_PENDING_LN
    
final static  booleanDO_CRITICAL_EVICTION
     Whether the cleaner should participate in critical eviction.
final static  booleanPROACTIVE_MIGRATION
     Whether to fetch LNs for files in the to-be-cleaned set during lazy migration.
final static  booleanUPDATE_GENERATION
     Whether to update the IN generation count during searches.
 longcleanerBytesInterval
    
 booleanclusterAll
    
 booleanclusterResident
    
 LeveldetailedTraceLevel
    
 booleanexpunge
    
 booleanfetchObsoleteSize
    
 longlockTimeout
    
 intlookAheadCacheSize
    
 SetlowUtilizationFiles
     All files that are below the minUtilization threshold.
 intmaxBatchFiles
    
 SetmustBeCleanedFiles
     All files that are to-be-cleaning or being-cleaned.
 intnBacklogFiles
    
 intnCleanerDeletions
    
 intnCleanerRuns
    
 intnClusterLNsProcessed
    
 intnDeadlockRetries
    
 intnEntriesRead
    
 intnINsCleaned
    
 intnINsDead
    
 intnINsMigrated
    
 intnINsObsolete
    
 intnLNQueueHits
    
 intnLNsCleaned
    
 intnLNsDead
    
 intnLNsLocked
    
 intnLNsMarked
    
 intnLNsMigrated
    
 intnLNsObsolete
    
 intnMarkedLNsProcessed
    
 intnPendingLNsLocked
    
 intnPendingLNsProcessed
    
 longnRepeatIteratorReads
    
 intnToBeCleanedLNsProcessed
    
 intreadBufferSize
    
 booleantrackDetail
    

Constructor Summary
public  Cleaner(EnvironmentImpl env, String name)
    

Method Summary
 voidaddPendingDB(DatabaseImpl db)
     Adds the DB ID to the pending DB set if it is being deleted but deletion is not yet complete.
public  voidclearDeleteProhibited()
    
 voiddeleteSafeToDeleteFiles()
     Deletes all files that are safe-to-delete, if there are no read/only processes and concurrent backups. Deletion is coordinated by the synchronization variable deleteFileLock AND by the deleteProhibited state variable.
public  intdoClean(boolean cleanMultipleFiles, boolean forceCleaning)
     Cleans selected files and returns the number of files cleaned.
public  voidenvConfigUpdate(DbConfigManager cm)
     Process notifications of mutable property changes.
public  booleangetFetchObsoleteSize()
    
public  CheckpointStartCleanerStategetFilesAtCheckpointStart()
     Returns a copy of the cleaned and processed files at the time a checkpoint starts.
public  intgetNWakeupRequests()
    
public  UtilizationProfilegetUtilizationProfile()
    
public  UtilizationTrackergetUtilizationTracker()
    
 voidinjectFileForCleaning(Long fileNum)
     For unit testing.
public  booleanisEvictable(BIN bin, int index)
     Returns whether the given BIN entry may be stripped by the evictor. True is always returned if the BIN is not dirty.
public  voidlazyMigrateDupCountLN(DIN din, ChildReference dclRef, boolean proactiveMigration)
     This method should be called just before logging a root DIN.
public  voidlazyMigrateLNs(BIN bin, boolean proactiveMigration, boolean backgroundIO)
     This method should be called just before logging a BIN.
public  voidloadStats(StatsConfig config, EnvironmentStats stat)
     Load stats.
 voidprocessPending()
     If any LNs are pending, process them.
public  voidrequestShutdown()
    
public  voidrunOrPause(boolean run)
    
public  voidsetDeleteProhibited()
    
public  voidshutdown()
    
 voidtrace(Level level, String action, Node node, long logLsn, boolean completed, boolean obsolete, boolean dirtiedMigrated)
     Send trace messages to the java.util.logger.
public  voidupdateFilesAtCheckpointEnd(CheckpointStartCleanerState info)
     When a checkpoint is complete, update the files that were returned at the beginning of the checkpoint.
public  voidupdateReadOnlyFileCollections()
     Update the lowUtilizationFiles and mustBeCleanedFiles fields with new read-only collections, and update the backlog file count.
public  voidwakeup()
    

Field Detail
CLEAN_IN
final static String CLEAN_IN(Code)



CLEAN_LN
final static String CLEAN_LN(Code)



CLEAN_MIGRATE_LN
final static String CLEAN_MIGRATE_LN(Code)



CLEAN_PENDING_LN
final static String CLEAN_PENDING_LN(Code)



DO_CRITICAL_EVICTION
final static boolean DO_CRITICAL_EVICTION(Code)
Whether the cleaner should participate in critical eviction. Ideally the cleaner would not participate in eviction, since that would reduce the cost of cleaning. However, the cleaner can add large numbers of nodes to the cache. By not participating in eviction, other threads could be kept in a constant state of eviction and would effectively starve. Therefore, this setting is currently enabled.



PROACTIVE_MIGRATION
final static boolean PROACTIVE_MIGRATION(Code)
Whether to fetch LNs for files in the to-be-cleaned set during lazy migration. This is currently enabled because we do not support the dynamic addition of cleaner threads; that way, if the configured cleaner threads cannot keep up, we use proactive migration to keep up.



UPDATE_GENERATION
final static boolean UPDATE_GENERATION(Code)
Whether to update the IN generation count during searches. This is currently disabled because 1) we update the generation of the BIN when we set a MIGRATE flag and 2) if the BIN is not evicted its parents will not be, so not updating the generation during the search has no benefit. By not updating the generation during searches for which we do NOT set the MIGRATE flag, we avoid holding INs in the cache that are not needed for lazy migration. However, we do very few searches for obsolete LNs because the obsolete tracking info prevents this, so the benefit of not updating the generation during searches is questionable. In other words, changing this setting will have little effect.



cleanerBytesInterval
long cleanerBytesInterval(Code)



clusterAll
boolean clusterAll(Code)



clusterResident
boolean clusterResident(Code)



detailedTraceLevel
Level detailedTraceLevel(Code)



expunge
boolean expunge(Code)



fetchObsoleteSize
boolean fetchObsoleteSize(Code)



lockTimeout
long lockTimeout(Code)



lookAheadCacheSize
int lookAheadCacheSize(Code)



lowUtilizationFiles
Set lowUtilizationFiles(Code)
All files that are below the minUtilization threshold. Used to perform clustering migration. Is read-only after assignment, so no synchronization is needed.



maxBatchFiles
int maxBatchFiles(Code)



mustBeCleanedFiles
Set mustBeCleanedFiles(Code)
All files that are to-be-cleaning or being-cleaned. Used to perform proactive migration. Is read-only after assignment, so no synchronization is needed.



nBacklogFiles
int nBacklogFiles(Code)



nCleanerDeletions
int nCleanerDeletions(Code)



nCleanerRuns
int nCleanerRuns(Code)



nClusterLNsProcessed
int nClusterLNsProcessed(Code)



nDeadlockRetries
int nDeadlockRetries(Code)



nEntriesRead
int nEntriesRead(Code)



nINsCleaned
int nINsCleaned(Code)



nINsDead
int nINsDead(Code)



nINsMigrated
int nINsMigrated(Code)



nINsObsolete
int nINsObsolete(Code)



nLNQueueHits
int nLNQueueHits(Code)



nLNsCleaned
int nLNsCleaned(Code)



nLNsDead
int nLNsDead(Code)



nLNsLocked
int nLNsLocked(Code)



nLNsMarked
int nLNsMarked(Code)



nLNsMigrated
int nLNsMigrated(Code)



nLNsObsolete
int nLNsObsolete(Code)



nMarkedLNsProcessed
int nMarkedLNsProcessed(Code)



nPendingLNsLocked
int nPendingLNsLocked(Code)



nPendingLNsProcessed
int nPendingLNsProcessed(Code)



nRepeatIteratorReads
long nRepeatIteratorReads(Code)



nToBeCleanedLNsProcessed
int nToBeCleanedLNsProcessed(Code)



readBufferSize
int readBufferSize(Code)



trackDetail
boolean trackDetail(Code)




Constructor Detail
Cleaner
public Cleaner(EnvironmentImpl env, String name) throws DatabaseException(Code)




Method Detail
addPendingDB
void addPendingDB(DatabaseImpl db)(Code)
Adds the DB ID to the pending DB set if it is being deleted but deletion is not yet complete.



clearDeleteProhibited
public void clearDeleteProhibited()(Code)



deleteSafeToDeleteFiles
void deleteSafeToDeleteFiles() throws DatabaseException(Code)
Deletes all files that are safe-to-delete, if there are no read/only processes and concurrent backups. Deletion is coordinated by the synchronization variable deleteFileLock AND by the deleteProhibited state variable. The reason that two different mechanisms are use is because file deletion must be prevented both inter and intra-process. File locks must be used for inter-process, and the state bit for intra-process. To guard against read/only processes, the would-be deleter tries to get an exclusive lock on the environment. This will not be possible if a read/only process exists. To guard against backup mode, the would-be deleter checks the deleteProhibited state. Backup and file deletion can only be carried out by a read/write process, so both activities are working in the same process. Note that file locks are not supported intra-process. The deleteProhibited state is used rather than a simple synchronization on deleteFileLock because the start/endBackup is controlled by the application, and the copying of log files can take an arbitrarily long time. Using synchronization on deleteFileLock would make it possible to lock out a cleaner thread for an unacceptable amount of time.



doClean
public int doClean(boolean cleanMultipleFiles, boolean forceCleaning) throws DatabaseException(Code)
Cleans selected files and returns the number of files cleaned. This method is not invoked by a deamon thread, it is programatically.
Parameters:
  cleanMultipleFiles - is true to clean until we're under budget,or false to clean at most one file.
Parameters:
  forceCleaning - is true to clean even if we're not under theutilization threshold. the number of files cleaned, not including files cleanedunsuccessfully.



envConfigUpdate
public void envConfigUpdate(DbConfigManager cm) throws DatabaseException(Code)
Process notifications of mutable property changes.



getFetchObsoleteSize
public boolean getFetchObsoleteSize()(Code)



getFilesAtCheckpointStart
public CheckpointStartCleanerState getFilesAtCheckpointStart() throws DatabaseException(Code)
Returns a copy of the cleaned and processed files at the time a checkpoint starts.

If non-null is returned, the checkpoint should flush an extra level, and addCheckpointedFiles() should be called when the checkpoint is complete.




getNWakeupRequests
public int getNWakeupRequests()(Code)



getUtilizationProfile
public UtilizationProfile getUtilizationProfile()(Code)



getUtilizationTracker
public UtilizationTracker getUtilizationTracker()(Code)



injectFileForCleaning
void injectFileForCleaning(Long fileNum)(Code)
For unit testing.



isEvictable
public boolean isEvictable(BIN bin, int index)(Code)
Returns whether the given BIN entry may be stripped by the evictor. True is always returned if the BIN is not dirty. False is returned if the BIN is dirty and the entry will be migrated soon.



lazyMigrateDupCountLN
public void lazyMigrateDupCountLN(DIN din, ChildReference dclRef, boolean proactiveMigration) throws DatabaseException(Code)
This method should be called just before logging a root DIN. The DupCountLN will be migrated if the MIGRATE flag is set, or if it is in a file to be cleaned, or if the LN qualifies according to the rules for cluster and clusterAll.

On return this method guarantees that the MIGRATE flag will not be set on the child entry. If this method is *not* called before logging a root DIN, then the addPendingDupCountLN method must be called.


Parameters:
  din - is the latched DIN. The latch will not be released by thismethod.
Parameters:
  dclRef - is the reference to the DupCountLN.
Parameters:
  proactiveMigration - perform proactive migration if needed; this isfalse during a split, to reduce the delay in the user operation.



lazyMigrateLNs
public void lazyMigrateLNs(BIN bin, boolean proactiveMigration, boolean backgroundIO) throws DatabaseException(Code)
This method should be called just before logging a BIN. LNs will be migrated if the MIGRATE flag is set, or if they are in a file to be cleaned, or if the LNs qualify according to the rules for cluster and clusterAll.

On return this method guarantees that no MIGRATE flag will be set on any child entry. If this method is *not* called before logging a BIN, then the addPendingLNs method must be called.


Parameters:
  bin - is the latched BIN. The latch will not be released by thismethod.
Parameters:
  proactiveMigration - perform proactive migration if needed; this isfalse during a split, to reduce the delay in the user operation.



loadStats
public void loadStats(StatsConfig config, EnvironmentStats stat) throws DatabaseException(Code)
Load stats.



processPending
void processPending() throws DatabaseException(Code)
If any LNs are pending, process them. This method should be called often enough to prevent the pending LN set from growing too large.



requestShutdown
public void requestShutdown()(Code)



runOrPause
public void runOrPause(boolean run)(Code)



setDeleteProhibited
public void setDeleteProhibited()(Code)



shutdown
public void shutdown()(Code)



trace
void trace(Level level, String action, Node node, long logLsn, boolean completed, boolean obsolete, boolean dirtiedMigrated)(Code)
Send trace messages to the java.util.logger. Don't rely on the logger alone to conditionalize whether we send this message, we don't even want to construct the message if the level is not enabled.



updateFilesAtCheckpointEnd
public void updateFilesAtCheckpointEnd(CheckpointStartCleanerState info) throws DatabaseException(Code)
When a checkpoint is complete, update the files that were returned at the beginning of the checkpoint.



updateReadOnlyFileCollections
public void updateReadOnlyFileCollections()(Code)
Update the lowUtilizationFiles and mustBeCleanedFiles fields with new read-only collections, and update the backlog file count.



wakeup
public void wakeup()(Code)



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.