Examples of useUnsafe()


Examples of com.higherfrequencytrading.chronicle.impl.IndexedChronicle.useUnsafe()

        String tmp = System.getProperty("java.io.tmpdir");
//        String tmp = System.getProperty("user.home");

        String pePath = tmp + "/demo/pe";
        IndexedChronicle pe2gw = new IndexedChronicle(pePath);
        pe2gw.useUnsafe(true);
        Excerpt excerpt = pe2gw.createExcerpt();
        final Pe2GwWriter pe2GwWriter = new Pe2GwWriter(excerpt);

        Gw2PeEvents listener = new PEEvents(pe2GwWriter);
        Gw2PeReader[] readers = new Gw2PeReader[2];
View Full Code Here

Examples of com.higherfrequencytrading.chronicle.impl.IndexedChronicle.useUnsafe()

        String gw2pePath = tmp + "/demo/gw2pe" + gwId;
        String pePath = tmp + "/demo/pe";

        // setup
        IndexedChronicle gw2pe = new IndexedChronicle(gw2pePath);
        gw2pe.useUnsafe(true);
        Gw2PeWriter gw2PeWriter = new Gw2PeWriter(gw2pe.createExcerpt());

        IndexedChronicle pe2gw = new IndexedChronicle(pePath);
        pe2gw.useUnsafe(true);
        final Histogram times = new Histogram(10000, 100);
View Full Code Here

Examples of com.higherfrequencytrading.chronicle.impl.IndexedChronicle.useUnsafe()

        IndexedChronicle gw2pe = new IndexedChronicle(gw2pePath);
        gw2pe.useUnsafe(true);
        Gw2PeWriter gw2PeWriter = new Gw2PeWriter(gw2pe.createExcerpt());

        IndexedChronicle pe2gw = new IndexedChronicle(pePath);
        pe2gw.useUnsafe(true);
        final Histogram times = new Histogram(10000, 100);
        final AtomicInteger reportCount = new AtomicInteger();
        Pe2GwEvents listener = new Pe2GwEvents() {
            @Override
            public void report(@NotNull MetaData metaData, SmallReport smallReport) {
View Full Code Here

Examples of com.higherfrequencytrading.chronicle.impl.IndexedChronicle.useUnsafe()

    public void testSerailization() throws IOException, ClassNotFoundException {
        final String basePath = BASE_DIR + "objects";
        deleteOnExit(basePath);

        IndexedChronicle tsc = new IndexedChronicle(basePath);
        tsc.useUnsafe(false /*USE_UNSAFE*/);

        Excerpt excerpt = tsc.createExcerpt();

        List objects = Arrays.asList(1, 1L, "one", new Date(1));

View Full Code Here

Examples of com.higherfrequencytrading.chronicle.impl.IndexedChronicle.useUnsafe()

        String msg = msg0.replace(" | ", "" + (char) 1);

        String basePath = TMP + "/fix";
        ChronicleTools.deleteOnExit(basePath);
        IndexedChronicle chronicle = new IndexedChronicle(basePath);
        chronicle.useUnsafe(true);
        Excerpt excerpt = chronicle.createExcerpt();
        byte[] bytes = msg.getBytes();
        int runs = 1000000;
        for (int i = 0; i < runs; i++) {
            excerpt.startExcerpt(bytes.length);
View Full Code Here

Examples of com.higherfrequencytrading.chronicle.impl.IndexedChronicle.useUnsafe()

        new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    IndexedChronicle ic = new IndexedChronicle(basePath);
                    ic.useUnsafe(true); // for benchmarks
                    Excerpt excerpt = ic.createExcerpt();
                    for (long i = 1; i <= runs; i += batchSize) {
                        excerpt.startExcerpt(13 * batchSize);
                        for (int k = 0; k < batchSize; k++) {
                            excerpt.writeUnsignedByte('M'); // message type
View Full Code Here

Examples of com.higherfrequencytrading.chronicle.impl.IndexedChronicle.useUnsafe()

                }
            }
        }).start();

        IndexedChronicle ic = new IndexedChronicle(basePath);
        ic.useUnsafe(true); // for benchmarks
        Excerpt excerpt = ic.createExcerpt();
        int blocks = 1000000;
        for (long j = 0; j < runs; j += blocks) {
            for (long i = j + 1; i <= j + blocks; i += batchSize) {
                while (!excerpt.nextIndex()) {
View Full Code Here

Examples of com.higherfrequencytrading.chronicle.impl.IndexedChronicle.useUnsafe()

    public static void main(String[] args) throws IOException {
        String basePath = TMP + "/DataStorePerfTest";
        ChronicleTools.deleteOnExit(basePath);
        IndexedChronicle chronicle = new IndexedChronicle(basePath);
        chronicle.useUnsafe(true);
        DataStore dataStore = new DataStore(chronicle, ModelMode.MASTER);
        MapWrapper<String, byte[]> map = new MapWrapper<String, byte[]>(dataStore, "map",
                String.class, byte[].class, new LinkedHashMap<String, byte[]>(), 160);
        dataStore.add("map", map);
        dataStore.start();
View Full Code Here

Examples of com.higherfrequencytrading.chronicle.impl.IndexedChronicle.useUnsafe()

        Thread t = new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    final IndexedChronicle chronicle = new IndexedChronicle(basePath);
                    chronicle.useUnsafe(true); // for benchmarks.
                    final Excerpt excerpt = chronicle.createExcerpt();
                    for (int i = -warmup; i < repeats; i++) {
                        doSomeThinking();
                        excerpt.startExcerpt(8 + 4 + 4 * consolidates.length);
                        excerpt.writeLong(System.nanoTime());
View Full Code Here

Examples of com.higherfrequencytrading.chronicle.impl.IndexedChronicle.useUnsafe()

            }
        });
        t.start();
        //Read
        final IndexedChronicle chronicle = new IndexedChronicle(basePath);
        chronicle.useUnsafe(true); // for benchmarks.
        final Excerpt excerpt = chronicle.createExcerpt();
        int[] times = new int[repeats];
        for (int count = -warmup; count < repeats; count++) {
            do {
            /* busy wait */
 
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.