Examples of KeyReader


Examples of com.codebullets.sagalib.KeyReader

    @Override
    public String findSagaInstanceKey(final Class<? extends Saga> sagaClazz, final Object message) {
        String keyValue = null;

        Collection<KeyReader> sagaReaders = tryGetReaders(sagaClazz, message);
        KeyReader reader = findReader(sagaReaders, message);
        if (reader != null) {
            keyValue = reader.readKey(message);
        }

        return keyValue;
    }
View Full Code Here

Examples of com.codebullets.sagalib.KeyReader

    /**
     * Search for reader based on message class.
     */
    private KeyReader findReader(final Collection<KeyReader> sagaKeyReaders, final Object message) {
        KeyReader messageKeyReader = null;
        Class messageClass = message.getClass();

        for (KeyReader reader : sagaKeyReaders) {
            if (reader.getMessageClass().equals(messageClass)) {
                messageKeyReader = reader;
View Full Code Here

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

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

        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

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

    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

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

    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
Copyright © 2018 www.massapi.com. 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.