use of io.pravega.segmentstore.server.UpdateableSegmentMetadata in project pravega by pravega.
the class SegmentAggregatorTests method generateSimpleSeal.
private StorageOperation generateSimpleSeal(long segmentId, TestContext context) {
UpdateableSegmentMetadata segmentMetadata = context.containerMetadata.getStreamSegmentMetadata(segmentId);
StreamSegmentSealOperation sealOp = new StreamSegmentSealOperation(segmentId);
sealOp.setStreamSegmentOffset(segmentMetadata.getLength());
sealOp.setSequenceNumber(context.containerMetadata.nextOperationSequenceNumber());
return sealOp;
}
use of io.pravega.segmentstore.server.UpdateableSegmentMetadata in project pravega by pravega.
the class SegmentAggregatorTests method generateSealAndUpdateMetadata.
private StorageOperation generateSealAndUpdateMetadata(long segmentId, TestContext context) {
UpdateableSegmentMetadata segmentMetadata = context.containerMetadata.getStreamSegmentMetadata(segmentId);
segmentMetadata.markSealed();
return generateSimpleSeal(segmentId, context);
}
use of io.pravega.segmentstore.server.UpdateableSegmentMetadata in project pravega by pravega.
the class SegmentAggregatorTests method generateSimpleAppend.
private StorageOperation generateSimpleAppend(long segmentId, TestContext context) {
byte[] data = "Append_Dummy".getBytes();
UpdateableSegmentMetadata segmentMetadata = context.containerMetadata.getStreamSegmentMetadata(segmentId);
long offset = segmentMetadata.getLength();
StreamSegmentAppendOperation op = new StreamSegmentAppendOperation(segmentId, data, null);
op.setStreamSegmentOffset(offset);
return op;
}
use of io.pravega.segmentstore.server.UpdateableSegmentMetadata in project pravega by pravega.
the class SegmentAggregatorTests method generateAppendAndUpdateMetadata.
private StorageOperation generateAppendAndUpdateMetadata(long segmentId, byte[] data, TestContext context) {
UpdateableSegmentMetadata segmentMetadata = context.containerMetadata.getStreamSegmentMetadata(segmentId);
long offset = segmentMetadata.getLength();
segmentMetadata.setLength(offset + data.length);
StreamSegmentAppendOperation op = new StreamSegmentAppendOperation(segmentId, data, null);
op.setStreamSegmentOffset(offset);
op.setSequenceNumber(context.containerMetadata.nextOperationSequenceNumber());
context.dataSource.recordAppend(op);
return new CachedStreamSegmentAppendOperation(op);
}
use of io.pravega.segmentstore.server.UpdateableSegmentMetadata in project pravega by pravega.
the class SegmentAggregatorTests method generateSimpleMergeTransaction.
private StorageOperation generateSimpleMergeTransaction(long transactionId, TestContext context) {
UpdateableSegmentMetadata transactionMetadata = context.containerMetadata.getStreamSegmentMetadata(transactionId);
UpdateableSegmentMetadata parentMetadata = context.containerMetadata.getStreamSegmentMetadata(transactionMetadata.getParentId());
MergeTransactionOperation op = new MergeTransactionOperation(parentMetadata.getId(), transactionMetadata.getId());
op.setLength(transactionMetadata.getLength());
op.setStreamSegmentOffset(parentMetadata.getLength());
return op;
}
Aggregations