@Override public RVVException clone() { RVVExceptionT clone = new RVVExceptionT(previousVersion, nextVersion); if (this.received != null) { clone.received = new TreeSet<Long>(this.received); } return clone; }
@Override public RVVException clone() { RVVExceptionT clone = new RVVExceptionT(previousVersion, nextVersion); if (this.received != null) { clone.received = new TreeSet<Long>(this.received); } 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); }
public void testRVVExceptionT() { RVVExceptionT ex = new RVVExceptionT(5, 10); ex.add(8); ex.add(6); assertEquals(8, ex.getHighestReceivedVersion()); } }