Examples of MmapTable


Examples of org.iq80.leveldb.table.MMapTable

            String tableFileName = Filename.tableFileName(fileNumber);
            File tableFile = new File(databaseDir, tableFileName);
            fileChannel = new FileInputStream(tableFile).getChannel();
            try {
                if( Iq80DBFactory.USE_MMAP ) {
                    table = new MMapTable(tableFile.getAbsolutePath(), fileChannel, userComparator, verifyChecksums);
                } else {
                    table = new FileChannelTable(tableFile.getAbsolutePath(), fileChannel, userComparator, verifyChecksums);
                }
            }
            catch (IOException e) {
View Full Code Here

Examples of org.iq80.leveldb.table.MMapTable

            String tableFileName = Filename.tableFileName(fileNumber);
            File tableFile = new File(databaseDir, tableFileName);
            fileChannel = new FileInputStream(tableFile).getChannel();
            try {
                if (Iq80DBFactory.USE_MMAP) {
                    table = new MMapTable(tableFile.getAbsolutePath(), fileChannel, userComparator, verifyChecksums);
                }
                else {
                    table = new FileChannelTable(tableFile.getAbsolutePath(), fileChannel, userComparator, verifyChecksums);
                }
            }
View Full Code Here

Examples of vanilla.java.perfeg.mmap.mmap.MmapTable

    @Test
    public void testMmap() throws IOException {
        String dir = TMP + "/mmap";
        {
            long start = System.nanoTime();
            MmapTable table = new MmapTable(dir);
            DataGenerator.generateDataFor(table, 100 * 1000 * 1000);
            table.close();
            long time = System.nanoTime() - start;
            System.out.printf("MMAP: Took %.3f seconds to generate and save %,d entries%n", time / 1e9, table.size());
            deleteOnExit(dir);
        }
        for (int i = 0; i < 3; i++) {
            long start2 = System.nanoTime();
            MmapTable table2 = new MmapTable(dir);
            computeMidPriceBP(table2);
            System.gc();
            table2.close();
            long time2 = System.nanoTime() - start2;
            System.out.printf("MMAP: Took %.3f seconds calculate the mid BP, plus a GC and save %,d entries%n", time2 / 1e9, table2.size());
        }
    }
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.