Package org.hsqldb.rowio

Examples of org.hsqldb.rowio.RowOutputBinary


     * resultOut is reused to trasmit all remote calls for session management.
     * Here the structure is preset for sending attributes.
     */
    private void initStructures() {

        rowOut    = new RowOutputBinary(mainBuffer);
        rowIn     = new RowInputBinary(rowOut);
        resultOut = Result.newSessionAttributesResult();

        resultOut.add(new Object[7]);
    }
View Full Code Here


    int[] writeTableToDataFile(Table table) throws IOException {

        Session session = database.getSessionManager().getSysSession();
        PersistentStore    store  = session.sessionData.getRowStore(table);
        RowOutputInterface rowOut = new RowOutputBinary();
        DoubleIntIndex pointerLookup =
            new DoubleIntIndex(table.getPrimaryIndex().sizeEstimate(store),
                               false);
        int[] rootsArray = table.getIndexRootsArray();
        long  pos        = fileOffset;
        int   count      = 0;

        pointerLookup.setKeysSearchTarget();
        Error.printSystemOut("lookup begins: " + stopw.elapsedTime());

        RowIterator it = table.rowIterator(session);

        for (; it.hasNext(); count++) {
            CachedObject row = it.getNextRow();

            pointerLookup.addUnsorted(row.getPos(), (int) (pos / scale));

            if (count % 50000 == 0) {
                Error.printSystemOut("pointer pair for row " + count + " "
                                     + row.getPos() + " " + pos);
            }

            pos += row.getStorageSize();
        }

        Error.printSystemOut(table.getName().name + " list done ",
                             stopw.elapsedTime());

        count = 0;
        it    = table.rowIterator(session);

        for (; it.hasNext(); count++) {
            CachedObject row = it.getNextRow();

            rowOut.reset();
            row.write(rowOut, pointerLookup);
            fileStreamOut.write(rowOut.getOutputStream().getBuffer(), 0,
                                rowOut.size());

            fileOffset += row.getStorageSize();

            if ((count) % 50000 == 0) {
                Error.printSystemOut(count + " rows " + stopw.elapsedTime());
View Full Code Here

                       boolean newFile) {
        super(db, file, includeCached, newFile, false);
    }

    protected void initBuffers() {
        rowOut = new RowOutputBinary();
    }
View Full Code Here

    protected void initBuffers() {

        if (rowOut == null
                || rowOut.getOutputStream().getBuffer().length
                   > initIOBufferSize) {
            rowOut = new RowOutputBinary(256, cachedRowPadding);
        }

        if (rowIn == null || rowIn.getBuffer().length > initIOBufferSize) {
            rowIn = new RowInputBinary(new byte[256]);
        }
View Full Code Here

    protected void initBuffers() {

        if (rowOut == null
                || ((RowOutputBinary) rowOut).getBuffer().length
                   > initIOBufferSize) {
            rowOut = new RowOutputBinary(256);
        }

        if (rowIn == null
                || ((RowInputBinary) rowIn).getBuffer().length
                   > initIOBufferSize) {
View Full Code Here

    public void init(ServletConfig config) {

        try {
            super.init(config);

            rowOut = new RowOutputBinary(BUFFER_SIZE);
            rowIn  = new RowInputBinary(rowOut);
        } catch (ServletException e) {
            log(e.toString());
        }
View Full Code Here

    int[] writeTableToDataFile(Table table)
    throws IOException, HsqlException {

        Session session        = database.getSessionManager().getSysSession();
        RowOutputBinary rowOut = new RowOutputBinary();
        DoubleIntIndex pointerLookup =
            new DoubleIntIndex(table.getPrimaryIndex().sizeEstimate(), false);
        int[] rootsArray = table.getIndexRootsArray();
        long  pos        = fileOffset;
        int   count      = 0;

        pointerLookup.setKeysSearchTarget();
        Trace.printSystemOut("lookup begins: " + stopw.elapsedTime());

        RowIterator it = table.rowIterator(session);

        for (; it.hasNext(); count++) {
            CachedObject row = (CachedObject) it.next();

            pointerLookup.addUnsorted(row.getPos(), (int) (pos / scale));

            if (count % 50000 == 0) {
                Trace.printSystemOut("pointer pair for row " + count + " "
                                     + row.getPos() + " " + pos);
            }

            pos += row.getStorageSize();
        }

        Trace.printSystemOut(table.getName().name + " list done ",
                             stopw.elapsedTime());

        count = 0;
        it    = table.rowIterator(session);

        for (; it.hasNext(); count++) {
            CachedObject row = it.next();

            rowOut.reset();
            row.write(rowOut, pointerLookup);
            fileStreamOut.write(rowOut.getOutputStream().getBuffer(), 0,
                                rowOut.size());

            fileOffset += row.getStorageSize();

            if ((count) % 50000 == 0) {
                Trace.printSystemOut(count + " rows " + stopw.elapsedTime());
View Full Code Here

    public void init(ServletConfig config) {

        try {
            super.init(config);

            rowOut = new RowOutputBinary(BUFFER_SIZE);
            rowIn  = new RowInputBinary(rowOut);
        } catch (ServletException exp) {
            log(exp.toString());
        }
View Full Code Here

    protected void initBuffers() {

        if (rowOut == null
                || ((RowOutputBinary) rowOut).getBuffer().length > 256) {
            rowOut = new RowOutputBinary(256);
        }

        if (rowIn == null
                || ((RowInputBinary) rowIn).getBuffer().length > 256) {
            rowIn = new RowInputBinary(new byte[256]);
View Full Code Here

                       boolean newFile) throws HsqlException {
        super(db, file, includeCached, newFile, false);
    }

    protected void initBuffers() {
        rowOut = new RowOutputBinary();
    }
View Full Code Here

TOP

Related Classes of org.hsqldb.rowio.RowOutputBinary

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.