/** * Insert at forced location, use only for defragmentation !! * @param logicalRowId * @param physLoc * @throws IOException */ void forceInsert(long logicalRowId, long physLoc) throws IOException { //create pages until we reach requested block long lastBlock = pageman.getLast(Magic.TRANSLATION_PAGE); while(lastBlock!=Location.getBlock(logicalRowId)){ lastBlock = pageman.allocate(Magic.TRANSLATION_PAGE); if(lastBlock>Location.getBlock(logicalRowId)) throw new Error("outallocated"); } if(fetch(logicalRowId) != 0) throw new Error("can not forceInsert, record already exists: "+logicalRowId); update(logicalRowId, physLoc); }
/** * 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; }
long freePage = pageman.allocate(Magic.FREELOGIDS_PAGE); BlockIo curBlock = file.get(freePage); FreeLogicalRowIdPage fp = FreeLogicalRowIdPage.getFreeLogicalRowIdPageView(curBlock, blockSize);
long freePage = _pageman.allocate(Magic.FREEPHYSIDS_PAGE); BlockIo curBlock = _file.get(freePage); FreePhysicalRowIdPage fp = FreePhysicalRowIdPage.getFreePhysicalRowIdPageView(curBlock, blockSize);
if (start == 0) { start = pageman.allocate(Magic.USED_PAGE); curBlock = file.get(start); curPage = DataPage.getDataPageView(curBlock,BLOCK_SIZE); start = pageman.allocate(Magic.USED_PAGE); curBlock = file.get(start); curPage = DataPage.getDataPageView(curBlock, BLOCK_SIZE); start = pageman.allocate(Magic.USED_PAGE); curBlock = file.get(start); curPage = DataPage.getDataPageView(curBlock, BLOCK_SIZE);
if ( start == 0 ) { start = pageManager.allocate( Magic.USED_PAGE ); curBlock = file.get( start ); curPage = DataPage.getDataPageView( curBlock ); start = pageManager.allocate( Magic.USED_PAGE ); curBlock = file.get( start ); curPage = DataPage.getDataPageView( curBlock ); start = pageManager.allocate( Magic.USED_PAGE ); curBlock = file.get( start ); curPage = DataPage.getDataPageView( curBlock );
if ( start == 0 ) { start = pageman.allocate( Magic.USED_PAGE ); curBlock = file.get( start ); curPage = DataPage.getDataPageView( curBlock ); start = pageman.allocate( Magic.USED_PAGE ); curBlock = file.get( start ); curPage = DataPage.getDataPageView( curBlock ); start = pageman.allocate( Magic.USED_PAGE ); curBlock = file.get( start ); curPage = DataPage.getDataPageView( curBlock );
start = pageManager.allocate( Magic.USED_PAGE ); curBlock = file.get( start ); curPage = DataPage.getDataPageView( curBlock ); start = pageManager.allocate( Magic.USED_PAGE ); curBlock = file.get( start ); curPage = DataPage.getDataPageView( curBlock ); start = pageManager.allocate( Magic.USED_PAGE ); curBlock = file.get( start ); curPage = DataPage.getDataPageView( curBlock );
freePage = pageManager.allocate(Magic.FREELOGIDS_PAGE); BlockIo curBlock = recordFile.get(freePage); FreeLogicalRowIdPage fp =
freePage = pageman.allocate(Magic.FREELOGIDS_PAGE); BlockIo curBlock = file.get(freePage); FreeLogicalRowIdPage fp =
freePage = pageManager.allocate( Magic.FREELOGIDS_PAGE ); BlockIo curBlockIo = recordFile.get( freePage ); FreeLogicalRowIdPage fp = FreeLogicalRowIdPage.getFreeLogicalRowIdPageView( curBlockIo );
freePage = pageman.allocate( Magic.FREEPHYSIDS_PAGE ); BlockIo curBlock = file.get( freePage ); FreePhysicalRowIdPage fp = FreePhysicalRowIdPage.getFreePhysicalRowIdPageView( curBlock );
freePage = pageManager.allocate( Magic.FREEPHYSIDS_PAGE ); BlockIo curBlock = recordFile.get( freePage ); FreePhysicalRowIdPage fp = FreePhysicalRowIdPage.getFreePhysicalRowIdPageView( curBlock );
freePage = pageManager.allocate( Magic.FREEPHYSIDS_PAGE ); BlockIo curBlock = recordFile.get( freePage ); FreePhysicalRowIdPage fp = FreePhysicalRowIdPage.getFreePhysicalRowIdPageView( curBlock );