public class LogCursor
extends java.lang.Object
The handle is not free-threaded. Once the LogCursor.close
method is called, the handle may not be accessed again, regardless of
that method's success or failure.
Modifier and Type | Method | Description |
---|---|---|
void |
close() |
Discard the log cursor.
|
OperationStatus |
getCurrent(LogSequenceNumber lsn,
DatabaseEntry data) |
Return the LogSequenceNumber and log record to which the log cursor
currently refers.
|
OperationStatus |
getFirst(LogSequenceNumber lsn,
DatabaseEntry data) |
Return the first LogSequenceNumber and log record.
|
OperationStatus |
getLast(LogSequenceNumber lsn,
DatabaseEntry data) |
Return the last LogSequenceNumber and log record.
|
OperationStatus |
getNext(LogSequenceNumber lsn,
DatabaseEntry data) |
Return the next LogSequenceNumber and log record.
|
OperationStatus |
getPrev(LogSequenceNumber lsn,
DatabaseEntry data) |
Return the previous LogSequenceNumber and log record.
|
OperationStatus |
set(LogSequenceNumber lsn,
DatabaseEntry data) |
Return a specific log record.
|
int |
version() |
Get the log file version.
|
public void close() throws DatabaseException
DatabaseException
- if a failure occurs.public OperationStatus getCurrent(LogSequenceNumber lsn, DatabaseEntry data) throws DatabaseException
lsn
- The returned LogSequenceNumber.
data
- The returned log record. The data field is set to the record
retrieved, and the size field indicates the number of bytes in
the record.
DatabaseException
- if a failure occurs.public OperationStatus getNext(LogSequenceNumber lsn, DatabaseEntry data) throws DatabaseException
The current log position is advanced to the next record in the log, and its LogSequenceNumber and data are returned. If the cursor has not been initialized, the first available log record in the log will be returned.
lsn
- The returned LogSequenceNumber.
data
- The returned log record.
DatabaseException
- if a failure occurs.public OperationStatus getFirst(LogSequenceNumber lsn, DatabaseEntry data) throws DatabaseException
The current log position is set to the first record in the log, and its LogSequenceNumber and data are returned.
lsn
- The returned LogSequenceNumber.
data
- The returned log record.
DatabaseException
- if a failure occurs.public OperationStatus getLast(LogSequenceNumber lsn, DatabaseEntry data) throws DatabaseException
The current log position is set to the last record in the log, and its LogSequenceNumber and data are returned.
lsn
- The returned LogSequenceNumber.
data
- The returned log record.
DatabaseException
- if a failure occurs.public OperationStatus getPrev(LogSequenceNumber lsn, DatabaseEntry data) throws DatabaseException
The current log position is advanced to the previous record in the log, and its LogSequenceNumber and data are returned. If the cursor has not been initialized, the last available log record in the log will be returned.
lsn
- The returned LogSequenceNumber.
data
- The returned log record.
DatabaseException
- if a failure occurs.public OperationStatus set(LogSequenceNumber lsn, DatabaseEntry data) throws DatabaseException
The current log position is set to the specified record in the log, and its data is returned.
lsn
- The specified LogSequenceNumber.
data
- The returned log record.
DatabaseException
- if a failure occurs.public int version() throws DatabaseException
DatabaseException
- if a failure occurs.Copyright (c) 1996, 2020 Oracle and/or its affiliates. All rights reserved.