Version 2.4.1
com.wiredtiger.db.AsyncOp Class Reference

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 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 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
 
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
 
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)
 
int java_init (Object jasyncop)
 

Static Protected Member Functions

static long getCPtr (AsyncOp obj)
 

Protected Attributes

boolean swigCMemOwn
 
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

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
opthe operation handle
Returns
via the callback as described for WT_SESSION::compact
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
opthe operation handle
Returns
the id of the operation
byte com.wiredtiger.db.AsyncOp.getKeyByte ( ) throws WiredTigerPackingException

Retrieve a byte from the async_op's key.

Returns
The requested value.
void com.wiredtiger.db.AsyncOp.getKeyByteArray ( byte[]  output) throws WiredTigerPackingException

Retrieve a byte array from the async_op's key.

Parameters
outputThe 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.
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
outputThe byte array where the returned value will be stored.
offOffset into the destination buffer to start copying into.
lenThe length should be large enough to store the entire data item, if not a truncated value will be returned.
byte [] com.wiredtiger.db.AsyncOp.getKeyByteArray ( ) throws WiredTigerPackingException

Retrieve a byte array from the async_op's key.

Returns
The requested value.
String com.wiredtiger.db.AsyncOp.getKeyFormat ( )

Retrieve the format string for this async_op's key.

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

Retrieve an integer from the async_op's key.

Returns
The requested value.
long com.wiredtiger.db.AsyncOp.getKeyLong ( ) throws WiredTigerPackingException

Retrieve a long from the async_op's key.

Returns
The requested value.
short com.wiredtiger.db.AsyncOp.getKeyShort ( ) throws WiredTigerPackingException

Retrieve a short integer from the async_op's key.

Returns
The requested value.
String com.wiredtiger.db.AsyncOp.getKeyString ( ) throws WiredTigerPackingException

Retrieve a string from the async_op's key.

Returns
The requested value.
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
opthe operation handle
Returns
the WT_ASYNC_OPTYPE of the operation
byte com.wiredtiger.db.AsyncOp.getValueByte ( ) throws WiredTigerPackingException

Retrieve a byte from the async_op's value.

Returns
The requested value.
void com.wiredtiger.db.AsyncOp.getValueByteArray ( byte[]  output) throws WiredTigerPackingException

Retrieve a byte array from the async_op's value.

Parameters
outputThe 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.
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
outputThe byte array where the returned value will be stored.
offOffset into the destination buffer to start copying into.
lenThe length should be large enough to store the entire data item, if not a truncated value will be returned.
byte [] com.wiredtiger.db.AsyncOp.getValueByteArray ( ) throws WiredTigerPackingException

Retrieve a byte array from the async_op's value.

Returns
The requested value.
String com.wiredtiger.db.AsyncOp.getValueFormat ( )

Retrieve the format string for this async_op's value.

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

Retrieve an integer from the async_op's value.

Returns
The requested value.
long com.wiredtiger.db.AsyncOp.getValueLong ( ) throws WiredTigerPackingException

Retrieve a long from the async_op's value.

Returns
The requested value.
short com.wiredtiger.db.AsyncOp.getValueShort ( ) throws WiredTigerPackingException

Retrieve a short integer from the async_op's value.

Returns
The requested value.
String com.wiredtiger.db.AsyncOp.getValueString ( ) throws WiredTigerPackingException

Retrieve a string from the async_op's value.

Returns
The requested value.
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.
AsyncOp com.wiredtiger.db.AsyncOp.putKeyByte ( byte  value) throws WiredTigerPackingException

Append a byte to the async_op's key.

Parameters
valueThe value to append.
Returns
This async_op object, so put calls can be chained.
AsyncOp com.wiredtiger.db.AsyncOp.putKeyByteArray ( byte[]  value) throws WiredTigerPackingException

Append a byte array to the async_op's key.

Parameters
valueThe value to append.
Returns
This async_op object, so put calls can be chained.
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
valueThe value to append.
offThe offset into value at which to start.
lenThe length of the byte array.
Returns
This async_op object, so put calls can be chained.
AsyncOp com.wiredtiger.db.AsyncOp.putKeyInt ( int  value) throws WiredTigerPackingException

Append an integer to the async_op's key.

Parameters
valueThe value to append
Returns
This async_op object, so put calls can be chained.
AsyncOp com.wiredtiger.db.AsyncOp.putKeyLong ( long  value) throws WiredTigerPackingException

Append a long to the async_op's key.

Parameters
valueThe value to append
Returns
This async_op object, so put calls can be chained.
AsyncOp com.wiredtiger.db.AsyncOp.putKeyShort ( short  value) throws WiredTigerPackingException

Append a short integer to the async_op's key.

Parameters
valueThe value to append
Returns
This async_op object, so put calls can be chained.
AsyncOp com.wiredtiger.db.AsyncOp.putKeyString ( String  value) throws WiredTigerPackingException

Append a string to the async_op's key.

Parameters
valueThe value to append
Returns
This async_op object, so put calls can be chained.
AsyncOp com.wiredtiger.db.AsyncOp.putValueByte ( byte  value) throws WiredTigerPackingException

Append a byte to the async_op's value.

Parameters
valueThe value to append
Returns
This async_op object, so put calls can be chained.
AsyncOp com.wiredtiger.db.AsyncOp.putValueByteArray ( byte[]  value) throws WiredTigerPackingException

Append a byte array to the async_op's value.

Parameters
valueThe value to append
Returns
This async_op object, so put calls can be chained.
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
valueThe value to append
offThe offset into value at which to start.
lenThe length of the byte array.
Returns
This async_op object, so put calls can be chained.
AsyncOp com.wiredtiger.db.AsyncOp.putValueInt ( int  value) throws WiredTigerPackingException

Append an integer to the async_op's value.

Parameters
valueThe value to append
Returns
This async_op object, so put calls can be chained.
AsyncOp com.wiredtiger.db.AsyncOp.putValueLong ( long  value) throws WiredTigerPackingException

Append a long to the async_op's value.

Parameters
valueThe value to append
Returns
This async_op object, so put calls can be chained.
AsyncOp com.wiredtiger.db.AsyncOp.putValueShort ( short  value) throws WiredTigerPackingException

Append a short integer to the async_op's value.

Parameters
valueThe value to append
Returns
This async_op object, so put calls can be chained.
AsyncOp com.wiredtiger.db.AsyncOp.putValueString ( String  value) throws WiredTigerPackingException

Append a string to the async_op's value.

Parameters
valueThe value to append
Returns
This async_op object, so put calls can be chained.
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.
int com.wiredtiger.db.AsyncOp.search ( ) throws WiredTigerException

Search for an item in the table.

Returns
The result of the comparison.
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.