public class NetricsTableCursor
extends java.lang.Object
implements java.io.Serializable
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 and Description |
|---|
NetricsTableCursor(java.lang.String table_name,
int batch_size)
Create an initialized cursor, setting all options.
|
NetricsTableCursor(java.lang.String table_name,
java.lang.String[] child_tables,
int batch_size)
Create an initialized cursor for compound records, setting all options.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
atEOT()
Determine if a cursor is at the end-of-table position.
|
int |
getBatchSize()
Retrieve the batch size for this cursor.
|
java.lang.String[] |
getChildTables()
Get the list of child tables for compound records.
|
java.lang.String |
getPosition()
Obtains the current cursor position.
|
int |
getSkipCount()
Gets the number of records to skip before the next batch is retrieved.
|
java.lang.String |
getTableName()
Retrieve the table name for this cursor.
|
void |
setBatchSize(int batch_size)
Set the batch size for this cursor.
|
void |
setChildTables(java.util.List<java.lang.String> child_tables)
Set the list of child tables.
|
void |
setChildTables(java.lang.String[] child_tables)
Set the list of child tables.
|
void |
setPosition(java.lang.String pos)
Reset the position of a cursor.
|
void |
setSkipCount(int count)
Sets the number of records to skip before the next batch is retrieved.
|
public NetricsTableCursor(java.lang.String table_name,
int batch_size)
table_name - name of the table this cursor is on.batch_size - number of records to be returned at a time.
If <= 0 the default batch size of 1 is used.public NetricsTableCursor(java.lang.String table_name,
java.lang.String[] child_tables,
int batch_size)
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.public int getBatchSize()
public void setBatchSize(int batch_size)
batch_size - Set the number of records to be returned at a time.
If <= 0 the default batch size of 1 is used.public java.lang.String getTableName()
public void setChildTables(java.lang.String[] child_tables)
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.public void setChildTables(java.util.List<java.lang.String> child_tables)
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.public java.lang.String[] getChildTables()
public boolean atEOT()
public void setPosition(java.lang.String pos)
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.
pos - a position value returned by a previous call to getPosition.
If null, the cursor is set to the start of the table.public java.lang.String getPosition()
public void setSkipCount(int count)
count - Number of records to skip. Values less than zero
are treated as zero.public int getSkipCount()