private void writeExtent(int offset) throws IOException { // rawDataOut and logicalDataOut are defined by StoredPage rawDataOut.setPosition(offset); extent.writeExternal(logicalDataOut); }
private void writeExtent(int offset) throws IOException { // rawDataOut and logicalDataOut are defined by StoredPage rawDataOut.setPosition(offset); extent.writeExternal(logicalDataOut); }
private void writeExtent(int offset) throws IOException { // rawDataOut and logicalDataOut are defined by StoredPage rawDataOut.setPosition(offset); extent.writeExternal(logicalDataOut); }
/** * Update the page version number in the byte array **/ private void updatePageVersion() throws IOException { rawDataOut.setPosition(PAGE_VERSION_OFFSET); logicalDataOut.writeLong(getPageVersion()); }
/** * Update the page version number in the byte array **/ private void updatePageVersion() throws IOException { rawDataOut.setPosition(PAGE_VERSION_OFFSET); logicalDataOut.writeLong(getPageVersion()); }
/** * Update the page version number in the byte array **/ private void updatePageVersion() throws IOException { rawDataOut.setPosition(PAGE_VERSION_OFFSET); logicalDataOut.writeLong(getPageVersion()); }
/** * Recalculate checksum and write it to the page array. * <p> * Recalculate the checksum of the page, and write the result back into * the last bytes of the page. * * @exception IOException if writing to end of array fails. **/ protected void updateChecksum() throws IOException { checksum.reset(); checksum.update(pageData, 0, getPageSize() - CHECKSUM_SIZE); rawDataOut.setPosition(getPageSize() - CHECKSUM_SIZE); logicalDataOut.writeLong(checksum.getValue()); }
/** * Recalculate checksum and write it to the page array. * <p> * Recalculate the checksum of the page, and write the result back into * the last bytes of the page. * * @exception IOException if writing to end of array fails. **/ protected void updateChecksum() throws IOException { checksum.reset(); checksum.update(pageData, 0, getPageSize() - CHECKSUM_SIZE); rawDataOut.setPosition(getPageSize() - CHECKSUM_SIZE); logicalDataOut.writeLong(checksum.getValue()); }
/** * Recalculate checksum and write it to the page array. * <p> * Recalculate the checksum of the page, and write the result back into * the last bytes of the page. * * @exception IOException if writing to end of array fails. **/ protected void updateChecksum() throws IOException { checksum.reset(); checksum.update(pageData, 0, getPageSize() - CHECKSUM_SIZE); rawDataOut.setPosition(getPageSize() - CHECKSUM_SIZE); logicalDataOut.writeLong(checksum.getValue()); }
/** * Set the page offset of the record associated with the input slot. * <p> * This is the actual offset on the page of the beginning of the record. * * @param slot The array entry of the slot to set. * @param recordOffset the new offset to set. **/ private void setRecordOffset(int slot, int recordOffset) throws IOException { rawDataOut.setPosition(getSlotOffset(slot)); if (slotFieldSize == SMALL_SLOT_SIZE) logicalDataOut.writeShort(recordOffset); else logicalDataOut.writeInt(recordOffset); }
/** * Set the page offset of the record associated with the input slot. * <p> * This is the actual offset on the page of the beginning of the record. * * @param slot The array entry of the slot to set. * @param recordOffset the new offset to set. **/ private void setRecordOffset(int slot, int recordOffset) throws IOException { rawDataOut.setPosition(getSlotOffset(slot)); if (slotFieldSize == SMALL_SLOT_SIZE) logicalDataOut.writeShort(recordOffset); else logicalDataOut.writeInt(recordOffset); }
/** * Set the page offset of the record associated with the input slot. * <p> * This is the actual offset on the page of the beginning of the record. * * @param slot The array entry of the slot to set. * @param recordOffset the new offset to set. **/ private void setRecordOffset(int slot, int recordOffset) throws IOException { rawDataOut.setPosition(getSlotOffset(slot)); if (slotFieldSize == SMALL_SLOT_SIZE) logicalDataOut.writeShort(recordOffset); else logicalDataOut.writeInt(recordOffset); }
/** Set the deleted status @exception StandardException Standard Derby error policy @exception IOException RESOLVE @see BasePage#setDeleteStatus */ public void setDeleteStatus(LogInstant instant, int slot, boolean delete) throws StandardException, IOException { logAction(instant); deletedRowCount += super.setDeleteStatus(slot, delete); headerOutOfDate = true; int offset = getRecordOffset(slot); StoredRecordHeader recordHeader = getHeaderAtSlot(slot); rawDataOut.setPosition(offset); recordHeader.write(logicalDataOut); }
/** Set the deleted status @exception StandardException Standard Derby error policy @exception IOException RESOLVE @see BasePage#setDeleteStatus */ public void setDeleteStatus(LogInstant instant, int slot, boolean delete) throws StandardException, IOException { logAction(instant); deletedRowCount += super.setDeleteStatus(slot, delete); headerOutOfDate = true; int offset = getRecordOffset(slot); StoredRecordHeader recordHeader = getHeaderAtSlot(slot); rawDataOut.setPosition(offset); recordHeader.write(logicalDataOut); }
private void updateAllocPageHeader() throws IOException { // rawDataOut and logicalDataOut are defined by StoredPage rawDataOut.setPosition(ALLOC_PAGE_HEADER_OFFSET); logicalDataOut.writeLong(nextAllocPageNumber); logicalDataOut.writeLong(nextAllocPageOffset); logicalDataOut.writeLong(0); // reserved1 logicalDataOut.writeLong(0); // reserved2 logicalDataOut.writeLong(0); // reserved3 logicalDataOut.writeLong(0); // reserved4 }
private void updateAllocPageHeader() throws IOException { // rawDataOut and logicalDataOut are defined by StoredPage rawDataOut.setPosition(ALLOC_PAGE_HEADER_OFFSET); logicalDataOut.writeLong(nextAllocPageNumber); logicalDataOut.writeLong(nextAllocPageOffset); logicalDataOut.writeLong(0); // reserved1 logicalDataOut.writeLong(0); // reserved2 logicalDataOut.writeLong(0); // reserved3 logicalDataOut.writeLong(0); // reserved4 }
private void updateAllocPageHeader() throws IOException { // rawDataOut and logicalDataOut are defined by StoredPage rawDataOut.setPosition(ALLOC_PAGE_HEADER_OFFSET); logicalDataOut.writeLong(nextAllocPageNumber); logicalDataOut.writeLong(nextAllocPageOffset); logicalDataOut.writeLong(0); // reserved1 logicalDataOut.writeLong(0); // reserved2 logicalDataOut.writeLong(0); // reserved3 logicalDataOut.writeLong(0); // reserved4 }
/** Set the deleted status @exception StandardException Standard Derby error policy @exception IOException RESOLVE @see BasePage#setDeleteStatus */ public void setDeleteStatus(LogInstant instant, int slot, boolean delete) throws StandardException, IOException { logAction(instant); deletedRowCount += super.setDeleteStatus(slot, delete); headerOutOfDate = true; int offset = getRecordOffset(slot); StoredRecordHeader recordHeader = getHeaderAtSlot(slot); rawDataOut.setPosition(offset); recordHeader.write(logicalDataOut); }
/** * Return a CodeChunk that has limited visibility into * this CodeChunk. Used when a caller needs to insert instructions * into an existing stream. * @param pc * @param byteCount */ private CodeChunk(CodeChunk main, int pc, int byteCount) { this.cb = main.cb; ArrayOutputStream aos = new ArrayOutputStream(main.cout.getData()); try { aos.setPosition(CODE_OFFSET + pc); aos.setLimit(byteCount); } catch (IOException e) { limitHit(e); } cout = new ClassFormatOutput(aos); pcDelta = pc; }
/** * Return a CodeChunk that has limited visibility into * this CodeChunk. Used when a caller needs to insert instructions * into an existing stream. * @param pc * @param byteCount */ private CodeChunk(CodeChunk main, int pc, int byteCount) { this.cb = main.cb; ArrayOutputStream aos = new ArrayOutputStream(main.cout.getData()); try { aos.setPosition(CODE_OFFSET + pc); aos.setLimit(byteCount); } catch (IOException e) { limitHit(e); } cout = new ClassFormatOutput(aos); pcDelta = pc; }