ibi Patterns .NET API
Loading...
Searching...
No Matches
NetricsServerInterface.NetricsTableCursor Class Reference

This class is used to scan the records in a table. More...

Public Member Functions

  NetricsTableCursor (String table_name, int batch_size)
  Create an initialized cursor, setting all options.
 
  NetricsTableCursor (String table_name, String[] child_tables, int batch_size)
  Create an initialized cursor for compound records, setting all options.
 
int  getBatchSize ()
  Retrieve the batch size for this cursor.
 
void  setBatchSize (int batch_size)
  Set the batch size for this cursor.
 
String  getTableName ()
  Retrieve the table name.
 
void  setChildTables (String[] child_tables)
  Set the list of child tables.
 
String[]  getChildTables ()
  Get the list of child tables for compound records.
 
bool  atEOT ()
  Determine if a cursor is at the end of table position.
 
void  setPosition (String pos)
  Reset the position of a cursor.
 
String  getPosition ()
  Obtains the current cursor position.
 
void  setSkipCount (int count)
  Sets the number of records to skip before the next batch is retrieved.
 
int  getSkipCount ()
  Gets the number of records to skip before the next batch is retrieved.
 

Detailed Description

This class is used to scan the records in a table.

A cursor allows you to scan through all records in a table, in batches of a specified size.

If the table is updated in any way after a scan with a cursor is started the results become unpredictable. The scan might skip records, or return the same record multiple times.

As long as no records are added or deleted, the ordering of records is stable: two cursors on the same table will return the records in the same order, and cursors remain valid across a checkpoint/restore.

Constructor & Destructor Documentation

◆ NetricsTableCursor() [1/2]

NetricsServerInterface.NetricsTableCursor.NetricsTableCursor ( String  table_name,
int  batch_size 
)
inline

Create an initialized cursor, setting all options.

This creates a cursor for scanning the records of a table.

Parameters
table_name Name of the table this cursor is on.
batch_size Number of records to be returned at a time. If less than 1, the default batch size of 1 is used.

◆ NetricsTableCursor() [2/2]

NetricsServerInterface.NetricsTableCursor.NetricsTableCursor ( String  table_name,
String[]  child_tables,
int  batch_size 
)
inline

Create an initialized cursor for compound records, setting all options.

This creates a cursor for scanning the records of a table. It sets the set of child tables to be retrieved in a compound record scan.

Parameters
table_name name of the table this cursor is on.
child_tables names of all child tables to be included in a returned compound record. All tables listed must be children of table_name but validation is not performed until a scan is started. This may be null, in which case all child tables of table_name will be used in a compound record scan.
batch_size number of records to be returned at a time. If <= 0 the default batch size of 1 is used.

Member Function Documentation

◆ getChildTables()

String[] NetricsServerInterface.NetricsTableCursor.getChildTables ( )
inline

Get the list of child tables for compound records.

Returns
the list of child tables for compound records, null if none set.

◆ getPosition()

String NetricsServerInterface.NetricsTableCursor.getPosition ( )
inline

Obtains the current cursor position.

This position may be used to later set the cursor position using setPosition.

Returns
The cursor position as an encoded, opaque string value.

◆ getSkipCount()

int NetricsServerInterface.NetricsTableCursor.getSkipCount ( )
inline

Gets the number of records to skip before the next batch is retrieved.

Skip count is reset to zero when a batch is retrieved.

Returns
Number of records to skip.

◆ setBatchSize()

void NetricsServerInterface.NetricsTableCursor.setBatchSize ( int  batch_size )
inline

Set the batch size for this cursor.

Parameters
batch_size Set the number of records to be returned at a time. If less than 1 the default batch size of 1 is used.

◆ setChildTables()

void NetricsServerInterface.NetricsTableCursor.setChildTables ( String[]  child_tables )
inline

Set the list of child tables.

Parameters
child_tables names of all child tables to be included in a returned compound record. All tables listed must be children of the main table for this cursor but validation is not performed until a scan is started. This may be null, in which case all child tables of table_name are used in a compound record scan.

◆ setPosition()

void NetricsServerInterface.NetricsTableCursor.setPosition ( String  pos )
inline

Reset the position of a cursor.

This resets the position of a cursor so that it will start reading records at a given position. Note that any table update operation, including a checkpoint/restore operation, can invalidate a saved position value, the results become unpredictable. This does not affect the skip count.

Parameters
pos a position value returned by a previous call to getPosition. If null, the cursor is set to the start of the table.

◆ setSkipCount()

void NetricsServerInterface.NetricsTableCursor.setSkipCount ( int  count )
inline

Sets the number of records to skip before the next batch is retrieved.

Skip count is reset to zero when a batch is retrieved.

Parameters
count Number of records to skip. Values less than zero are treated as zero.