Skip navigation links

Oracle® Coherence Java API Reference
Release 3.6.0.0

E15725-01


com.tangosol.io
Class DecoratedBinaryDeltaCompressor

java.lang.Object
  extended by com.tangosol.util.Base
      extended by com.tangosol.util.BitHelper
          extended by com.tangosol.util.ExternalizableHelper
              extended by com.tangosol.io.DecoratedBinaryDeltaCompressor

All Implemented Interfaces:
DeltaCompressor

public class DecoratedBinaryDeltaCompressor
extends ExternalizableHelper
implements DeltaCompressor

A DeltaCompressor implementation that works with decorated binary values. <p/> The delta format is composed of a leading byte that indicates the format; the format indicator byte is one of the DECO_* field values. If the delta value does not begin with one of the leading DECO_* indicators, then the entire delta is the delta for the "value" portion of the decorated result. The grammar follows:

 DecoratedBinaryDelta:
   DECO_DELETE_ALL OptionalValueDelta
   DecorationDeltaList DECO_TERM OptionalValueDelta
   DECO_NO_CHANGES-opt ValueDelta
   null

 OptionalValueDelta:
   VALUE_NO_CHANGES
   VALUE_CHANGES-opt ValueDelta

 ValueDelta:
   Binary (as defined by the underlying DeltaCompressor)

 DecorationDeltaList:
   DecorationDelta
   DecorationDeltaList DecorationDelta

 DecorationDelta:
   DECO_INSERT DecorationId Binary
   DECO_UPDATE DecorationId BinaryDelta
   DECO_DELETE DecorationId

 BinaryDelta:
   Binary (as returned by the BinaryDeltaCompressor)

 Binary:
   Length <bytes>

 DecorationId:
 Length:
   <packed-integer>
 
Author:
cp 2009.01.20

Constructor Summary
DecoratedBinaryDeltaCompressor(DeltaCompressor compressorValue)
          Construct a DecoratedBinaryDeltaCompressor.

 

Method Summary
 ReadBuffer applyDelta(ReadBuffer bufOld, ReadBuffer bufDelta)
          Apply a delta to an old value in order to create a new value.
 ReadBuffer extractDelta(ReadBuffer bufOld, ReadBuffer bufNew)
          Compare an old value to a new value and generate a delta that represents the changes that must be made to the old value in order to transform it into the new value.

 

Methods inherited from class com.tangosol.util.BitHelper
countBits, countBits, countBits, indexOfLSB, indexOfLSB, indexOfLSB, indexOfMSB, indexOfMSB, indexOfMSB, rotateLeft, rotateLeft, rotateLeft, rotateRight, rotateRight, rotateRight, toBitString, toBitString, toBitString

 

Constructor Detail

DecoratedBinaryDeltaCompressor

public DecoratedBinaryDeltaCompressor(DeltaCompressor compressorValue)
Construct a DecoratedBinaryDeltaCompressor.
Parameters:
compressorValue - the compressor responsible for performing delta compression on the underlying Binary value (i.e. the DECO_VALUE decoration)

Method Detail

extractDelta

public ReadBuffer extractDelta(ReadBuffer bufOld,
                               ReadBuffer bufNew)
Compare an old value to a new value and generate a delta that represents the changes that must be made to the old value in order to transform it into the new value. The generated delta must be a ReadBuffer of non-zero length.
Specified by:
extractDelta in interface DeltaCompressor
Parameters:
bufOld - the old value
bufNew - the new value
Returns:
the changes that must be made to the old value in order to transform it into the new value, or null to indicate no change

applyDelta

public ReadBuffer applyDelta(ReadBuffer bufOld,
                             ReadBuffer bufDelta)
Apply a delta to an old value in order to create a new value.
Specified by:
applyDelta in interface DeltaCompressor
Parameters:
bufOld - the old value
bufDelta - the delta information returned from DeltaCompressor.extractDelta(com.tangosol.io.ReadBuffer, com.tangosol.io.ReadBuffer) to apply to the old value
Returns:
the new value

Skip navigation links

Oracle® Coherence Java API Reference
Release 3.6.0.0

E15725-01


Copyright © 2000, 2010, Oracle and/or its affiliates. All rights reserved.