Package com.higherfrequencytrading.chronicle

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


            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


            }
            assertEquals(-1, excerpt2.readByte());
            excerpt2.finish();
        }
        assertEquals(counter, counter2);
        assertFalse(excerpt2.index(1024));
        tsc.close();
    }

    /**
     * Tests that <code>IndexedChronicle.close()</code> does not blow up (anymore) when you reopen an existing chronicle
View Full Code Here

        excerpt.startExcerpt(2);
        excerpt.writeBoolean(false);
        excerpt.writeBoolean(true);
        excerpt.finish();

        excerpt.index(0);
        boolean one = excerpt.readBoolean();
        boolean onetwo = excerpt.readBoolean();
        tsc.close();

        Assert.assertEquals(false, one);
View Full Code Here

        excerpt.writeEnum(BigInteger.TEN);
        excerpt.writeEnum(BigInteger.ZERO);
        excerpt.finish();
        System.out.println("size=" + excerpt.position());

        excerpt.index(0);
        AccessMode e = excerpt.readEnum(AccessMode.class);
        AccessMode r = excerpt.readEnum(AccessMode.class);
        AccessMode w = excerpt.readEnum(AccessMode.class);
        BigInteger one = excerpt.readEnum(BigInteger.class);
        BigInteger ten = excerpt.readEnum(BigInteger.class);
View Full Code Here

            excerpt.startExcerpt(28);
            excerpt.writeObject(BigDecimal.valueOf(i % 1000));
            excerpt.finish();
        }
        for (int i = 0; i < objects; i++) {
            assertTrue(excerpt.index(i));
            BigDecimal bd = (BigDecimal) excerpt.readObject();
            assertEquals(i % 1000, bd.longValue());
            excerpt.finish();
        }
//        System.out.println("waiting");
View Full Code Here

        appendNum(excerpt, 44, 7900.000000, 6);
        appendText(excerpt, 25, IOIQltyInd.H);
        appendNum(excerpt, 10, 231);
        excerpt.finish();

        assertTrue(excerpt.index(0));
        assertText(excerpt, 8, "FIX.4.1");
        assertNum(excerpt, 9, 154);
        assertNum(excerpt, 35, 6);
        assertText(excerpt, 49, "BRKR");
        assertText(excerpt, 56, "INVMGR");
View Full Code Here

    @Test
    public void testHasNextIndexIteration() throws IOException {
        final Chronicle chr = createChronicle("testIteration");

        final Excerpt readExcerpt = chr.createExcerpt();
        readExcerpt.index(0);

        while (readExcerpt.hasNextIndex()) {
            assertTrue("I would expect nextIndex() return true after hasNextIndex() returns true",
                    readExcerpt.nextIndex());
        }
View Full Code Here

            excerpt.finish();
        }

        counter = 1;
        for (int i = 0; i < 1024; i++) {
            assertTrue(excerpt.index(i));
            for (int j = 0; j < 128; j += 8) {
                long actual = excerpt.readLong();
                long expected = counter++;
                if (expected != actual)
                    assertEquals(expected, actual);
View Full Code Here

                    assertEquals(expected, actual);
            }
            assertEquals(-1, excerpt.readByte());
            excerpt.finish();
        }
        assertFalse(excerpt.index(1024));
        tsc.close();
    }


    private static void deleteOnExit(String basePath) {
View Full Code Here

        return true;
    }

    private void writeAdd(E element) {
        Excerpt excerpt = getExcerpt(maxMessageSize, add);
        long eventId = excerpt.index();
        writeElement(excerpt, element);
        excerpt.finish();
        if (!notifyOff && !listeners.isEmpty()) {
            for (int i = 0; i < listeners.size(); i++) {
                CollectionListener<E> listener = listeners.get(i);
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.