public OPhysicalPosition getPhysicalPosition ( final OPhysicalPosition iPPosition ) throws IOException { final long filePosition = iPPosition . clusterPosition * RECORD_SIZE ; acquireSharedLock ( ) ; try { final long [ ] pos = fileSegment . getRelativePosition ( filePosition ) ; final OFile f = fileSegment . files [ ( int ) pos [ 0 ] ] ; long p = pos [ 1 ] ; iPPosition . dataSegmentId = f . readShort ( p ) ; iPPosition . dataSegmentPos = f . readLong ( p += OBinaryProtocol . SIZE_SHORT ) ; iPPosition . recordType = f . readByte ( p += OBinaryProtocol . SIZE_LONG ) ; iPPosition . recordVersion = f . readInt ( p += OBinaryProtocol . SIZE_BYTE ) ; return iPPosition ; } finally { releaseSharedLock ( ) ; } }
Fills and return the PhysicalPosition object received as parameter with the physical position of logical record iPosition