com.sleepycat.je
Class DiskOrderedCursorConfig

java.lang.Object
  extended by com.sleepycat.je.DiskOrderedCursorConfig
All Implemented Interfaces:
Cloneable

public class DiskOrderedCursorConfig
extends Object
implements Cloneable

Specifies the attributes of a DiskOrderedCursor.

Since:
5.0

Field Summary
static DiskOrderedCursorConfig DEFAULT
          Default configuration used if null is passed to methods that create a cursor.
 
Constructor Summary
DiskOrderedCursorConfig()
          An instance created using the default constructor is initialized with the system's default settings.
 
Method Summary
 DiskOrderedCursorConfig clone()
          Returns a copy of this configuration object.
 long getInternalMemoryLimit()
          Returns the maximum amount of non JE Cache Memory that the DiskOrderedScan can use at one time.
 boolean getKeysOnly()
          Returns true if the DiskOrderedCursor is configured to return only keys.
 long getLSNBatchSize()
          Returns the maximum number of LSNs to be sorted that this DiskOrderedCursor is configured for.
 long getMaxSeedMillisecs()
          Returns the maximum time (in milliseconds) to spend seeding the Disk Ordered Scan.
 long getMaxSeedNodes()
          Returns the maximum number of internal nodes to use to seed the Disk Ordered Scan.
 TestHook getMaxSeedTestHook()
           
 int getQueueSize()
          Returns the maximum number of entries in the queue before the DiskOrderedCursor producer thread blocks.
 DiskOrderedCursorConfig setInternalMemoryLimit(long internalMemoryLimit)
          Set the maximum amount of non JE Cache Memory that the DiskOrderedScan can use at one time.
 void setInternalMemoryLimitVoid(long internalMemoryLimit)
           
 DiskOrderedCursorConfig setKeysOnly(boolean keysOnly)
          Specify whether the DiskOrderedCursor should return only the key or key + data.
 void setKeysOnlyVoid(boolean keysOnly)
           
 DiskOrderedCursorConfig setLSNBatchSize(long lsnBatchSize)
          Set the maximum number of LSNs to gather and sort at any one time.
 void setLSNBatchSizeVoid(long lsnBatchSize)
           
 DiskOrderedCursorConfig setMaxSeedMillisecs(long maxSeedMillisecs)
          Set the maximum time in milliseconds to spend seeding the Disk Ordered Scan.
 void setMaxSeedMillisecsVoid(long maxSeedMillisecs)
           
 DiskOrderedCursorConfig setMaxSeedNodes(long maxSeedNodes)
          Set the maximum number of internal nodes to use to seed the Disk Ordered Scan.
 void setMaxSeedNodesVoid(long maxSeedNodes)
           
 DiskOrderedCursorConfig setMaxSeedTestHook(TestHook testHook)
           
 DiskOrderedCursorConfig setQueueSize(int queueSize)
          Set the queue size for entries being passed between the DiskOrderedCursor producer thread and the application's consumer thread.
 void setQueueSizeVoid(int queueSize)
           
 String toString()
          Returns the values for each configuration attribute.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT

public static final DiskOrderedCursorConfig DEFAULT
Default configuration used if null is passed to methods that create a cursor.

Constructor Detail

DiskOrderedCursorConfig

public DiskOrderedCursorConfig()
An instance created using the default constructor is initialized with the system's default settings.

Method Detail

setKeysOnly

public DiskOrderedCursorConfig setKeysOnly(boolean keysOnly)
Specify whether the DiskOrderedCursor should return only the key or key + data. The default value is false (key + data). If keyOnly is true, then no duplicate records are returned (i.e. the Cursor only descends to the BIN level). If keysOnly is false, then all records, including duplicates are returned.

Parameters:
keysOnly - If true, return only keys from this cursor.
Returns:
this

setKeysOnlyVoid

public void setKeysOnlyVoid(boolean keysOnly)

getKeysOnly

public boolean getKeysOnly()
Returns true if the DiskOrderedCursor is configured to return only keys. Returns false if it is configured to return keys + data.

Returns:
true if the DiskOrderedCursor is configured to return keys only.

setLSNBatchSize

public DiskOrderedCursorConfig setLSNBatchSize(long lsnBatchSize)
Set the maximum number of LSNs to gather and sort at any one time. The default is an unlimited number of LSNs. Setting this lower causes the DiskOrderedScan to use less memory, but it sorts and processes LSNs more frequently thereby causing slower performance. Setting this higher will in general improve performance at the expense of memory. Each LSN uses 16 bytes of memory.

Parameters:
lsnBatchSize - the maximum number of LSNs to accumulate and sort per batch.
Returns:
this

setLSNBatchSizeVoid

public void setLSNBatchSizeVoid(long lsnBatchSize)

getLSNBatchSize

public long getLSNBatchSize()
Returns the maximum number of LSNs to be sorted that this DiskOrderedCursor is configured for.

Returns:
the maximum number of LSNs to be sorted that this DiskOrderedCursor is configured for.

setInternalMemoryLimit

public DiskOrderedCursorConfig setInternalMemoryLimit(long internalMemoryLimit)
Set the maximum amount of non JE Cache Memory that the DiskOrderedScan can use at one time. The default is an unlimited amount of memory. Setting this lower causes the DiskOrderedScan to use less memory, but it sorts and processes LSNs more frequently thereby generally causing slower performance. Setting this higher will in general improve performance at the expense of memory.

Parameters:
internalMemoryLimit - the maximum number of non JE Cache bytes to use.
Returns:
this

setInternalMemoryLimitVoid

public void setInternalMemoryLimitVoid(long internalMemoryLimit)

getInternalMemoryLimit

public long getInternalMemoryLimit()
Returns the maximum amount of non JE Cache Memory that the DiskOrderedScan can use at one time.

Returns:
the maximum amount of non JE Cache Memory that preload can use at one time.

setQueueSize

public DiskOrderedCursorConfig setQueueSize(int queueSize)
Set the queue size for entries being passed between the DiskOrderedCursor producer thread and the application's consumer thread. If the queue size reaches this number of entries, the producer thread will block until the application thread removes one or more entries (by calling ForwardCursor.getNext(). The default is 1000.

Parameters:
queueSize - the maximum number of entries the queue can hold before the producer thread blocks.
Returns:
this

setQueueSizeVoid

public void setQueueSizeVoid(int queueSize)

getQueueSize

public int getQueueSize()
Returns the maximum number of entries in the queue before the DiskOrderedCursor producer thread blocks.

Returns:
the maximum number of entries in the queue before the DiskOrderedCursor producer thread blocks.

setMaxSeedMillisecs

public DiskOrderedCursorConfig setMaxSeedMillisecs(long maxSeedMillisecs)
Set the maximum time in milliseconds to spend seeding the Disk Ordered Scan. When a Disk Ordered Scan is initiated, it is first seeded with in-memory internal nodes (INs) from the database tree. The more INs that can be used for the seeding, the better the concurrent performance will be during the actual scan. However, during the seeding, a shared latch is placed on the root of the database tree, thereby reducing concurrency for non-read operations on the tree until the seeding is finished.

Parameters:
maxSeedMillisecs - the maximum milliseconds to spend seeding the Disk Ordered Scan.
Returns:
this

setMaxSeedMillisecsVoid

public void setMaxSeedMillisecsVoid(long maxSeedMillisecs)

getMaxSeedMillisecs

public long getMaxSeedMillisecs()
Returns the maximum time (in milliseconds) to spend seeding the Disk Ordered Scan.

Returns:
the maximum time (in milliseconds) to spend seeding the Disk Ordered Scan.

setMaxSeedNodes

public DiskOrderedCursorConfig setMaxSeedNodes(long maxSeedNodes)
Set the maximum number of internal nodes to use to seed the Disk Ordered Scan. When a Disk Ordered Scan is initiated, it is first seeded with in-memory internal nodes (INs) from the database tree. The more INs that can be used for the seeding, the better the concurrent performance will be during the actual scan. However, during the seeding, a shared latch is placed on the root of the database tree, thereby reducing concurrency for non-read operations on the tree until the seeding is finished.

Parameters:
maxSeedNodes - the maximum number of internal nodes to use to seed the Disk Ordered Scan.
Returns:
this

setMaxSeedNodesVoid

public void setMaxSeedNodesVoid(long maxSeedNodes)

getMaxSeedNodes

public long getMaxSeedNodes()
Returns the maximum number of internal nodes to use to seed the Disk Ordered Scan.

Returns:
the maximum number of internal nodes to use to seed the Disk Ordered Scan.

setMaxSeedTestHook

public DiskOrderedCursorConfig setMaxSeedTestHook(TestHook testHook)

getMaxSeedTestHook

public TestHook getMaxSeedTestHook()

clone

public DiskOrderedCursorConfig clone()
Returns a copy of this configuration object.

Overrides:
clone in class Object

toString

public String toString()
Returns the values for each configuration attribute.

Overrides:
toString in class Object
Returns:
the values for each configuration attribute.


Copyright (c) 2004-2012 Oracle. All rights reserved.