Package org.apache.derby.iapi.services.io

Examples of org.apache.derby.iapi.services.io.ArrayInputStream


            long logEndInstant = LOG_FILE_HEADER_SIZE;

            StreamLogScan scanOfHighestLogFile =
                (StreamLogScan) openForwardsScan(startInstant,
                                                 (LogInstant)null);
            ArrayInputStream scanInputStream = new ArrayInputStream();
            while(scanOfHighestLogFile.getNextRecord(scanInputStream, null, 0)
                  != null){
                logEndInstant = scanOfHighestLogFile.getLogRecordEnd();
            }
View Full Code Here


    {
        super.initialize();

        if (rawDataIn == null)
        {
            rawDataIn            = new ArrayInputStream();
            checksum             = new CRC32();
        }

        if (pageData != null)
            rawDataIn.setData(pageData);
View Full Code Here

                    "restoreRecordFromSlot called on an overflow page.");
            }

            // position the array reading stream at beginning of row data just
            // past the record header.
            ArrayInputStream lrdi = rawDataIn;
            lrdi.setPosition(offset_to_row_data);

            if (!recordHeader.hasOverflow())
            {
                if (isHeadRow)
                {
                    if (fetchDesc != null &&
                        fetchDesc.getQualifierList() != null)
                    {
                        fetchDesc.reset();

                        if (!qualifyRecordFromSlot(
                                row,
                                offset_to_row_data,
                                fetchDesc,
                                recordHeader,
                                recordToLock))
                        {
                            return(false);
                        }
                        else
                        {
                            // reset position back for subsequent record read.
                            lrdi.setPosition(offset_to_row_data);
                        }
                    }
                }

                // call routine to do the real work.  Note that
View Full Code Here

                }
            }

            // position the array reading stream at beginning of row data
            // just past the record header.
            ArrayInputStream lrdi = rawDataIn;
            lrdi.setPosition(offset_to_row_data);

            if (fetchDesc != null)
            {
                if (fetchDesc.getQualifierList() != null)
                {
View Full Code Here

     **/
    private void readPageHeader()
        throws IOException
    {
        // these reads are always against the page array
        ArrayInputStream lrdi = rawDataIn;

        lrdi.setPosition(PAGE_HEADER_OFFSET);
        long spare;

        isOverflowPage  =   lrdi.readBoolean();
        setPageStatus       (lrdi.readByte());
        setPageVersion      (lrdi.readLong());
        slotsInUse      =   lrdi.readUnsignedShort();
        nextId          =   lrdi.readInt();
        generation      =   lrdi.readInt();     // page generation (Future Use)
        prevGeneration  =   lrdi.readInt();     // previous generation (Future Use)
        bipLocation     =   lrdi.readLong();    // BIPage location (Future Use)

        // number of deleted rows on page, we start to store this release 2.0.
        // for upgrade reasons, a 0 on disk means -1, so, we subtract one here.
        deletedRowCount =   lrdi.readUnsignedShort() - 1;

        // the next 4 (total 22 bytes) are reserved for future
        spare           =   lrdi.readUnsignedShort();  
        spare           =   lrdi.readInt();     // used by encryption
        spare           =   lrdi.readLong();
        spare           =   lrdi.readLong();
    }
View Full Code Here

                    "bad record offset found in getRecordPortionLength()");
            }
        }

        // these reads are always against the page array
        ArrayInputStream lrdi = rawDataIn;

        lrdi.setPosition(
            slotTableOffsetToFirstRecordLengthField - (slot * slotEntrySize));

        return(
            (slotFieldSize == SMALL_SLOT_SIZE) ?
                lrdi.readUnsignedShort() : lrdi.readInt());
    }
View Full Code Here

                    "bad record offset found in getReservedCount");
            }
        }

        // these reads are always against the page array
        ArrayInputStream lrdi = rawDataIn;

        lrdi.setPosition(
            slotTableOffsetToFirstReservedSpaceField - (slot * slotEntrySize));

        return(
            (slotFieldSize == SMALL_SLOT_SIZE) ?
                lrdi.readUnsignedShort() : lrdi.readInt());
    }
View Full Code Here

            }

            int numberFields = recordHeader.getNumberFields();

            // these reads are always against the page array
            ArrayInputStream lrdi = rawDataIn;

            // position after the record header, at 1st column.
            lrdi.setPosition(offset + recordHeader.size());
       
            for (int i = 0; i < numberFields; i++)
            {
                int fieldStatus = StoredFieldHeader.readStatus(lrdi);
                if (StoredFieldHeader.isOverflow(fieldStatus))
                    return false;

                int fieldLength =
                    StoredFieldHeader.readFieldDataLength(
                        lrdi, fieldStatus, slotFieldSize);

                if (fieldLength != 0)
                    lrdi.setPosition(lrdi.getPosition() + fieldLength);
            }
        }
        catch (IOException ioe)
        {
            throw dataFactory.markCorrupt(
View Full Code Here

            StoredRecordHeader recordHeader = getHeaderAtSlot(slot);

            int numberFields    = recordHeader.getNumberFields();

            // these reads are always against the page array
            ArrayInputStream lrdi = rawDataIn;

            // position the stream to just after record header.
            int offset          = getRecordOffset(slot) + recordHeader.size();
            lrdi.setPosition(offset);

            for (int i = 0; i < numberFields; i++)
            {
                int fieldStatus = StoredFieldHeader.readStatus(lrdi);
                int fieldLength =
                    StoredFieldHeader.readFieldDataLength(
                        lrdi, fieldStatus, slotFieldSize);

                if (!StoredFieldHeader.isOverflow(fieldStatus))
                {
                    // skip this field, it is not an long column
                    if (fieldLength != 0)
                        lrdi.setPosition(lrdi.getPosition() + fieldLength);
                    continue;
                }
                else
                {
View Full Code Here

                columnId >= recordHeader.getFirstField(),
                "first column on page > expected");
        }

        // these reads are always against the page array
        ArrayInputStream lrdi = rawDataIn;

        // set read position to data portion of record to check.
        int offset = getRecordOffset(slot);
        lrdi.setPosition(offset + recordHeader.size());

        // skip until you get to the record in question.
        for (int i = recordHeader.getFirstField(); i < columnId; i++)
            skipField(lrdi);
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.services.io.ArrayInputStream

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.