use of io.pravega.segmentstore.contracts.AttributeUpdate in project pravega by pravega.
the class ContainerMetadataUpdateTransactionTests method verifyAttributeUpdates.
private void verifyAttributeUpdates(String stepName, ContainerMetadata containerMetadata, Collection<AttributeUpdate> attributeUpdates, Map<AttributeId, Long> expectedValues) {
// Verify that the Attribute Updates have their expected values and that the updater has internalized the attribute updates.
val transactionMetadata = containerMetadata.getStreamSegmentMetadata(SEGMENT_ID);
val expectedTransactionAttributes = new HashMap<>(expectedValues);
attributeUpdates.forEach(au -> expectedTransactionAttributes.put(au.getAttributeId(), au.getValue()));
SegmentMetadataComparer.assertSameAttributes("Unexpected attributes in transaction metadata " + stepName + ".", expectedTransactionAttributes, transactionMetadata);
for (AttributeUpdate au : attributeUpdates) {
Assert.assertEquals("Unexpected updated value for [" + au + "] " + stepName, (long) expectedValues.get(au.getAttributeId()), au.getValue());
}
}
Aggregations