org.rrd4j.core
Class RrdNioBackendFactory

java.lang.Object
  extended by org.rrd4j.core.RrdBackendFactory
      extended by org.rrd4j.core.RrdFileBackendFactory
          extended by org.rrd4j.core.RrdNioBackendFactory

public class RrdNioBackendFactory
extends RrdFileBackendFactory

Factory class which creates actual RrdNioBackend objects. This is the default factory since 1.4.0 version


Field Summary
static int DEFAULT_SYNC_CORE_POOL_SIZE
          The core pool size for the sync executor.
static int DEFAULT_SYNC_PERIOD
          Period in seconds between consecutive synchronizations when sync-mode is set to SYNC_BACKGROUND.
 
Constructor Summary
RrdNioBackendFactory()
           
 
Method Summary
 String getName()
          Returns the name (primary ID) for the factory.
static int getSyncPeriod()
          Returns time between two consecutive background synchronizations.
protected  RrdBackend open(String path, boolean readOnly)
          Creates RrdNioBackend object for the given file path.
static void setSyncPeriod(int syncPeriod)
          Sets time between consecutive background synchronizations.
 
Methods inherited from class org.rrd4j.core.RrdFileBackendFactory
exists, shouldValidateHeader
 
Methods inherited from class org.rrd4j.core.RrdBackendFactory
getDefaultFactory, getFactory, registerAndSetAsDefaultFactory, registerFactory, setDefaultFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SYNC_PERIOD

public static final int DEFAULT_SYNC_PERIOD
Period in seconds between consecutive synchronizations when sync-mode is set to SYNC_BACKGROUND. By default in-memory cache will be transferred to the disc every 300 seconds (5 minutes). Default value can be changed via setSyncPeriod(int) method.

See Also:
Constant Field Values

DEFAULT_SYNC_CORE_POOL_SIZE

public static final int DEFAULT_SYNC_CORE_POOL_SIZE
The core pool size for the sync executor. Defaults to 6.

See Also:
Constant Field Values
Constructor Detail

RrdNioBackendFactory

public RrdNioBackendFactory()
Method Detail

getSyncPeriod

public static int getSyncPeriod()
Returns time between two consecutive background synchronizations. If not changed via setSyncPeriod(int) method call, defaults to DEFAULT_SYNC_PERIOD. See setSyncPeriod(int) for more information.

Returns:
Time in seconds between consecutive background synchronizations.

setSyncPeriod

public static void setSyncPeriod(int syncPeriod)
Sets time between consecutive background synchronizations.

Parameters:
syncPeriod - Time in seconds between consecutive background synchronizations.

open

protected RrdBackend open(String path,
                          boolean readOnly)
                   throws IOException
Creates RrdNioBackend object for the given file path.

Specified by:
open in class RrdBackendFactory
Parameters:
path - File path
readOnly - True, if the file should be accessed in read/only mode. False otherwise.
Returns:
RrdNioBackend object which handles all I/O operations for the given file path
Throws:
IOException - Thrown in case of I/O error.

getName

public String getName()
Description copied from class: RrdBackendFactory
Returns the name (primary ID) for the factory.

Specified by:
getName in class RrdBackendFactory
Returns:
Name of the factory.


Copyright © 2011. All Rights Reserved.