Share

Search Java Code Snippets


  Help us in improving the repository. Add new snippets through 'Submit Code Snippet ' link.





Java - Code Samples

 Sample 1. Code Sample / Example / Snippet of org.apache.ace.range.SortedRangeSet

    private void verifyStoreContents(final LogStoreImpl store, final int count, Writer... writers) throws IOException {

List<Descriptor> descriptors = store.getDescriptors();



long expectedID = 0;

for (Descriptor desc : descriptors) {

SortedRangeSet rangeSet = desc.getRangeSet();

RangeIterator rangeIter = rangeSet.iterator();



while (rangeIter.hasNext()) {

long id = rangeIter.next();



Event expectedEntry = null;

for (int i = 0; (expectedEntry == null) && i < writers.length; i++) {

expectedEntry = writers[i].m_written.remove(id);

}

assertNotNull(expectedEntry, "Event ID #" + id + " never written?!");

assertEquals(expectedEntry.getID(), expectedID++, "Entry ID mismatch?!");

}

}

}


   Like      Feedback      org.apache.ace.range.SortedRangeSet



Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner



comments powered by Disqus