/** * Creates a new rowid manager using the indicated record file. * and page manager. */ PhysicalRowIdManager( RecordFile file, PageManager pageManager ) throws IOException { this.file = file; this.pageman = pageManager; this.freeman = new FreePhysicalRowIdPageManager(file, pageman); }
void commit() throws IOException { freeman.commit(); } }
private void free( Location id ) throws IOException { // get the rowid, and write a zero current size into it. BlockIo curBlock = file.get( id.getBlock() ); RecordHeader hdr = new RecordHeader( curBlock, id.getOffset() ); hdr.setCurrentSize( 0 ); file.release( id.getBlock(), true ); // write the rowid to the free list freeman.put( id, hdr.getAvailableSize() ); }
/** * Allocate a new rowid with the indicated size. */ private Location alloc( int size ) throws IOException { Location retval = freePageManager.get( size ); if ( retval == null ) { // temporary work around for DIRSERVER-1459 retval = allocNew( size * 2, pageManager.getLast( Magic.USED_PAGE ) ); } return retval; }
private void free( Location id ) throws IOException { // get the rowid, and write a zero current size into it. BlockIo curBlock = file.get( id.getBlock() ); RecordHeader hdr = new RecordHeader( curBlock, id.getOffset() ); hdr.setCurrentSize( 0 ); file.release( id.getBlock(), true ); // write the rowid to the free list freeman.put( id, hdr.getAvailableSize() ); }
/** * Allocate a new rowid with the indicated size. */ private Location alloc( int size ) throws IOException { Location retval = freeman.get( size ); if ( retval == null ) { // temporary work around for DIRSERVER-1459 retval = allocNew( size * 2, pageManager.getLast( Magic.USED_PAGE ) ); } return retval; }
/** * Creates a new rowid manager using the indicated record file. * and page manager. */ PhysicalRowIdManager( PageManager pageManager ) throws IOException { this.pageManager = pageManager; this.file = pageManager.getRecordFile(); this.freeman = new FreePhysicalRowIdPageManager( pageManager ); }
private void free( Location id ) throws IOException { // get the rowid, and write a zero current size into it. BlockIo curBlock = file.get( id.getBlock() ); RecordHeader hdr = new RecordHeader( curBlock, id.getOffset() ); hdr.setCurrentSize( 0 ); file.release( id.getBlock(), true ); // write the rowid to the free list freePageManager.put( id, hdr.getAvailableSize() ); }
/** * Allocate a new rowid with the indicated size. */ private Location alloc( int size ) throws IOException { Location retval = freeman.get( size ); if ( retval == null ) { // temporary work around for DIRSERVER-1459 retval = allocNew( size * 2, pageman.getLast( Magic.USED_PAGE ) ); } return retval; }
/** * Creates a new rowid manager using the indicated record file. * and page manager. * @throws IOException If we had an issue while creating the file */ PhysicalRowIdManager( PageManager pageManager ) throws IOException { this.pageManager = pageManager; file = pageManager.getRecordFile(); freePageManager = new FreePhysicalRowIdPageManager( pageManager ); }
private void free(long id) throws IOException { // get the rowid, and write a zero current size into it. BlockIo curBlock = file.get(Location.getBlock(id)); DataPage curPage = DataPage.getDataPageView(curBlock,BLOCK_SIZE); RecordHeader.setCurrentSize(curBlock, Location.getOffset(id), 0); file.release(Location.getBlock(id), true); // write the rowid to the free list freeman.put(id, RecordHeader.getAvailableSize(curBlock, Location.getOffset(id))); }
/** * Allocate a new rowid with the indicated size. */ private long alloc(int size) throws IOException { size = RecordHeader.roundAvailableSize(size); long retval = freeman.get(size); if (retval == 0) { retval = allocNew(size, pageman.getLast(Magic.USED_PAGE)); } return retval; }
private void reopen() throws IOException { _physFileFree = new RecordFile( _filename + DBF, FREE_BLOCK_SIZE); _physPagemanFree = new PageManager(_physFileFree); _physFile = new RecordFile( _filename + DBR, DATA_BLOCK_SIZE); _physPageman = new PageManager( _physFile ); _physMgr = new PhysicalRowIdManager( _physFile, _physPageman, new FreePhysicalRowIdPageManager(_physFileFree, _physPagemanFree)); _logicFileFree= new RecordFile( _filename +IDF,FREE_BLOCK_SIZE ); _logicPagemanFree = new PageManager( _logicFileFree ); if(TRANS_BLOCK_SIZE>256*8) throw new InternalError(); //to big page, slot number would not fit into page _logicFile = new RecordFile( _filename +IDR,TRANS_BLOCK_SIZE ); _logicPageman = new PageManager( _logicFile ); _logicMgr = new LogicalRowIdManager( _logicFile, _logicPageman, new FreeLogicalRowIdPageManager(_logicFileFree, _logicPagemanFree)); long versionNumber = getRoot(STORE_VERSION_NUMBER_ROOT); if(versionNumber>STORE_FORMAT_VERSION) throw new IOException("Unsupported version of store. Please update JDBM. Minimal supported ver:"+STORE_FORMAT_VERSION+", store ver:"+versionNumber); setRoot(STORE_VERSION_NUMBER_ROOT, STORE_FORMAT_VERSION); }