Search in sources :

Example 1 with ContainerException

use of io.pravega.segmentstore.contracts.ContainerException in project pravega by pravega.

the class RecoveryProcessor method recoverOperation.

protected void recoverOperation(DataFrameRecord<Operation> dataFrameRecord, OperationMetadataUpdater metadataUpdater) throws DataCorruptionException {
    // Update Metadata Sequence Number.
    Operation operation = dataFrameRecord.getItem();
    metadataUpdater.setOperationSequenceNumber(operation.getSequenceNumber());
    // Update the metadata with the information from the Operation.
    try {
        log.debug("{} Recovering {}.", this.traceObjectId, operation);
        metadataUpdater.preProcessOperation(operation);
        metadataUpdater.acceptOperation(operation);
    } catch (StreamSegmentException | ContainerException ex) {
        // Metadata update failures should not happen during recovery.
        throw new DataCorruptionException(String.format("Unable to update metadata for Log Operation '%s'.", operation), ex);
    }
    // Update in-memory structures.
    this.stateUpdater.process(operation);
}
Also used : ContainerException(io.pravega.segmentstore.contracts.ContainerException) StreamSegmentException(io.pravega.segmentstore.contracts.StreamSegmentException) MetadataCheckpointOperation(io.pravega.segmentstore.server.logs.operations.MetadataCheckpointOperation) Operation(io.pravega.segmentstore.server.logs.operations.Operation) DataCorruptionException(io.pravega.segmentstore.server.DataCorruptionException)

Aggregations

ContainerException (io.pravega.segmentstore.contracts.ContainerException)1 StreamSegmentException (io.pravega.segmentstore.contracts.StreamSegmentException)1 DataCorruptionException (io.pravega.segmentstore.server.DataCorruptionException)1 MetadataCheckpointOperation (io.pravega.segmentstore.server.logs.operations.MetadataCheckpointOperation)1 Operation (io.pravega.segmentstore.server.logs.operations.Operation)1