@Override public long position() { return other.position() ; }
@Override public long position() { return other.position() ; }
@Override public long position() { super.checkTxn(); return objFile.position() ; }
public TransObjectFile(ObjectFile objFile, ComponentId cid, BufferChannel bufferChannel) { super(cid) ; stateMgr = new ObjectFileState(bufferChannel, 0L, 0L) ; this.objFile = objFile ; // These may be updated by recovery. Start by setting to the // "clean start" settings. length = new AtomicLong(objFile.length()) ; position = new AtomicLong(objFile.position()) ; }
@Override protected void _commit(TxnId txnId, TxnObjectFile state) { if ( isWriteTxn() ) { // Force to disk. objFile.sync(); stateMgr.writeState(); // Move visible commit point forward. length.set(objFile.length()) ; position.set(objFile.position()) ; } }
public void dump(DumpHandler handler) { long fileIdx = 0 ; while ( true ) { ByteBuffer bb = file.read(fileIdx) ; String str = Bytes.fromByteBuffer(bb) ; handler.handle(fileIdx, str) ; fileIdx = fileIdx + bb.limit() + 4 ; if ( fileIdx >= file.position() ) break ; } }
@Override protected ByteBuffer _commitPrepare(TxnId txnId, TxnObjectFile state) { stateMgr.length(objFile.length()) ; stateMgr.position(objFile.position()); return stateMgr.getState() ; }
@Test public void objectfile_01() { assertEquals(0, file.position()) ; }