com.sleepycat.db
Interface DbBtreePrefix
public interface DbBtreePrefix
An interface specifying a comparison function, which specifies the
number of bytes needed to differentiate Btree keys.
Method Summary |
int |
prefix(Db db,
Dbt dbt1,
Dbt dbt2)
The DbBtreePrefix interface is used by the Db.setBtreePrefix
method. |
prefix
int prefix(Db db,
Dbt dbt1,
Dbt dbt2)
- The DbBtreePrefix interface is used by the Db.setBtreePrefix
method.
- Parameters:
db
- the enclosing database handle.dbt1
- a Dbt
representing a
database key.dbt2
- a Dbt
representing a
database key.
- Returns:
- The bt_prefix_fcn function must return the
number of bytes of the second key parameter that would be
required by the Btree key comparison function to determine
the second key parameter's ordering relationship with
respect to the first key parameter. If the two keys are
equal, the key length should be returned. The prefix
function must correctly handle any key values used by the
application (possibly including zero-length keys). The
data and size fields of the
Dbt
are the only fields that may be
used for the purposes of this determination, and no
particular alignment of the memory to which the data
field refers may be assumed.