Package com.higherfrequencytrading.chronicle

Examples of com.higherfrequencytrading.chronicle.Excerpt.index()


            }
        };
        while (!fsr.isClosed()) {
            fd.readMessages(listener);
        }
        excerpt.index(-1);
        int count = 0;
        while (excerpt.nextIndex()) {
            int length = (int) excerpt.readStopBit();
            String fix = ChronicleTools.asString(excerpt, excerpt.position(), length);
            assertTrue(fix.startsWith("8=FIX"));
View Full Code Here


        // a new ObjectOutputStream is required for each record as they are not reusable :(
        ObjectOutputStream coos = new ObjectOutputStream(excerpt.outputStream());
        coos.writeObject(objects);
        coos.close();

        excerpt.index(0);
        assertEquals(293, excerpt.remaining());

        // a new ObjectInputStream is required for each record as they are not reusable :(
        ObjectInputStream cois = new ObjectInputStream(excerpt.inputStream());
        List objects2 = (List) cois.readObject();
View Full Code Here

            excerpt.writeChar('T');
            excerpt.writeInt(i);
            excerpt.writeChars("Hello World!");
            excerpt.finish();

            while (excerpt2.index(i2)) {
                char type = excerpt2.readChar();
                if ('R' != type)
                    assertEquals('R', type);
                int n = excerpt2.readInt();
                if (i2 != n)
View Full Code Here

        }

        for (; i2 < RUNS; i2++) {
            do {
                busyWait();
            } while (!excerpt2.index(i2));
            char type = excerpt2.readChar();
            if ('R' != type)
                assertEquals('R', type);
            int n = excerpt2.readInt();
            if (i2 != n)
View Full Code Here

        for (int i = 0; i < rows; i++) {
            // pseudo random walk
            ptr += 1019;
            ptr %= rows;

            assertTrue(record.index(ptr));
            iterator.found = false;
            iterator.ptr = ptr;
            iterator.onExcerpt(record);

            //noinspection ConstantConditions
View Full Code Here

        for (int i = 0; i < RUNS; i++) {
            excerpt.startExcerpt(8);
            excerpt.writeLong(nanoTime());
            excerpt.finish();

            while (!excerpt2.index(i)) {
                /* try again */
            }

            long time1 = nanoTime();
            long time0 = excerpt2.readLong();
View Full Code Here

        for (int i = 0; i < runs; i++) {
            excerpt.startExcerpt(bytes.length);
            excerpt.write(bytes);
            excerpt.finish();
        }
        excerpt.index(-1);

        StringBuilder date = new StringBuilder();
        long start = System.nanoTime();
        while (excerpt.nextIndex()) {
            long l = excerpt.parseLong();
View Full Code Here

            excerpt.writeLong(nanoTime());
            excerpt.finish();

            do {
                busyWait();
            } while (!excerpt2.index(i));

            long time1 = nanoTime();
            long time0 = excerpt2.readLong();
            excerpt2.finish();
            if (i >= WARMUP) {
View Full Code Here

            sb.setLength(0);
            for (int j = i; j < i + 16; j++) {
                if (Character.isValidCodePoint(j))
                    sb.appendCodePoint(j);
            }
            excerpt.index(n);
            String text = excerpt.readUTF();
            excerpt.finish();
            assertEquals("i: " + i, sb.toString(), text);
        }
        assertTrue(excerpt.nextIndex());
View Full Code Here

        excerpt.startExcerpt(4);
        String é = "é";
        excerpt.writeUTF(é);
        excerpt.finish();

        assertTrue(excerpt.index(0));
        String e2 = excerpt.readUTF();
        excerpt.finish();
        assertEquals(e2, é);
    }
}
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.