@Override public RVVExceptionB clone() { RVVExceptionB clone = new RVVExceptionB(previousVersion, nextVersion); if (this.received != null) { clone.received = (BitSet)this.received.clone(); clone.receivedBaseVersion = this.receivedBaseVersion; } return clone; }
@Override public RVVExceptionB clone() { RVVExceptionB clone = new RVVExceptionB(previousVersion, nextVersion); if (this.received != null) { clone.received = (BitSet)this.received.clone(); clone.receivedBaseVersion = this.receivedBaseVersion; } return clone; }
/** Use this method to create a new RVVException */ static RVVException createException(long previousVersion, long nextVersion, long initialExceptionCount) { // arbitrary cutoff of 100 bytes to use a treeSet instead of bitSet // But if we are deserializing an exception too many received versions use a // bitset anyway. long delta = nextVersion - previousVersion; if (UseTreeSetsForTesting || ( delta > RVV_MAX_BITSET_SPAN && initialExceptionCount * 512 < delta )) { return new RVVExceptionT(previousVersion, nextVersion); } return new RVVExceptionB(previousVersion, nextVersion); }
/** Use this method to create a new RVVException */ static RVVException createException(long previousVersion, long nextVersion, long initialExceptionCount) { // arbitrary cutoff of 100 bytes to use a treeSet instead of bitSet // But if we are deserializing an exception too many received versions use a // bitset anyway. long delta = nextVersion - previousVersion; if (UseTreeSetsForTesting || ( delta > RVV_MAX_BITSET_SPAN && initialExceptionCount * 512 < delta )) { return new RVVExceptionT(previousVersion, nextVersion); } return new RVVExceptionB(previousVersion, nextVersion); }
@Override public RVVException changeForm() { //Convert the exception to a bitset exception RVVExceptionB ex = new RVVExceptionB(previousVersion, nextVersion); for(ReceivedVersionsIterator it = this.receivedVersionsIterator(); it.hasNext(); ) { long next = it.next(); ex.add(next); } return ex; }
@Override public RVVException changeForm() { //Convert the exception to a bitset exception RVVExceptionB ex = new RVVExceptionB(previousVersion, nextVersion); for(ReceivedVersionsIterator it = this.receivedVersionsIterator(); it.hasNext(); ) { long next = it.next(); ex.add(next); } return ex; }
public void testRVVExceptionB() { RVVExceptionB ex = new RVVExceptionB(5, 10); ex.add(8); ex.add(6); assertEquals(8, ex.getHighestReceivedVersion()); ex.add(5); assertEquals(8, ex.getHighestReceivedVersion()); }