Esempio n. 1
0
        public static AbstractFreespaceManager CreateNew
            (LocalObjectContainer file, byte systemType)
        {
            systemType = CheckType(systemType);
            var unblockedDiscardLimit = file.ConfigImpl.DiscardFreeSpace();
            var blockedDiscardLimit   = unblockedDiscardLimit == int.MaxValue
                ? unblockedDiscardLimit
                : file.BlockConverter().BytesToBlocks(unblockedDiscardLimit);
            var         remainderSizeLimit = file.BlockConverter().BytesToBlocks(RemainderSizeLimit);
            IProcedure4 slotFreedCallback  = new _IProcedure4_52(file);

            switch (systemType)
            {
            case FmIx:
            {
                return(new FreespaceManagerIx(blockedDiscardLimit, remainderSizeLimit));
            }

            case FmBtree:
            {
                return(new BTreeFreespaceManager(file, slotFreedCallback, blockedDiscardLimit, remainderSizeLimit
                                                 ));
            }

            default:
            {
                return(new InMemoryFreespaceManager(slotFreedCallback, blockedDiscardLimit, remainderSizeLimit
                                                    ));

                break;
            }
            }
        }
Esempio n. 2
0
 public ConsistencyChecker(IObjectContainer db)
 {
     _db       = (LocalObjectContainer)db;
     _overlaps = new OverlapMap(_db.BlockConverter());
 }
Esempio n. 3
0
        public static AbstractFreespaceManager CreateNew
            (LocalObjectContainer file, byte systemType)
        {
            systemType = CheckType(systemType);
            var unblockedDiscardLimit = file.ConfigImpl.DiscardFreeSpace();
            var blockedDiscardLimit = unblockedDiscardLimit == int.MaxValue
                ? unblockedDiscardLimit
                : file.BlockConverter().BytesToBlocks(unblockedDiscardLimit);
            var remainderSizeLimit = file.BlockConverter().BytesToBlocks(RemainderSizeLimit);
            IProcedure4 slotFreedCallback = new _IProcedure4_52(file);
            switch (systemType)
            {
                case FmIx:
                {
                    return new FreespaceManagerIx(blockedDiscardLimit, remainderSizeLimit);
                }

                case FmBtree:
                {
                    return new BTreeFreespaceManager(file, slotFreedCallback, blockedDiscardLimit, remainderSizeLimit
                        );
                }

                default:
                {
                    return new InMemoryFreespaceManager(slotFreedCallback, blockedDiscardLimit, remainderSizeLimit
                        );
                    break;
                }
            }
        }