#include <stdint.h>Data Structures | |
| struct | Key |
| struct | Record |
Defines | |
| #define | MAX_PAYLOAD_LEN 100 |
| #define | MAX_VARCHAR_LEN 128 |
Typedefs | |
| typedef IdxState | IdxState |
| typedef TxnState | TxnState |
| typedef enum ErrCode | ErrCode |
| typedef enum KeyType | KeyType |
Enumerations | |
| enum | ErrCode |
| enum | KeyType |
Functions | |
| ErrCode | create (KeyType type, char *name) |
| ErrCode | openIndex (const char *name, IdxState **idxState) |
| ErrCode | closeIndex (IdxState *idxState) |
| ErrCode | beginTransaction (TxnState **txn) |
| ErrCode | abortTransaction (TxnState *txn) |
| ErrCode | commitTransaction (TxnState *txn) |
| ErrCode | get (IdxState *idxState, TxnState *txn, Record *record) |
| ErrCode | getNext (IdxState *idxState, TxnState *txn, Record *record) |
| ErrCode | insertRecord (IdxState *idxState, TxnState *txn, Key *k, const char *payload) |
| ErrCode | deleteRecord (IdxState *idxState, TxnState *txn, Record *record) |
|
|
Specifies the maximum size for a payload. |
|
|
Specifies the maximum size for a varchar key. |
|
|
Status messages for outcomes of API calls. |
|
|
Implementation-specific data stored in this variable, used to identify a thread's state |
|
|
Three possible key types. |
|
|
Implementation-specific data stored in this variable, used to identify a transaction across Indices and store any information necessary for the implementation. |
|
|
Status messages for outcomes of API calls. |
|
|
Three possible key types. |
|
|
Forces the current transaction to abort, rolling back all changes made during the course of the transaction.
|
|
|
Signals the beginning of a transaction. Each thread can have only one outstanding transaction running at a time.
|
|
|
Terminate use of current index by this thread.
|
|
|
Signals the end of the current transaction, committing all changes created in the transaction.
|
|
||||||||||||
|
Creates a new index data structure to be used by any thread.
|
|
||||||||||||||||
|
Remove the record associated with the given key from the index structure. If a payload is specified in the Record, then the key/payload pair specified is removed. Otherwise, the payload pointer is a length 0 string and all records with the given key are removed from the database. If this is called from outside of a transaction, it should commit immediately.
|
|
||||||||||||||||
|
Retrieve the first record associated with the given key value; if more than one record exists with this key, return the first record with this key. Contents of the retrieved record are copied into the user supplied Record structure. Records with the same key may be returned in any order, but it must be that if there are n records with the same key k, a call to get followed by n-1 calls to getNext will return all n records with key k. If get returns KEY_NOTFOUND for a key k, the caller may invoke getNext to find the first key after key k.
|
|
||||||||||||||||
|
Retrieve the record following the previous record retrieved by get or getNext. If no such call has occurred since the current transaction began, or if this is called from outside of a transaction, this returns the first record in the index. Records are ordered in ascending order by key. Records with the same key but different payloads may be returned in any order. If get returned KEY_NOT_FOUND for a key k, invoking getNext will return the first key after k. If the index is closed and reopened, or a new transaction has begun since any previous call of get or getNext, getNext returns the first record in the index.
|
|
||||||||||||||||||||
|
Insert a payload associated with the given key. An identical key can be used multiple times, but only with unique payloads. If this is called from outside of a transaction, it should commit immediately. Records in an index are ordered in ascending order by key. Records with the same key may be stored in any order. The implementation is responsible for making a copy of payload (e.g., it may not assume that the payload pointer continues to be valid after this routine returns.)
|
|
||||||||||||
|
Opens a specific index data structure to be used by this thread.
|
1.3.4