segmentstore/server/src/test/java/io/pravega/segmentstore/server/tables/WriterTableProcessorTests.java
/**
     * Same outcome as {@link #checkIndex}, but does the verification by actually reading the Table Entries from the
     * segment. This method is slower than {@link #checkIndex} so it should only be used when needing access to the actual,
     * serialized Table Entry (such as in compaction testing).
     */
Same outcome as  #checkIndex, but does the verification by actually reading the Table Entries from the
segment. This method is slower than  #checkIndex so it should only be used when needing access to the actual,
serialized Table Entry (such as in compaction testing).
Same outcome as #checkIndex but does the verification by actually reading the Table Entries from the segment . This method is slower than #checkIndex so it should only be used when needing access to the actual serialized Table Entry ( such as in compaction testing ) .
private void checkRelocatedIndex(HashMap<BufferView, TableEntry> existingEntries, HashMap<BufferView, UUID> allKeys, TestContext context) throws Exception {
        val timer = new TimeoutTimer(TIMEOUT);
        val bucketsByHash = context.indexReader.locateBuckets(context.segmentMock, allKeys.values(), timer)
                                               .get(TIMEOUT.toMillis(), TimeUnit.MILLISECONDS);
        for (val e : allKeys.entrySet()) {
            val key = e.getKey();
            val expectedEntry = existingEntries.get(key);
            val bucket = bucketsByHash.get(e.getValue());
            Assert.assertNotNull("Test error: no bucket found.", bucket);
            if (expectedEntry != null) {
                val actualEntry = TableBucketReader.entry(context.segmentMock, context.indexReader::getBackpointerOffset, executorService())
                                                   .find(key, bucket.getSegmentOffset(), timer)
                                                   .get(TIMEOUT.toMillis(), TimeUnit.MILLISECONDS);
                Assert.assertEquals("Unexpected entry.", expectedEntry, actualEntry);
            } else {
                if (bucket.exists()) {
                    val actualEntry = TableBucketReader.entry(context.segmentMock, context.indexReader::getBackpointerOffset, executorService())
                                                       .find(key, bucket.getSegmentOffset(), timer)
                                                       .get(TIMEOUT.toMillis(), TimeUnit.MILLISECONDS);
                    Assert.assertNull(actualEntry);
                }
            }
        }
    }
private void checkRelocatedIndex ( HashMap < BufferView , TableEntry > existingEntries , HashMap < BufferView , UUID > allKeys , TestContext context ) throws Exception { val timer = new TimeoutTimer ( TIMEOUT ) ; val bucketsByHash = context . indexReader . locateBuckets ( context . segmentMock , allKeys . values ( ) , timer ) . get ( TIMEOUT . toMillis ( ) , TimeUnit . MILLISECONDS ) ; for ( val e : allKeys . entrySet ( ) ) { val key = e . getKey ( ) ; val expectedEntry = existingEntries . get ( key ) ; val bucket = bucketsByHash . get ( e . getValue ( ) ) ; Assert . assertNotNull ( "Test error: no bucket found." , bucket ) ; if ( expectedEntry != null ) { val actualEntry = TableBucketReader . entry ( context . segmentMock , context . indexReader :: getBackpointerOffset , executorService ( ) ) . find ( key , bucket . getSegmentOffset ( ) , timer ) . get ( TIMEOUT . toMillis ( ) , TimeUnit . MILLISECONDS ) ; Assert . assertEquals ( "Unexpected entry." , expectedEntry , actualEntry ) ; } else { if ( bucket . exists ( ) ) { val actualEntry = TableBucketReader . entry ( context . segmentMock , context . indexReader :: getBackpointerOffset , executorService ( ) ) . find ( key , bucket . getSegmentOffset ( ) , timer ) . get ( TIMEOUT . toMillis ( ) , TimeUnit . MILLISECONDS ) ; Assert . assertNull ( actualEntry ) ; } } } }
Same outcome as {@link #checkIndex}, but does the verification by actually reading the Table Entries from the
 segment.
Same outcome as { @link #checkIndex } but does the verification by actually reading the Table Entries from the segment .
// Get all the buckets associated with the given keys. // This key should exist. // This key should not exist.