WiredTiger: com.wiredtiger.db.AsyncOp Class Reference

| Version 3.1.0

Fork me on GitHub Join my user group
List of all members | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes
com.wiredtiger.db.AsyncOp Class Reference
WiredTiger Java API

A WT_ASYNC_OP handle is the interface to an asynchronous operation. More...

## Public Member Functions
synchronized void | delete ()
String | getKeyFormat ()
String | getValueFormat ()
AsyncOp | putKeyByte (byte value) throws WiredTigerPackingException
AsyncOp | putKeyByteArray (byte[] value) throws WiredTigerPackingException
AsyncOp | putKeyByteArray (byte[] value, int off, int len) throws WiredTigerPackingException
AsyncOp | putKeyInt (int value) throws WiredTigerPackingException
AsyncOp | putKeyLong (long value) throws WiredTigerPackingException
AsyncOp | putKeyRecord (long value) throws WiredTigerPackingException
AsyncOp | putKeyShort (short value) throws WiredTigerPackingException
AsyncOp | putKeyString (String value) throws WiredTigerPackingException
AsyncOp | putValueByte (byte value) throws WiredTigerPackingException
AsyncOp | putValueByteArray (byte[] value) throws WiredTigerPackingException
AsyncOp | putValueByteArray (byte[] value, int off, int len) throws WiredTigerPackingException
AsyncOp | putValueInt (int value) throws WiredTigerPackingException
AsyncOp | putValueLong (long value) throws WiredTigerPackingException
AsyncOp | putValueRecord (long value) throws WiredTigerPackingException
AsyncOp | putValueShort (short value) throws WiredTigerPackingException
AsyncOp | putValueString (String value) throws WiredTigerPackingException
byte | getKeyByte () throws WiredTigerPackingException
void | getKeyByteArray (byte[] output) throws WiredTigerPackingException
void | getKeyByteArray (byte[] output, int off, int len) throws WiredTigerPackingException
byte [] | getKeyByteArray () throws WiredTigerPackingException
int | getKeyInt () throws WiredTigerPackingException
long | getKeyLong () throws WiredTigerPackingException
long | getKeyRecord () throws WiredTigerPackingException
short | getKeyShort () throws WiredTigerPackingException
String | getKeyString () throws WiredTigerPackingException
byte | getValueByte () throws WiredTigerPackingException
void | getValueByteArray (byte[] output) throws WiredTigerPackingException
void | getValueByteArray (byte[] output, int off, int len) throws WiredTigerPackingException
byte [] | getValueByteArray () throws WiredTigerPackingException
int | getValueInt () throws WiredTigerPackingException
long | getValueLong () throws WiredTigerPackingException
long | getValueRecord () throws WiredTigerPackingException
short | getValueShort () throws WiredTigerPackingException
String | getValueString () throws WiredTigerPackingException
int | insert () throws WiredTigerException
int | update () throws WiredTigerException
int | remove () throws WiredTigerException
int | search () throws WiredTigerException
Connection | getConnection ()
int | compact () throws com.wiredtiger.db.WiredTigerException
| Invoke the underlying WT_SESSION::compact method; see that method for configuration, return and error values. More...
AsyncOpType | getType ()
| Get the type for this operation. More...
int | getId () throws com.wiredtiger.db.WiredTigerException
| Get the unique identifier for this operation. More...

## Protected Member Functions
| AsyncOp (long cPtr, boolean cMemoryOwn)
String | getKey_format ()
String | getValue_format ()
byte [] | get_key_wrap ()
byte [] | get_value_wrap ()
int | insert_wrap (byte[] k, byte[] v)
int | remove_wrap (byte[] k)
int | search_wrap (byte[] k)
int | update_wrap (byte[] k, byte[] v)
boolean | _java_raw ()
int | _java_init (Object jasyncop)

## Static Protected Member Functions
static long | getCPtr (AsyncOp obj)

## Protected Attributes
boolean | swigCMemOwn
boolean | javaRaw
String | keyFormat
String | valueFormat
PackOutputStream | keyPacker
PackOutputStream | valuePacker
PackInputStream | keyUnpacker
PackInputStream | valueUnpacker

## Detailed Description

A WT_ASYNC_OP handle is the interface to an asynchronous operation.

An asynchronous operation describes a data manipulation to be performed asynchronously by a WiredTiger worker thread. These operations implement the CRUD (create, read, update and delete) operations. Each operation is a self-contained work unit. The operation will be performed in the context of the worker thread's session. Each operation is performed within the context of a transaction. The application is notified of its completion with a callback. The transaction is resolved once the callback returns.

The table referenced in an operation must already exist.

Raw data is represented by key/value pairs of WT_ITEM structures, but operations can also provide access to fields within the key and value if the formats are described in the WT_SESSION::create method.

Thread safety: A WT_ASYNC_OP handle may not be shared between threads, see Multithreading for more information.

## Member Function Documentation

## ◆ compact()

int com.wiredtiger.db.AsyncOp.compact | ( |  | ) | throws com.wiredtiger.db.WiredTigerException

Invoke the underlying WT_SESSION::compact method; see that method for configuration, return and error values.

Parameters

  op | the operation handle

Returns
  via the callback as described for WT_SESSION::compact

## ◆ getId()

int com.wiredtiger.db.AsyncOp.getId | ( |  | ) | throws com.wiredtiger.db.WiredTigerException

Get the unique identifier for this operation.

/* Retrieve the operation's 64-bit identifier. */
id = op->get_id(op);

Parameters

  op | the operation handle

Returns
  the id of the operation

## ◆ getKeyByte()

byte com.wiredtiger.db.AsyncOp.getKeyByte | ( |  | ) | throws WiredTigerPackingException

Retrieve a byte from the async_op's key.

Returns
  The requested value.

## ◆ getKeyByteArray() [1/3]

void com.wiredtiger.db.AsyncOp.getKeyByteArray | ( | byte [] | output | ) | throws WiredTigerPackingException

Retrieve a byte array from the async_op's key.

Parameters

  output | The byte array where the returned value will be stored. The array should be large enough to store the entire data item, if not a truncated value will be returned.

## ◆ getKeyByteArray() [2/3]

void com.wiredtiger.db.AsyncOp.getKeyByteArray | ( | byte [] | output,
|  | int | off,
|  | int | len
| ) |  | throws WiredTigerPackingException

Retrieve a byte array from the async_op's key.

Parameters

  output | The byte array where the returned value will be stored.
  off | Offset into the destination buffer to start copying into.
  len | The length should be large enough to store the entire data item, if not a truncated value will be returned.

## ◆ getKeyByteArray() [3/3]

byte [] com.wiredtiger.db.AsyncOp.getKeyByteArray | ( |  | ) | throws WiredTigerPackingException

Retrieve a byte array from the async_op's key.

Returns
  The requested value.

## ◆ getKeyFormat()

String com.wiredtiger.db.AsyncOp.getKeyFormat | ( |  | ) |

Retrieve the format string for this async_op's key.

## ◆ getKeyInt()

int com.wiredtiger.db.AsyncOp.getKeyInt | ( |  | ) | throws WiredTigerPackingException

Retrieve an integer from the async_op's key.

Returns
  The requested value.

## ◆ getKeyLong()

long com.wiredtiger.db.AsyncOp.getKeyLong | ( |  | ) | throws WiredTigerPackingException

Retrieve a long from the async_op's key.

Returns
  The requested value.

## ◆ getKeyRecord()

long com.wiredtiger.db.AsyncOp.getKeyRecord | ( |  | ) | throws WiredTigerPackingException

Retrieve a record number from the async_op's key.

Returns
  The requested value.

## ◆ getKeyShort()

short com.wiredtiger.db.AsyncOp.getKeyShort | ( |  | ) | throws WiredTigerPackingException

Retrieve a short integer from the async_op's key.

Returns
  The requested value.

## ◆ getKeyString()

String com.wiredtiger.db.AsyncOp.getKeyString | ( |  | ) | throws WiredTigerPackingException

Retrieve a string from the async_op's key.

Returns
  The requested value.

## ◆ getType()

AsyncOpType com.wiredtiger.db.AsyncOp.getType | ( |  | ) |

Get the type for this operation.

/* Retrieve the operation's WT_ASYNC_OPTYPE type. */
type = op->get_type(op);

Parameters

  op | the operation handle

Returns
  the WT_ASYNC_OPTYPE of the operation

## ◆ getValueByte()

byte com.wiredtiger.db.AsyncOp.getValueByte | ( |  | ) | throws WiredTigerPackingException

Retrieve a byte from the async_op's value.

Returns
  The requested value.

## ◆ getValueByteArray() [1/3]

void com.wiredtiger.db.AsyncOp.getValueByteArray | ( | byte [] | output | ) | throws WiredTigerPackingException

Retrieve a byte array from the async_op's value.

Parameters

  output | The byte array where the returned value will be stored. The array should be large enough to store the entire data item, if not a truncated value will be returned.

## ◆ getValueByteArray() [2/3]

void com.wiredtiger.db.AsyncOp.getValueByteArray | ( | byte [] | output,
|  | int | off,
|  | int | len
| ) |  | throws WiredTigerPackingException

Retrieve a byte array from the async_op's value.

Parameters

  output | The byte array where the returned value will be stored.
  off | Offset into the destination buffer to start copying into.
  len | The length should be large enough to store the entire data item, if not a truncated value will be returned.

## ◆ getValueByteArray() [3/3]

byte [] com.wiredtiger.db.AsyncOp.getValueByteArray | ( |  | ) | throws WiredTigerPackingException

Retrieve a byte array from the async_op's value.

Returns
  The requested value.

## ◆ getValueFormat()

String com.wiredtiger.db.AsyncOp.getValueFormat | ( |  | ) |

Retrieve the format string for this async_op's value.

## ◆ getValueInt()

int com.wiredtiger.db.AsyncOp.getValueInt | ( |  | ) | throws WiredTigerPackingException

Retrieve an integer from the async_op's value.

Returns
  The requested value.

## ◆ getValueLong()

long com.wiredtiger.db.AsyncOp.getValueLong | ( |  | ) | throws WiredTigerPackingException

Retrieve a long from the async_op's value.

Returns
  The requested value.

## ◆ getValueRecord()

long com.wiredtiger.db.AsyncOp.getValueRecord | ( |  | ) | throws WiredTigerPackingException

Retrieve a record number from the async_op's value.

Returns
  The requested value.

## ◆ getValueShort()

short com.wiredtiger.db.AsyncOp.getValueShort | ( |  | ) | throws WiredTigerPackingException

Retrieve a short integer from the async_op's value.

Returns
  The requested value.

## ◆ getValueString()

String com.wiredtiger.db.AsyncOp.getValueString | ( |  | ) | throws WiredTigerPackingException

Retrieve a string from the async_op's value.

Returns
  The requested value.

## ◆ insert()

int com.wiredtiger.db.AsyncOp.insert | ( |  | ) | throws WiredTigerException

Insert the async_op's current key/value into the table.

Returns
  The status of the operation.

## ◆ putKeyByte()

AsyncOp com.wiredtiger.db.AsyncOp.putKeyByte | ( | byte | value | ) | throws WiredTigerPackingException

Append a byte to the async_op's key.

Parameters

  value | The value to append.

Returns
  This async_op object, so put calls can be chained.

## ◆ putKeyByteArray() [1/2]

AsyncOp com.wiredtiger.db.AsyncOp.putKeyByteArray | ( | byte [] | value | ) | throws WiredTigerPackingException

Append a byte array to the async_op's key.

Parameters

  value | The value to append.

Returns
  This async_op object, so put calls can be chained.

## ◆ putKeyByteArray() [2/2]

AsyncOp com.wiredtiger.db.AsyncOp.putKeyByteArray | ( | byte [] | value,
|  | int | off,
|  | int | len
| ) |  | throws WiredTigerPackingException

Append a byte array to the async_op's key.

Parameters

  value | The value to append.
  off | The offset into value at which to start.
  len | The length of the byte array.

Returns
  This async_op object, so put calls can be chained.

## ◆ putKeyInt()

AsyncOp com.wiredtiger.db.AsyncOp.putKeyInt | ( | int | value | ) | throws WiredTigerPackingException

Append an integer to the async_op's key.

Parameters

  value | The value to append

Returns
  This async_op object, so put calls can be chained.

## ◆ putKeyLong()

AsyncOp com.wiredtiger.db.AsyncOp.putKeyLong | ( | long | value | ) | throws WiredTigerPackingException

Append a long to the async_op's key.

Parameters

  value | The value to append

Returns
  This async_op object, so put calls can be chained.

## ◆ putKeyRecord()

AsyncOp com.wiredtiger.db.AsyncOp.putKeyRecord | ( | long | value | ) | throws WiredTigerPackingException

Append a record number to the async_op's key.

Parameters

  value | The value to append

Returns
  This async_op object, so put calls can be chained.

## ◆ putKeyShort()

AsyncOp com.wiredtiger.db.AsyncOp.putKeyShort | ( | short | value | ) | throws WiredTigerPackingException

Append a short integer to the async_op's key.

Parameters

  value | The value to append

Returns
  This async_op object, so put calls can be chained.

## ◆ putKeyString()

AsyncOp com.wiredtiger.db.AsyncOp.putKeyString | ( | String | value | ) | throws WiredTigerPackingException

Append a string to the async_op's key.

Parameters

  value | The value to append

Returns
  This async_op object, so put calls can be chained.

## ◆ putValueByte()

AsyncOp com.wiredtiger.db.AsyncOp.putValueByte | ( | byte | value | ) | throws WiredTigerPackingException

Append a byte to the async_op's value.

Parameters

  value | The value to append

Returns
  This async_op object, so put calls can be chained.

## ◆ putValueByteArray() [1/2]

AsyncOp com.wiredtiger.db.AsyncOp.putValueByteArray | ( | byte [] | value | ) | throws WiredTigerPackingException

Append a byte array to the async_op's value.

Parameters

  value | The value to append

Returns
  This async_op object, so put calls can be chained.

## ◆ putValueByteArray() [2/2]

AsyncOp com.wiredtiger.db.AsyncOp.putValueByteArray | ( | byte [] | value,
|  | int | off,
|  | int | len
| ) |  | throws WiredTigerPackingException

Append a byte array to the async_op's value.

Parameters

  value | The value to append
  off | The offset into value at which to start.
  len | The length of the byte array.

Returns
  This async_op object, so put calls can be chained.

## ◆ putValueInt()

AsyncOp com.wiredtiger.db.AsyncOp.putValueInt | ( | int | value | ) | throws WiredTigerPackingException

Append an integer to the async_op's value.

Parameters

  value | The value to append

Returns
  This async_op object, so put calls can be chained.

## ◆ putValueLong()

AsyncOp com.wiredtiger.db.AsyncOp.putValueLong | ( | long | value | ) | throws WiredTigerPackingException

Append a long to the async_op's value.

Parameters

  value | The value to append

Returns
  This async_op object, so put calls can be chained.

## ◆ putValueRecord()

AsyncOp com.wiredtiger.db.AsyncOp.putValueRecord | ( | long | value | ) | throws WiredTigerPackingException

Append a record number to the async_op's value.

Parameters

  value | The value to append

Returns
  This async_op object, so put calls can be chained.

## ◆ putValueShort()

AsyncOp com.wiredtiger.db.AsyncOp.putValueShort | ( | short | value | ) | throws WiredTigerPackingException

Append a short integer to the async_op's value.

Parameters

  value | The value to append

Returns
  This async_op object, so put calls can be chained.

## ◆ putValueString()

AsyncOp com.wiredtiger.db.AsyncOp.putValueString | ( | String | value | ) | throws WiredTigerPackingException

Append a string to the async_op's value.

Parameters

  value | The value to append

Returns
  This async_op object, so put calls can be chained.

## ◆ remove()

int com.wiredtiger.db.AsyncOp.remove | ( |  | ) | throws WiredTigerException

Remove the async_op's current key/value into the table.

Returns
  The status of the operation.

## ◆ search()

int com.wiredtiger.db.AsyncOp.search | ( |  | ) | throws WiredTigerException

Search for an item in the table.

Returns
  The result of the comparison.

## ◆ update()

int com.wiredtiger.db.AsyncOp.update | ( |  | ) | throws WiredTigerException

Update the async_op's current key/value into the table.

Returns
  The status of the operation.