Skip navigation links

Oracle® Fusion Middleware Java API Reference for Oracle Coherence
12c (12.1.3.0.0)

E47890-01


com.tangosol.io.journal
Class AbstractJournalRM.CollectorDaemon

java.lang.Object
  extended by com.tangosol.util.Base
      extended by com.tangosol.util.Daemon
          extended by com.tangosol.io.journal.AbstractJournalRM.CollectorDaemon

All Implemented Interfaces:
Guardable, java.lang.Runnable
Enclosing class:
AbstractJournalRM

protected class AbstractJournalRM.CollectorDaemon
extends Daemon

The CollectorDaemon evaluates the JournalFile objects to see which ones should be evacuated, it evacuates those that should be, and it deletes those that have been successfully evacuated.

This daemon is not intended to be guarded.


Nested Class Summary
protected  class AbstractJournalRM.CollectorDaemon.CollectionCoordinator
          A CollectionCoordinator is responsible for shaping an evacuation as well as managing any reserved files created to ensure the journal continues to operate.
protected  class AbstractJournalRM.CollectorDaemon.InvokeGCJournalFile
          A AbstractJournalRM.JournalFile implementation returned when the journal has consumed all known capacity.

 

Nested classes/interfaces inherited from class com.tangosol.util.Daemon
Daemon.DaemonWorker

 

Constructor Summary
AbstractJournalRM.CollectorDaemon()
          Construct a CollectorDaemon.

 

Method Summary
protected  void dedupe()
          Give the in-memory radix key stores a chance to de-dupe their byte[] values, similar to the concept behind String's intern() method.
protected  AbstractJournalRM.CollectorDaemon.CollectionCoordinator getCoordinator()
          Return a AbstractJournalRM.CollectorDaemon.CollectionCoordinator.
protected  java.lang.String getDescription()
          Format the Daemon attributes into a String for inclusion in the String returned from the Daemon.toString() method.
protected  int getReservedFileId()
          Return the currently reserved file id.
protected  Daemon.DaemonWorker instantiateWorker()
          Instantiate a DaemonWorker that will be used as a daemon.
 void notifyReleased(int cbReleased, int nFileId)
          Notifies the collector that a AbstractJournalRM.CollectorDaemon.InvokeGCJournalFile has had some memory released.
 void run()
          The daemon's implementation method.
protected  void setGuardPolicy(Guardian guardian, long cTimeoutMillis, float flPctRecover)
          Set the Guardian and policy to guard this Daemon with.
protected  java.util.Iterator sortedIterator()
          Returns a sorted Iterator based on the amount of released memory in each AbstractJournalRM.CollectorDaemon.InvokeGCJournalFile.
 void stop()
          Request the daemon to stop.

 

Methods inherited from class com.tangosol.util.Daemon
changeState, configureWorker, ensureThreadGroup, finishStarting, finishStopping, getConfiguredName, getConfiguredPriority, getContext, getGuardRegisterAction, getMaxWaitMillis, getState, getThread, getThreadContextClassLoader, getWorker, guardIfNeeded, heartbeat, heartbeat, isGuarded, isOnWorkerThread, isRunning, isStopping, recover, setConfiguredName, setConfiguredPriority, setContext, setGuardRegisterAction, setThreadContextClassLoader, shutdown, start, terminate, toStateString, toString

 

Constructor Detail

AbstractJournalRM.CollectorDaemon

public AbstractJournalRM.CollectorDaemon()
Construct a CollectorDaemon.

Method Detail

instantiateWorker

protected Daemon.DaemonWorker instantiateWorker()
Instantiate a DaemonWorker that will be used as a daemon.
Overrides:
instantiateWorker in class Daemon
Returns:
a new instance of DaemonWorker or a sub-class thereof

stop

public void stop()
Request the daemon to stop. This method will only have an effect if the daemon sub-class respects the value returned from Daemon.isStopping().
Overrides:
stop in class Daemon

run

public void run()
The daemon's implementation method. Override this method to implement a daemon.

An example implementation is:

   while (!isStopping())
       {
       // do some processing
       // ...

       synchronized (this)
           {
           // wait for notification of more work
           wait();
           }
       }
 
Specified by:
run in interface java.lang.Runnable
Specified by:
run in class Daemon

setGuardPolicy

protected void setGuardPolicy(Guardian guardian,
                              long cTimeoutMillis,
                              float flPctRecover)
Set the Guardian and policy to guard this Daemon with. The Daemon is registered with the specified Guardian each time the Daemon is started, and is released each time the Daemon is stopped.
Overrides:
setGuardPolicy in class Daemon
Parameters:
guardian - the Guardian that will be guarding this Daemon
cTimeoutMillis - the timeout in ms for this Daemon, or 0 for the service guardian timeout
flPctRecover - the recovery percentage for this Daemon

sortedIterator

protected java.util.Iterator sortedIterator()
Returns a sorted Iterator based on the amount of released memory in each AbstractJournalRM.CollectorDaemon.InvokeGCJournalFile.
Returns:
a sorted iterator ascending based on released memory

getDescription

protected java.lang.String getDescription()
Format the Daemon attributes into a String for inclusion in the String returned from the Daemon.toString() method.
Overrides:
getDescription in class Daemon
Returns:
a String listing the attributes of the Daemon

dedupe

protected void dedupe()
Give the in-memory radix key stores a chance to de-dupe their byte[] values, similar to the concept behind String's intern() method.

notifyReleased

public void notifyReleased(int cbReleased,
                           int nFileId)
Notifies the collector that a AbstractJournalRM.CollectorDaemon.InvokeGCJournalFile has had some memory released.
Parameters:
cbReleased - the number of bytes released
nFileId - the AbstractJournalRM.CollectorDaemon.InvokeGCJournalFile's file id

getReservedFileId

protected int getReservedFileId()
Return the currently reserved file id.
Returns:
the currently reserved file id

getCoordinator

protected AbstractJournalRM.CollectorDaemon.CollectionCoordinator getCoordinator()
Return a AbstractJournalRM.CollectorDaemon.CollectionCoordinator.
Returns:
a CollectionCoordinator

Skip navigation links

Oracle® Fusion Middleware Java API Reference for Oracle Coherence
12c (12.1.3.0.0)

E47890-01


Copyright © 2000, 2014, Oracle and/or its affiliates. All rights reserved.