congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
jdbm.recman
Code IndexAdd Tabnine to your IDE (free)

How to use jdbm.recman

Best Java code snippets using jdbm.recman (Showing top 20 results out of 315)

origin: org.fusesource.jdbm/jdbm

/**
 * 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;
}
origin: org.fusesource.jdbm/jdbm

public synchronized void rollback()
  throws IOException
{
  checkIfClosed();
  _physMgr.commit();
  _logicMgr.commit();
  _physPageman.rollback();
  _physPagemanFree.rollback();
  _logicPageman.rollback();
  _logicPagemanFree.rollback();
}
origin: org.apache.directory.jdbm/apacheds-jdbm2

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() );
}
 
origin: org.fusesource.jdbm/jdbm

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)));	
}
origin: org.fusesource.jdbm/jdbm

/**
 * 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);
}
origin: org.apache.directory.jdbm/apacheds-jdbm1

/** Allocates a slot */
PhysicalRowId alloc(int slot) {
  setCount((short) (getCount() + 1));
  get(slot).setBlock(-1);
  return get(slot);
}
origin: org.apache.directory.jdbm/apacheds-jdbm1

/** Frees a slot */
void free( int slot ) 
{
  get( slot ).setSize( 0 );
  setCount( ( short ) ( getCount() - 1 ) );
}
origin: org.apache.directory.jdbm/apacheds-jdbm1

/**
 *  Returns the indicated root rowid.
 *
 *  @see #getRootCount
 */
public synchronized long getRoot( int id ) throws IOException
{
  checkIfClosed();
  return pageMgr.getFileHeader().getRoot( id );
}
origin: org.fusesource.jdbm/jdbm

public synchronized void setRoot( int id, long rowid )
  throws IOException
{
  checkIfClosed();
  _physPageman.getFileHeader().setRoot( id, rowid );
}
origin: org.apache.directory.jdbm/apacheds-jdbm1

/**
 * Constructs a new PageHeader of the indicated type. Used for newly
 * created pages.
 */
PageHeader( BlockIo block, short type )
{
  this.block = block;
  block.setView( this );
  setType( type );
}
origin: org.apache.directory.server/apacheds-jdbm

/**
 * Returns the first block of the indicated list
 */
long getFirstOf( int list ) 
{
  return block.readLong( offsetOfFirst( list ) );
}

origin: org.apache.directory.server/apacheds-jdbm

/** Returns the next block. */
long getNext() 
{
  paranoiaMagicOk();
  return block.readLong( O_NEXT );
}

origin: org.fusesource.jdbm/jdbm

/**
 *  Returns the last block of the indicated list
 */
long getLastOf(int list) {
  return block.readLong(offsetOfLast(list));
}

origin: org.fusesource.jdbm/jdbm

/**
 * Factory method to create or return a data page for the indicated block.
 */
static FreePhysicalRowIdPage getFreePhysicalRowIdPageView(BlockIo block,int pageSize) {
  BlockView view = block.getView();
  if (view != null && view instanceof FreePhysicalRowIdPage)
    return (FreePhysicalRowIdPage) view;
  else
    return new FreePhysicalRowIdPage(block, pageSize);
}
origin: org.fusesource.jdbm/jdbm

/**
 *  Factory method to create or return a page header for the
 *  indicated block.
 */
static PageHeader getView(BlockIo block) {
  BlockView view = block.getView();
  if (view != null && view instanceof PageHeader)
    return (PageHeader) view;
  else
    return new PageHeader(block);
}

origin: org.fusesource.jdbm/jdbm

/** Sets the next block. */
void setNext(long next) {
  paranoiaMagicOk();
  block.writeLong(O_NEXT, next);
}

origin: org.apache.directory.server/apacheds-jdbm

/** Returns the value of the indicated slot */
FreePhysicalRowId get( int slot ) 
{
  if ( slots[slot] == null )
  {
    slots[slot] = new FreePhysicalRowId( block, slotToOffset( slot ) ) ;
  }
  return slots[slot];
}

origin: org.fusesource.jdbm/jdbm

/** Returns the size */
int FreePhysicalRowId_getSize(short pos) {
  int slot = offsetToSlot(pos);
  if(sizeCache[slot] == -1)
    sizeCache[slot] =  block.readInt(pos + FreePhysicalRowId_O_SIZE);
  return sizeCache[slot];
}
origin: org.apache.directory.jdbm/apacheds-jdbm1

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() );
}
origin: org.apache.directory.server/apacheds-jdbm

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() );
}
jdbm.recman

Most used classes

  • CacheRecordManager
    A RecordManager wrapping and caching another RecordManager.
  • BaseRecordManager
    This class manages records, which are uninterpreted blobs of data. The set of operations is simple a
  • TransactionManager
    This class manages the transaction log that belongs to every RecordFile. The transaction log is eith
  • PageManager
    This class manages the linked lists of pages that make up a file.
  • RecordFile
    This class represents a random access file as a set of fixed size records. Each record has a physica
  • CacheRecordManager$CacheEntry,
  • DataPage,
  • FileHeader,
  • FreeLogicalRowIdPage,
  • FreeLogicalRowIdPageManager,
  • FreePhysicalRowIdPage,
  • FreePhysicalRowIdPageManager,
  • Location,
  • LogicalRowIdManager,
  • PageCursor,
  • PageHeader,
  • PhysicalRowIdManager,
  • RecordHeader,
  • TransactionManager$BlockIoComparator
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now