/** * Builds a {@link WaveletDeltaRecord} and applies it to the wavelet container. * The delta must be non-empty. */ protected WaveletDeltaRecord applyDelta( ByteStringMessage<ProtocolAppliedWaveletDelta> appliedDelta, WaveletDelta transformed) throws InvalidProtocolBufferException, OperationException { TransformedWaveletDelta transformedDelta = AppliedDeltaUtil.buildTransformedDelta(appliedDelta, transformed); WaveletDeltaRecord deltaRecord = new WaveletDeltaRecord(transformed.getTargetVersion(), appliedDelta, transformedDelta); waveletState.appendDelta(deltaRecord); return deltaRecord; }
/** * Creates a delta of no-ops and builds the corresponding applied and * transformed delta objects. */ private static WaveletDeltaRecord makeDelta(HashedVersion appliedAtVersion, long timestamp, int numOps) throws InvalidProtocolBufferException { // Use no-op delta so the ops can actually apply. WaveletDelta delta = UTIL.makeNoOpDelta(appliedAtVersion, timestamp, numOps); ByteStringMessage<ProtocolAppliedWaveletDelta> appliedDelta = WaveServerTestUtil.buildAppliedDelta(delta, timestamp); TransformedWaveletDelta transformedDelta = AppliedDeltaUtil.buildTransformedDelta(appliedDelta, delta); return new WaveletDeltaRecord(appliedAtVersion, appliedDelta, transformedDelta); } }
/** * Creates a delta of no-ops and builds the corresponding applied and * transformed delta objects. */ private static WaveletDeltaRecord makeDelta(HashedVersion appliedAtVersion, long timestamp, int numOps) throws InvalidProtocolBufferException { // Use no-op delta so the ops can actually apply. WaveletDelta delta = UTIL.makeNoOpDelta(appliedAtVersion, timestamp, numOps); ByteStringMessage<ProtocolAppliedWaveletDelta> appliedDelta = WaveServerTestUtil.buildAppliedDelta(delta, timestamp); TransformedWaveletDelta transformedDelta = AppliedDeltaUtil.buildTransformedDelta(appliedDelta, delta); return new WaveletDeltaRecord(appliedAtVersion, appliedDelta, transformedDelta); } }