public class DeltaTestImpl extends java.lang.Object implements DataSerializable, Delta
DataSerializable.Replaceable
Modifier and Type | Field and Description |
---|---|
static int |
ERRONEOUS_INT_FOR_TO_DELTA |
static java.lang.String |
ERRONEOUS_STRING_FOR_FROM_DELTA
Below fields are not part of standard Delta implementation but are used for testing purpose.
|
static boolean |
NEED_TO_RESET_T0_DELTA |
Constructor and Description |
---|
DeltaTestImpl() |
DeltaTestImpl(int intVal,
java.lang.String str) |
DeltaTestImpl(int intVal,
java.lang.String string,
java.lang.Double doubleVal,
byte[] bytes,
org.apache.geode.internal.cache.TestObjectWithIdentifier testObj) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkInvalidInt(int intVal) |
protected void |
checkInvalidInt2(int intVal) |
protected void |
checkInvalidString(java.lang.String str) |
static java.lang.Boolean |
deltaFeatureUsed() |
boolean |
equals(java.lang.Object other) |
void |
fromData(java.io.DataInput in)
Reads the state of this object as primitive data from the given
DataInput . |
void |
fromDelta(java.io.DataInput in)
This method is invoked on an existing application object when an update is received as a delta.
|
static java.lang.Boolean |
fromDeltaFeatureUsed() |
byte[] |
getByteArr() |
java.lang.Double |
getDoubleVar() |
static java.lang.Long |
getFromDeltaFailures() |
static java.lang.Long |
getFromDeltaInvokations() |
static java.util.List<java.lang.Exception> |
getInstantiations() |
int |
getIntVar() |
java.lang.String |
getStr() |
org.apache.geode.internal.cache.TestObjectWithIdentifier |
getTestObj() |
static long |
getTimesConstructed() |
static java.lang.Long |
getToDeltaFailures() |
static java.lang.Long |
getToDeltaInvokations() |
boolean |
hasDelta()
Returns true if this object has pending changes it can write out.
|
static java.lang.Boolean |
isFromDeltaFailure() |
static java.lang.Boolean |
isToDeltaFailure() |
static void |
resetDeltaInvokationCounters()
Below methods are not part of standard Delta implementation but are used for testing purpose.
|
void |
resetDeltaStatus() |
static void |
resetFailureCounter() |
static void |
resetFromDeltaCounter() |
static void |
resetToDeltaCounter() |
void |
setByteArr(byte[] bytes) |
void |
setDoubleVar(java.lang.Double doubleVar) |
void |
setIntVar(int intVar) |
void |
setStr(java.lang.String str) |
void |
setTestObj(org.apache.geode.internal.cache.TestObjectWithIdentifier testObj) |
static void |
setTimesConstructed(long cnt) |
void |
toData(java.io.DataOutput out)
Writes the state of this object as primitive data to the given
DataOutput . |
void |
toDelta(java.io.DataOutput out)
This method is invoked on an application object at the delta sender, if GemFire determines the
presence of a delta by calling
Delta.hasDelta() on the object. |
static java.lang.Boolean |
toDeltaFeatureUsed() |
java.lang.String |
toString() |
public static final java.lang.String ERRONEOUS_STRING_FOR_FROM_DELTA
public static final int ERRONEOUS_INT_FOR_TO_DELTA
public static boolean NEED_TO_RESET_T0_DELTA
public DeltaTestImpl()
public DeltaTestImpl(int intVal, java.lang.String str)
public DeltaTestImpl(int intVal, java.lang.String string, java.lang.Double doubleVal, byte[] bytes, org.apache.geode.internal.cache.TestObjectWithIdentifier testObj)
public static java.util.List<java.lang.Exception> getInstantiations()
public static long getTimesConstructed()
public static void setTimesConstructed(long cnt)
public void resetDeltaStatus()
public byte[] getByteArr()
public void setByteArr(byte[] bytes)
public java.lang.Double getDoubleVar()
public void setDoubleVar(java.lang.Double doubleVar)
public int getIntVar()
public void setIntVar(int intVar)
public java.lang.String getStr()
public void setStr(java.lang.String str)
public org.apache.geode.internal.cache.TestObjectWithIdentifier getTestObj()
public void setTestObj(org.apache.geode.internal.cache.TestObjectWithIdentifier testObj)
public static void resetDeltaInvokationCounters()
public static void resetToDeltaCounter()
public static void resetFromDeltaCounter()
public static void resetFailureCounter()
public static java.lang.Boolean deltaFeatureUsed()
public static java.lang.Boolean toDeltaFeatureUsed()
public static java.lang.Long getFromDeltaInvokations()
public static java.lang.Long getToDeltaInvokations()
public static java.lang.Boolean fromDeltaFeatureUsed()
public static java.lang.Boolean isFromDeltaFailure()
public static java.lang.Boolean isToDeltaFailure()
public static java.lang.Long getFromDeltaFailures()
public static java.lang.Long getToDeltaFailures()
protected void checkInvalidString(java.lang.String str)
protected void checkInvalidInt(int intVal)
protected void checkInvalidInt2(int intVal)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public void fromDelta(java.io.DataInput in) throws java.io.IOException
Delta
InvalidDeltaException
when the delta in the DataInput
cannot be applied to the object. GemFire automatically handles an InvalidDeltaException
by reattempting the update by sending the full application object.public boolean hasDelta()
Delta
public void toDelta(java.io.DataOutput out) throws java.io.IOException
Delta
Delta.hasDelta()
on the object. The delta is written to
the DataOutput
object provided by GemFire.
Any delta state should be reset in this method.public void fromData(java.io.DataInput in) throws java.io.IOException, java.lang.ClassNotFoundException
DataSerializable
DataInput
.fromData
in interface DataSerializable
java.io.IOException
- A problem occurs while reading from in
java.lang.ClassNotFoundException
- A class could not be loaded while reading from in
public void toData(java.io.DataOutput out) throws java.io.IOException
DataSerializable
DataOutput
.
Since 5.7 it is possible for any method call to the specified DataOutput
to throw
GemFireRethrowable
. It should not be caught by user code. If it is it
must be rethrown.
toData
in interface DataSerializable
java.io.IOException
- A problem occurs while writing to out