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

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


    private KeyWriter writer;
   
    @Before
    public void createFileBuffers() {
        os = new ByteArrayOutputStream();
        startKey = new SortKey();
        testKey = new Key ((Persistit)null);
        writer = new KeyWriter(os);
    }
View Full Code Here


        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);
View Full Code Here

   
    @Test
    public void cycleNKeys() throws IOException{
        List<SortKey> keys = new ArrayList<>(100);
        for (int i = 0; i < 100; i++) {
            SortKey newKey = new SortKey();
            newKey.rowValue.put(i);
            testKey.clear();
            testKey.append(i);
            newKey.sortKeys.add(new KeyState (testKey));
            keys.add(newKey);
View Full Code Here

   
    @Test
    public void cycleNStrings() throws IOException {
        List<SortKey> keys = new ArrayList<>(100);
        for (int i = 0; i < 100; i++) {
            SortKey newKey = new SortKey();
            String value = characters(5+random.nextInt(1000));
            newKey.rowValue.put(value);
            testKey.clear();
            testKey.append(value);
            newKey.sortKeys.add(new KeyState (testKey));
View Full Code Here

   
    @Test
    public void cycleNMultiKeys () throws IOException {
        List<SortKey> keys = new ArrayList<>(100);
        for (int i = 0; i < 100; i++) {
            SortKey newKey = new SortKey();
            newKey.rowValue.setStreamMode(true);
            newKey.rowValue.put(random.nextInt());
            newKey.rowValue.putNull();
            newKey.rowValue.put(characters(3+random.nextInt(25)));
            newKey.rowValue.put(characters(3+random.nextInt(25)));
View Full Code Here

    }
   
    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

            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()));
View Full Code Here

   
    @Before
    public void createFileBuffers() {
        schema = new Schema(ais());
        os = new ByteArrayOutputStream();
        startKey = new SortKey();
        writer = new KeyWriter(os);
        bindRows = new ArrayList<>();

    }
View Full Code Here

        @Override
        public SortKey next() {
            if(next == null) {
                throw new IllegalStateException("No next");
            }
            SortKey t = next;
            try {
                next = reader.readNext();
                if(next == null) {
                    reader.close();
                }
View Full Code Here

TOP

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

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.