Package org.fusesource.hawtdb.internal.page

Examples of org.fusesource.hawtdb.internal.page.ExtentOutputStream


    public List<Integer> store(Paged paged, int page, T data) {
        // The node will be stored in an extent. This allows us to easily
        // support huge nodes.
        // The first extent is only 1 page long, extents linked off
        // the first page will be up to 128 pages long.
        ExtentOutputStream eos = new ExtentOutputStream(paged, page, (short) 1, (short) 128);
        DataOutputStream os = new DataOutputStream(eos);
        try {
            encode(paged, os, data);
            os.close();
        } catch (IOException e) {
            throw new IndexException(e);
        }

        Ranges pages = eos.getPages();
        pages.remove(page);
        if (pages.isEmpty()) {
            return Collections.emptyList();
        }
View Full Code Here


        if (pageFile != null) {
            pageFile.flush();
            if( !isReadOnly() && pageFile.storeFreePages ) {
                Ranges ranges = pageFile.allocator().getFreeRanges().copy();
                int freePageExtent = pageFile.alloc();
                DataOutputStream os = new DataOutputStream(new ExtentOutputStream(pageFile, freePageExtent, (short)1, (short)200));
                ranges.writeExternal(os);
                os.close();
                writePageFileHeader(freePageExtent);
            }
            pageFile.flush();
View Full Code Here

TOP

Related Classes of org.fusesource.hawtdb.internal.page.ExtentOutputStream

Copyright © 2018 www.massapicom. 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.