Search in sources :

Example 1 with DBUpdatesWrapper

use of org.apache.hadoop.hdds.utils.db.DBUpdatesWrapper in project ozone by apache.

the class OzoneManager method getDBUpdates.

/**
 * Get DB updates since a specific sequence number.
 *
 * @param dbUpdatesRequest request that encapsulates a sequence number.
 * @return Wrapper containing the updates.
 * @throws SequenceNumberNotFoundException if db is unable to read the data.
 */
@Override
public DBUpdates getDBUpdates(DBUpdatesRequest dbUpdatesRequest) throws SequenceNumberNotFoundException {
    long limitCount = Long.MAX_VALUE;
    if (dbUpdatesRequest.hasLimitCount()) {
        limitCount = dbUpdatesRequest.getLimitCount();
    }
    DBUpdatesWrapper updatesSince = metadataManager.getStore().getUpdatesSince(dbUpdatesRequest.getSequenceNumber(), limitCount);
    DBUpdates dbUpdates = new DBUpdates(updatesSince.getData());
    dbUpdates.setCurrentSequenceNumber(updatesSince.getCurrentSequenceNumber());
    dbUpdates.setLatestSequenceNumber(updatesSince.getLatestSequenceNumber());
    return dbUpdates;
}
Also used : DBUpdatesWrapper(org.apache.hadoop.hdds.utils.db.DBUpdatesWrapper) DBUpdates(org.apache.hadoop.ozone.om.helpers.DBUpdates)

Aggregations

DBUpdatesWrapper (org.apache.hadoop.hdds.utils.db.DBUpdatesWrapper)1 DBUpdates (org.apache.hadoop.ozone.om.helpers.DBUpdates)1