Examples of writeIndex()


Examples of org.xtreemfs.babudb.index.writer.DiskIndexWriter.writeIndex()

    public void materializeSnapshot(String targetFile, final int snapId, final int indexId,
        final SnapshotConfig snap) throws IOException {
       
        DiskIndexWriter writer = new DiskIndexWriter(targetFile, maxEntriesPerBlock, compressed,
            maxBlockFileSize);
        writer.writeIndex(new ResultSet<Object, Object>() {
           
            private ResultSet<Object, Object>[] iterators;
           
            private Entry<Object, Object>             next;
           
View Full Code Here

Examples of org.xtreemfs.babudb.index.writer.DiskIndexWriter.writeIndex()

        // delete old index file
        FSUtils.delTree(new File(PATH1));
       
        // write the map to a disk index
        DiskIndexWriter index = new DiskIndexWriter(PATH1, MAX_BLOCK_ENTRIES, COMPRESSED, MAX_BLOCK_FILE_SIZE);
        index.writeIndex(getBufferIterator(map.entrySet().iterator()));
       
        // read the disk index
        DiskIndex diskIndex = new DiskIndex(PATH1, DefaultByteRangeComparator.getInstance(), COMPRESSED,
            MMAPED);
       
View Full Code Here

Examples of org.xtreemfs.babudb.index.writer.DiskIndexWriter.writeIndex()

            testMap.put(keys[i].getBytes(), vals[i].getBytes());
       
        // write the map to a disk index
        FSUtils.delTree(new File(PATH2));
        DiskIndexWriter index = new DiskIndexWriter(PATH2, 4, COMPRESSED, MAX_BLOCK_FILE_SIZE);
        index.writeIndex(getBufferIterator(testMap.entrySet().iterator()));
       
        // read the disk index
        DiskIndex diskIndex = new DiskIndex(PATH2, DefaultByteRangeComparator.getInstance(), COMPRESSED,
            MMAPED);
       
View Full Code Here

Examples of org.xtreemfs.babudb.index.writer.DiskIndexWriter.writeIndex()

        diskIndex.destroy();
       
        // create a disk index from an empty index file
        FSUtils.delTree(new File(PATH1));
        index = new DiskIndexWriter(PATH1, 4, COMPRESSED, MAX_BLOCK_FILE_SIZE);
        index.writeIndex(EMPTY_RESULT_SET);
       
        diskIndex = new DiskIndex(PATH1, new DefaultByteRangeComparator(), COMPRESSED, MMAPED);
       
        // check ranges; should all be empty
        it = diskIndex.rangeLookup(new byte[0], new byte[0], true);
View Full Code Here

Examples of org.xtreemfs.babudb.index.writer.DiskIndexWriter.writeIndex()

            testMap.put(keys[i].getBytes(), vals[i].getBytes());
       
        // write the map to a disk index
        FSUtils.delTree(new File(PATH2));
        DiskIndexWriter index = new DiskIndexWriter(PATH2, 4, COMPRESSED, MAX_BLOCK_FILE_SIZE);
        index.writeIndex(getBufferIterator(testMap.entrySet().iterator()));
       
        // read the disk index
        DiskIndex diskIndex = new DiskIndex(PATH2, DefaultByteRangeComparator.getInstance(), COMPRESSED,
            MMAPED);
       
View Full Code Here

Examples of org.xtreemfs.babudb.index.writer.DiskIndexWriter.writeIndex()

        diskIndex.destroy();
       
        // create a disk index from an empty index file
        FSUtils.delTree(new File(PATH1));
        index = new DiskIndexWriter(PATH1, 4, COMPRESSED, MAX_BLOCK_FILE_SIZE);
        index.writeIndex(EMPTY_RESULT_SET);
       
        diskIndex = new DiskIndex(PATH1, new DefaultByteRangeComparator(), COMPRESSED, MMAPED);
       
        // check ranges; should all be empty
        it = diskIndex.rangeLookup(new byte[0], new byte[0], false);
View Full Code Here

Examples of org.xtreemfs.babudb.index.writer.DiskIndexWriter.writeIndex()

        // delete old index file
        FSUtils.delTree(new File(PATH1));
       
        // write the map to a disk index
        DiskIndexWriter index = new DiskIndexWriter(PATH1, MAX_BLOCK_ENTRIES, COMPRESSED, MAX_BLOCK_FILE_SIZE);
        index.writeIndex(getBufferIterator(map.entrySet().iterator()));
       
        // read the disk index
        DiskIndex diskIndex = new DiskIndex(PATH1, DefaultByteRangeComparator.getInstance(), COMPRESSED,
            MMAPED);
       
View Full Code Here

Examples of org.xtreemfs.babudb.index.writer.DiskIndexWriter.writeIndex()

        // delete old index file
        FSUtils.delTree(new File(PATH1));
       
        // write the map to a disk index
        DiskIndexWriter index = new DiskIndexWriter(PATH1, MAX_BLOCK_ENTRIES, COMPRESSED, MAX_BLOCK_FILE_SIZE);
        index.writeIndex(getBufferIterator(map.entrySet().iterator()));
       
        // read the disk index
        DiskIndex diskIndex = new DiskIndex(PATH1, DefaultByteRangeComparator.getInstance(), COMPRESSED,
            MMAPED);
       
View Full Code Here

Examples of org.xtreemfs.babudb.index.writer.DiskIndexWriter.writeIndex()

            testMap.put(entries[i], entries[i]);
       
        // write the map to a disk index
        FSUtils.delTree(new File(PATH2));
        DiskIndexWriter index = new DiskIndexWriter(PATH2, 2, COMPRESSED, MAX_BLOCK_FILE_SIZE);
        index.writeIndex(getBufferIterator(testMap.entrySet().iterator()));
    }
   
    private static byte[][] createRandomByteArrays(int num) {
       
        HashSet<String> set = new HashSet<String>();
View Full Code Here

Examples of org.xtreemfs.babudb.index.writer.DiskIndexWriter.writeIndex()

           
            System.out.println("creating new database with " + size + " random entries ...");
           
            // write the map to a disk index
            DiskIndexWriter index = new DiskIndexWriter(path, entriesPerBlock, false, blockFileSize);
            index.writeIndex(new ResultSet<Object, Object>() {
               
                private int    count;
               
                private String next = minChar + "";
               
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.