/** * Releases the indicated logical rowid. */ void delete( Location rowid ) throws IOException { freeman.put( rowid ); }
/** * Releases the indicated logical rowid. */ void delete( Location rowid ) throws IOException { freeman.put( rowid ); }
/** * Releases the indicated logical rowid. */ void delete(Location rowid) throws IOException { freeman.put(rowid); }
/** * Creates a new logical rowid pointing to the indicated physical id */ long insert(long loc) throws IOException { // check whether there's a free rowid to reuse long retval = freeman.get(); if (retval == 0) { // no. This means that we bootstrap things by allocating // a new translation page and freeing all the rowids on it. long firstPage = pageman.allocate(Magic.TRANSLATION_PAGE); short curOffset = TranslationPage.O_TRANS; for (int i = 0; i < ELEMS_PER_PAGE; i++) { freeman.put(Location.toLong(firstPage, curOffset)); curOffset += PageHeader.PhysicalRowId_SIZE; } retval = freeman.get(); if (retval == 0) { throw new Error("couldn't obtain free translation"); } } // write the translation. update(retval, loc); return retval; }
/** * Creates a new logical rowid pointing to the indicated physical * id */ Location insert(Location loc) throws IOException { // check whether there's a free rowid to reuse Location retval = freeman.get(); if (retval == null) { // no. This means that we bootstrap things by allocating // a new translation page and freeing all the rowids on it. long firstPage = pageman.allocate(Magic.TRANSLATION_PAGE); short curOffset = TranslationPage.O_TRANS; for (int i = 0; i < TranslationPage.ELEMS_PER_PAGE; i++) { freeman.put(new Location(firstPage, curOffset)); curOffset += PhysicalRowId.SIZE; } retval = freeman.get(); if (retval == null) { throw new Error( I18n.err( I18n.ERR_545 ) ); } } // write the translation. update(retval, loc); return retval; }
/** * Creates a new logical rowid pointing to the indicated physical * id */ Location insert( Location loc ) throws IOException { // check whether there's a free rowid to reuse Location retval = freeman.get(); if ( retval == null ) { // no. This means that we bootstrap things by allocating // a new translation page and freeing all the rowids on it. long firstPage = pageManager.allocate( Magic.TRANSLATION_PAGE ); short curOffset = TranslationPage.O_TRANS; for ( int i = 0; i < TranslationPage.ELEMS_PER_PAGE; i++ ) { freeman.put( new Location( firstPage, curOffset ) ); curOffset += PhysicalRowId.SIZE; } retval = freeman.get(); if ( retval == null ) { throw new Error( I18n.err( I18n.ERR_545 ) ); } } // write the translation. update( retval, loc ); return retval; }
/** * Creates a new logical rowid pointing to the indicated physical * id */ Location insert( Location loc ) throws IOException { // check whether there's a free rowid to reuse Location retval = freeman.get(); if ( retval == null ) { // no. This means that we bootstrap things by allocating // a new translation page and freeing all the rowids on it. long firstPage = pageManager.allocate( Magic.TRANSLATION_PAGE ); short curOffset = TranslationPage.O_TRANS; for ( int i = 0; i < TranslationPage.ELEMS_PER_PAGE; i++ ) { freeman.put( new Location( firstPage, curOffset ) ); curOffset += PhysicalRowId.SIZE; } retval = freeman.get(); if ( retval == null ) { throw new Error( I18n.err( I18n.ERR_545 ) ); } } // write the translation. update( retval, loc ); return retval; }
/** * Releases the indicated logical rowid. */ void delete(long rowid) throws IOException { //zero out old location, is needed for defragmentation TranslationPage xlatPage = TranslationPage.getTranslationPageView(file.get(Location.getBlock(rowid)),blockSize); xlatPage.setLocationBlock(Location.getOffset(rowid), 0); xlatPage.setLocationOffset(Location.getOffset(rowid), (short)0); file.release(Location.getBlock(rowid), true); freeman.put(rowid); }