Package com.foundationdb.qp.storeadapter.indexcursor.MergeJoinSorter

Examples of com.foundationdb.qp.storeadapter.indexcursor.MergeJoinSorter.KeyReader


        startKey.rowValue.put(1);
        writer.writeEntry(startKey);
        writer.writeEntry(startKey);
       
        is = new ByteArrayInputStream (os.toByteArray());
        KeyReader reader = new KeyReader (is);

        SortKey endKey = reader.readNext();
        assertTrue (startKey.rowValue.get().equals(endKey.rowValue.get()));
        assertTrue (startKey.sortKeys.get(0).compareTo(endKey.sortKeys.get(0)) == 0);
        endKey = reader.readNext();
        assertTrue (startKey.rowValue.get().equals(endKey.rowValue.get()));
        assertTrue (startKey.sortKeys.get(0).compareTo(endKey.sortKeys.get(0)) == 0);
        endKey = reader.readNext();
        assertNull (endKey);
    }
View Full Code Here


        verifyNKeys(keys);
    }
   
    private void verifyInput() throws IOException {
        is = new ByteArrayInputStream (os.toByteArray());
        KeyReader reader = new KeyReader (is);
        SortKey endKey = reader.readNext();
        assertTrue (startKey.rowValue.get().equals(endKey.rowValue.get()));
        assertTrue (startKey.sortKeys.get(0).compareTo(endKey.sortKeys.get(0)) == 0);
       
    }
View Full Code Here

    private void verifyNKeys(List<SortKey> keys) throws IOException  {
        for (SortKey key : keys) {
            writer.writeEntry(key);
        }
        is = new ByteArrayInputStream (os.toByteArray());
        KeyReader reader = new KeyReader (is);

        SortKey endKey;
        for (SortKey startKey : keys) {
            endKey = reader.readNext();
            endKey.rowValue.setStreamMode(true);
            startKey.rowValue.setStreamMode(true);
            assertTrue (startKey.rowValue.get().equals(endKey.rowValue.get()));
            assertTrue (startKey.sortKeys.get(0).compareTo(endKey.sortKeys.get(0)) == 0);
        }
View Full Code Here

    private static class StreamIterator implements Iterator<SortKey> {
        private final KeyReader reader;
        private SortKey next;

        public StreamIterator(InputStream stream) throws IOException {
            this.reader = new KeyReader(stream);
            this.next = reader.readNext();
        }
View Full Code Here

TOP

Related Classes of com.foundationdb.qp.storeadapter.indexcursor.MergeJoinSorter.KeyReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.