uka.patch
Class DistributionJournal

java.lang.Object
  extended byuka.patch.DistributionJournal

public final class DistributionJournal
extends java.lang.Object

A distribution journal records changes to the specified object distribution of a replicated object. These changes are committed to the internal management structures only upon update time. Since the update process may need the state of the distribution before the modification, it is necessary to log these changes instead of modifying the distribution directly.


Field Summary
private  EnlargingBooleanArray2D distribution
          Mapping ID x Rank -> boolean.
private  IDMap objects
          Internal object to ID translation.
private  int size
           
 
Constructor Summary
DistributionJournal(int size)
           
 
Method Summary
 void clear()
          Clears the journal.
 int findID(java.lang.Object obj)
           
 java.lang.Object getObject(int id)
           
 IntIterator getUsedIDs()
           
 boolean isSpecified(int id, int rank)
           
 boolean isValid(int id)
           
 void remove(int id)
           
 void setSpecified(java.lang.Object obj, boolean[] ranks)
           
 void setSpecified(java.lang.Object obj, int[] ranks)
           
 java.lang.String toStringSpecified(int id)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

size

private final int size

objects

private final IDMap objects
Internal object to ID translation. The distribution journal needs its own identifier space, because it is possible to specify the distribution of an object that is not yet part of the replicated state and has not yet an identifier assigned there.


distribution

private final EnlargingBooleanArray2D distribution
Mapping ID x Rank -> boolean. Holds the specified distribution for each object in the objects map.

Constructor Detail

DistributionJournal

public DistributionJournal(int size)
Method Detail

setSpecified

public void setSpecified(java.lang.Object obj,
                         int[] ranks)

setSpecified

public void setSpecified(java.lang.Object obj,
                         boolean[] ranks)

findID

public int findID(java.lang.Object obj)

getObject

public java.lang.Object getObject(int id)

getUsedIDs

public IntIterator getUsedIDs()

isValid

public boolean isValid(int id)

isSpecified

public boolean isSpecified(int id,
                           int rank)

remove

public void remove(int id)

toStringSpecified

public java.lang.String toStringSpecified(int id)

clear

public void clear()
Clears the journal. This method is called, after the distribution journal is committed to the management structures of the corresponding replicated object at the end of each update.