Пример #1
0
        public long ReadOidPosition(OID oid)
        {
            if (OdbConfiguration.IsLoggingEnabled())
            {
                DLogger.Debug("ObjectReader: Start of readOidPosition for oid " + oid);
            }

            var blockNumber   = StorageEngineConstant.GetIdBlockNumberOfOid(oid);
            var blockPosition = GetIdBlockPositionFromNumber(blockNumber);

            if (OdbConfiguration.IsLoggingEnabled())
            {
                var blockNumberAsString   = blockNumber.ToString();
                var blockPositionAsString = blockPosition.ToString();
                DLogger.Debug(string.Format("ObjectReader: Block number of oid {0} is ", oid) + blockNumberAsString +
                              " / block position = " + blockPositionAsString);
            }

            var position = blockPosition + StorageEngineConstant.BlockIdOffsetForStartOfRepetition +
                           ((oid.ObjectId - 1) % StorageEngineConstant.NbIdsPerBlock) *
                           StorageEngineConstant.IdBlockRepetitionSize;

            if (OdbConfiguration.IsLoggingEnabled())
            {
                var positionAsString = position.ToString();
                DLogger.Debug(string.Format("ObjectReader: End of readOidPosition for oid {0} returning position ", oid) + positionAsString);
            }

            return(position);
        }
Пример #2
0
        public long ReadOidPosition(OID oid)
        {
            Log4NetHelper.Instance.LogDebugMessage("ObjectReader: Start of readOidPosition for oid " + oid);

            var blockNumber   = StorageEngineConstant.GetIdBlockNumberOfOid(oid);
            var blockPosition = GetIdBlockPositionFromNumber(blockNumber);

            var blockNumberAsString   = blockNumber.ToString();
            var blockPositionAsString = blockPosition.ToString();

            Log4NetHelper.Instance.LogDebugMessage(string.Format("ObjectReader: Block number of oid {0} is ", oid) + blockNumberAsString +
                                                   " / block position = " + blockPositionAsString);

            var position = blockPosition + StorageEngineConstant.BlockIdOffsetForStartOfRepetition +
                           ((oid.ObjectId - 1) % StorageEngineConstant.NbIdsPerBlock) *
                           StorageEngineConstant.IdBlockRepetitionSize;

            var positionAsString = position.ToString();

            Log4NetHelper.Instance.LogDebugMessage(string.Format("ObjectReader: End of readOidPosition for oid {0} returning position ", oid) + positionAsString);

            return(position);
        }