Berkeley DB Java Edition
version 5.0.34

com.sleepycat.je
Class JoinConfig

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

public class JoinConfig
extends Object
implements Cloneable

The configuration properties of a JoinCursor. The join cursor configuration is specified when calling Database.join.

To create a configuration object with default attributes:

     JoinConfig config = new JoinConfig();
 

To set custom attributes:

     JoinConfig config = new JoinConfig();
     config.setNoSort(true);
 

See Also:
Database.join, JoinCursor

Field Summary
static JoinConfig DEFAULT
          Default configuration used if null is passed to Database.join.
 
Constructor Summary
JoinConfig()
          Creates an instance with the system's default settings.
 
Method Summary
 JoinConfig clone()
          Returns a copy of this configuration object.
 boolean getNoSort()
          Returns whether automatic sorting of the input cursors is disabled.
 JoinConfig setNoSort(boolean noSort)
          Specifies whether automatic sorting of the input cursors is disabled.
 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 JoinConfig DEFAULT
Default configuration used if null is passed to Database.join.

Constructor Detail

JoinConfig

public JoinConfig()
Creates an instance with the system's default settings.

Method Detail

setNoSort

public JoinConfig setNoSort(boolean noSort)
Specifies whether automatic sorting of the input cursors is disabled.

Joined values are retrieved by doing a sequential iteration over the first cursor in the cursor array, and a nested iteration over each following cursor in the order they are specified in the array. This requires database traversals to search for the current datum in all the cursors after the first. For this reason, the best join performance normally results from sorting the cursors from the one that refers to the least number of data items to the one that refers to the most. Unless this method is called with true, Database.join does this sort on behalf of its caller using the Cursor.countEstimate() method.

If the data are structured so that cursors with many data items also share many common elements, higher performance will result from listing those cursors before cursors with fewer data items; that is, a sort order other than the default. Calling this method permits applications to perform join optimization prior to calling Database.join.

Parameters:
noSort - whether automatic sorting of the input cursors is disabled.
Returns:
this
See Also:
Database.join

getNoSort

public boolean getNoSort()
Returns whether automatic sorting of the input cursors is disabled.

Returns:
whether automatic sorting of the input cursors is disabled.
See Also:
setNoSort(boolean)

clone

public JoinConfig 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.

Berkeley DB Java Edition
version 5.0.34

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