private void verifyAttributeUpdates(String stepName, ContainerMetadata containerMetadata, Collection<AttributeUpdate> attributeUpdates, Map<UUID, 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<UUID, Long>(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 AttributeUpdate[" + au.getUpdateType() + "] " + stepName, (long) expectedValues.get(au.getAttributeId()), au.getValue()); } }
AttributeUpdateType updateType = u.getUpdateType(); boolean hasValue = false; long previousValue = Attributes.NULL_ATTRIBUTE_VALUE;
private void writeAttributeUpdate00(RevisionDataOutput target, AttributeUpdate au) throws IOException { target.writeUUID(au.getAttributeId()); target.writeByte(au.getUpdateType().getTypeId()); target.writeLong(au.getValue()); target.writeLong(au.getComparisonValue()); }
private void writeAttributeUpdate00(RevisionDataOutput target, AttributeUpdate au) throws IOException { target.writeUUID(au.getAttributeId()); target.writeByte(au.getUpdateType().getTypeId()); target.writeLong(au.getValue()); target.writeLong(au.getComparisonValue()); }
switch (update.getUpdateType()) { case ReplaceIfGreater: if (hasValue && newValue <= previousValue) {