/** Returns the value of the indicated rowid on the page */ PhysicalRowId get( short offset ) { int slot = ( offset - O_TRANS ) / PhysicalRowId.SIZE; if ( slots[slot] == null ) { slots[slot] = new PhysicalRowId( blockIo, offset ); } return slots[slot]; }
/** * Updates the mapping * * @param rowid The logical rowid * @param loc The physical rowid */ void update( Location rowid, Location loc ) throws IOException { TranslationPage xlatPage = TranslationPage.getTranslationPageView( recordFile.get( rowid.getBlock() ) ); PhysicalRowId physid = xlatPage.get( rowid.getOffset() ); physid.setBlock( loc.getBlock() ); physid.setOffset( loc.getOffset() ); recordFile.release( rowid.getBlock(), true ); }
/** Frees a slot */ void free(int slot) { get(slot).setBlock(0); setCount((short) (getCount() - 1)); }
/** Returns true if a slot is allocated */ boolean isAllocated(int slot) { return get(slot).getBlock() > 0; }
/** * Updates the mapping * * @param rowid The logical rowid * @param loc The physical rowid */ void update( Location rowid, Location loc ) throws IOException { TranslationPage xlatPage = TranslationPage.getTranslationPageView( recordFile.get( rowid.getBlock() ) ); PhysicalRowId physid = xlatPage.get( rowid.getOffset() ); physid.setBlock( loc.getBlock() ); physid.setOffset( loc.getOffset() ); recordFile.release( rowid.getBlock(), true ); }
/** Frees a slot */ void free(int slot) { get(slot).setBlock(0); setCount((short) (getCount() - 1)); }
/** Returns true if a slot is allocated */ boolean isAllocated(int slot) { return get(slot).getBlock() > 0; }
/** * Updates the mapping * * @param rowid The logical rowid * @param loc The physical rowid */ void update(Location rowid, Location loc) throws IOException { TranslationPage xlatPage = TranslationPage.getTranslationPageView( file.get(rowid.getBlock())); PhysicalRowId physid = xlatPage.get(rowid.getOffset()); physid.setBlock(loc.getBlock()); physid.setOffset(loc.getOffset()); file.release(rowid.getBlock(), true); }
/** Returns the value of the indicated rowid on the page */ PhysicalRowId get( short offset ) { int slot = ( offset - O_TRANS ) / PhysicalRowId.SIZE; if ( slots[slot] == null ) { slots[slot] = new PhysicalRowId( block, offset ); } return slots[slot]; } }
/** * Frees a slot */ void free( int slot ) { get( slot ).setBlock( 0 ); setCount( (short) ( getCount() - 1 ) ); }
/** * Returns true if a slot is allocated */ private boolean isAllocated( int slot ) { return get( slot ).getBlock() > 0; }
/** Returns the value of the indicated rowid on the page */ PhysicalRowId get( short offset ) { int slot = ( offset - O_TRANS ) / PhysicalRowId.SIZE; if ( slots[slot] == null ) { slots[slot] = new PhysicalRowId( block, offset ); } return slots[slot]; } }
/** Allocates a slot */ PhysicalRowId alloc(int slot) { setCount((short) (getCount() + 1)); get(slot).setBlock(-1); return get(slot); }
/** * {@inheritDoc} */ public String toString() { StringBuilder sb = new StringBuilder(); sb.append( "FreeLogRowIdPage ( " ); // The blockIO sb.append( super.toString() ).append( ", " ); // The first rowId sb.append( "count: " ).append( getCount() ); // Dump the Physical row id for ( int i = 0; i < ELEMS_PER_PAGE; i++ ) { if ( slots[i] != null ) { sb.append( ", [" ).append( i ).append( "]=<" ).append( slots[i].getBlock() ).append( ", " ).append( slots[i].getOffset() ).append( ">" ); } } sb.append( ")" ); return sb.toString(); } }
/** * Returns the value of the indicated slot */ PhysicalRowId get( int slot ) { if ( slots[slot] == null ) { slots[slot] = new PhysicalRowId( blockIo, slotToOffset( slot ) ); } return slots[slot]; }