uka.patch
Class MultiplexPatchWriter
java.lang.Object
uka.patch.AbstractPatchWriter
uka.patch.MultiplexPatchWriter
- All Implemented Interfaces:
- Constants
- public class MultiplexPatchWriter
- extends AbstractPatchWriter
Multiplexes a patch created with calls to the interface of AbstractPatchWriter to several MarshalStreams. With an
installed distributor, the generated patches
can be customized for the recipient. If not all objects in the
source object graph are locally available at all target graphs (the
graphs the generated patches will be applied to), these objects can
be excluded from the patch.
| Fields inherited from interface uka.patch.Constants |
CODE_BOOLEAN, CODE_DOUBLE, CODE_END_OF_PATCH, CODE_FLOAT, CODE_INT16, CODE_INT32, CODE_INT64, CODE_INT8, CODE_NOT_MODIFIED, CODE_NULL, CODE_PATCH_HEADER, CODE_REFERENCE, MAX_DISTRIBUTION_RECORDS |
| Methods inherited from class uka.patch.AbstractPatchWriter |
endPatchRecord, flushUnmodified, write, write, write, write, write, write, write, write, writeNotModified, writeNull, writeReference |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
size
int size
myRank
int myRank
objects
PartitionedObjectSpace objects
filter
ReferenceFilter filter
group
PatchWriter[] group
- Group of
PatchWriters for transmitting patches to other
ranks. This array is initialized with PatchWriters upon
construction, but the writer connections are plugged in
dynamically in calls to registerStreams(uka.transport.MarshalStream[]).
hasStream
boolean[] hasStream
- Remembers the initialization status of
PatchWriters in
group. If hasStream[n] is
true, the corresponding PatchWriter
{#link #group}[n] is initialized with a stream for
transmission.
activeCnt
int activeCnt
- Number of initialized fields in
activeGroup.
activeGroup
PatchWriter[] activeGroup
- Subset of
PatchWriters in group. The active
group is configured for each patch record to ensure it is only
sent to those ranks having a copy of the corresponding object.
- See Also:
beginPatchRecord(int)
MultiplexPatchWriter
public MultiplexPatchWriter(PartitionedObjectSpace objects,
ReferenceFilter filter,
int myRank)
throws java.io.IOException
getGroup
public PatchWriter[] getGroup()
registerStreams
public void registerStreams(MarshalStream[] streams)
unregisterStreams
public void unregisterStreams()
init
public void init(java.lang.Object root)
throws java.io.IOException
- Specified by:
init in class AbstractPatchWriter
- Throws:
java.io.IOException
flush
public void flush()
throws java.io.IOException
- Throws:
java.io.IOException
clear
public void clear()
throws java.io.IOException
- Specified by:
clear in class AbstractPatchWriter
- Throws:
java.io.IOException
beginPatch
public void beginPatch()
throws java.io.IOException
- Specified by:
beginPatch in class AbstractPatchWriter
- Throws:
java.io.IOException
endPatch
public void endPatch()
throws java.io.IOException
- Specified by:
endPatch in class AbstractPatchWriter
- Throws:
java.io.IOException
beginPatchRecord
public void beginPatchRecord(int id)
throws java.io.IOException
- Overrides:
beginPatchRecord in class AbstractPatchWriter
- Throws:
java.io.IOException
encodeBeginPatch
protected void encodeBeginPatch()
throws java.io.IOException
- Specified by:
encodeBeginPatch in class AbstractPatchWriter
- Throws:
java.io.IOException
encodeEndPatch
protected void encodeEndPatch()
throws java.io.IOException
- Specified by:
encodeEndPatch in class AbstractPatchWriter
- Throws:
java.io.IOException
encodePatchHeader
protected void encodePatchHeader(int id)
throws java.io.IOException
- Specified by:
encodePatchHeader in class AbstractPatchWriter
- Throws:
java.io.IOException
encodeUnmodifiedCnt
protected void encodeUnmodifiedCnt(int cnt)
throws java.io.IOException
- Specified by:
encodeUnmodifiedCnt in class AbstractPatchWriter
- Throws:
java.io.IOException
encodeNull
protected void encodeNull()
throws java.io.IOException
- Specified by:
encodeNull in class AbstractPatchWriter
- Throws:
java.io.IOException
encodeReference
protected java.lang.Object encodeReference(java.lang.Object ref)
throws java.io.IOException
- Specified by:
encodeReference in class AbstractPatchWriter
- Throws:
java.io.IOException
encode
protected void encode(boolean value)
throws java.io.IOException
- Specified by:
encode in class AbstractPatchWriter
- Throws:
java.io.IOException
encode
protected void encode(byte value)
throws java.io.IOException
- Specified by:
encode in class AbstractPatchWriter
- Throws:
java.io.IOException
encode
protected void encode(char value)
throws java.io.IOException
- Specified by:
encode in class AbstractPatchWriter
- Throws:
java.io.IOException
encode
protected void encode(short value)
throws java.io.IOException
- Specified by:
encode in class AbstractPatchWriter
- Throws:
java.io.IOException
encode
protected void encode(int value)
throws java.io.IOException
- Specified by:
encode in class AbstractPatchWriter
- Throws:
java.io.IOException
encode
protected void encode(float value)
throws java.io.IOException
- Specified by:
encode in class AbstractPatchWriter
- Throws:
java.io.IOException
encode
protected void encode(long value)
throws java.io.IOException
- Specified by:
encode in class AbstractPatchWriter
- Throws:
java.io.IOException
encode
protected void encode(double value)
throws java.io.IOException
- Specified by:
encode in class AbstractPatchWriter
- Throws:
java.io.IOException
rawWriteInt
public void rawWriteInt(int value)
throws java.io.IOException
- Specified by:
rawWriteInt in class AbstractPatchWriter
- Throws:
java.io.IOException
getOutput
public MarshalStream getOutput(int rank)
throws java.io.IOException
- Experimental low-level API: Patch creation for the expert.
- Specified by:
getOutput in class AbstractPatchWriter
- Throws:
java.io.IOException