예제 #1
0
        private void Init()
        {
            nextFileId          = identityStore.GetNext(Key_FileId);
            rejectFileInsertion = (nextFileId == int.MaxValue);

            filePathToIdMap = new BPlusTree <string, int>(
                new BPlusTree <string, int> .OptionsV2(PrimitiveSerializer.String, VariantNumberSerializer.Int32)
            {
                CreateFile  = CreatePolicy.IfNeeded,
                KeyComparer = StringComparer.OrdinalIgnoreCase,
                FileName    = Path.Combine(databaseDirectory, "filePathToIdMap.b+tree")
            }.CalcBTreeOrder(500, 4)
                );

            idToFilePathMap = new BPlusTree <int, string>(
                new BPlusTree <int, string> .OptionsV2(VariantNumberSerializer.Int32, PrimitiveSerializer.String)
            {
                CreateFile = CreatePolicy.IfNeeded,
                FileName   = Path.Combine(databaseDirectory, "idToFilePathMap.b+tree")
            }.CalcBTreeOrder(4, 500)
                );

            watchedFoldersMap = new BPlusTree <string, Folder>(
                new BPlusTree <string, Folder> .OptionsV2(PrimitiveSerializer.String, FolderSerializer.Instance)
            {
                CreateFile  = CreatePolicy.IfNeeded,
                KeyComparer = StringComparer.OrdinalIgnoreCase,
                FileName    = Path.Combine(databaseDirectory, "watchedFolders.b+tree")
            }.CalcBTreeOrder(500, 500)
                );
        }
예제 #2
0
        private void Init()
        {
            nextWordId       = identityStore.GetNext(Key_NextWordId);
            nextOccurrenceId = identityStore.GetNext(Key_NextOccurrenceId);
            rejectInsertion  = (nextWordId == int.MaxValue || nextOccurrenceId == int.MaxValue);

            wordToIdMap = new BPlusTree <string, int>(
                new BPlusTree <string, int> .OptionsV2(PrimitiveSerializer.String, VariantNumberSerializer.Int32)
            {
                CreateFile  = CreatePolicy.IfNeeded,
                KeyComparer = StringComparer.OrdinalIgnoreCase,
                FileName    = Path.Combine(databaseDirectory, "wordToIdMap.b+tree")
            }.CalcBTreeOrder(100, 4)
                );

            idToWordMap = new BPlusTree <int, string>(
                new BPlusTree <int, string> .OptionsV2(VariantNumberSerializer.Int32, PrimitiveSerializer.String)
            {
                CreateFile = CreatePolicy.IfNeeded,
                FileName   = Path.Combine(databaseDirectory, "idToWordMap.b+tree")
            }.CalcBTreeOrder(4, 100)
                );

            fileCompoundIdToWordCompoundIdsMap = new BPlusTree <ulong, List <ulong> >(
                new BPlusTree <ulong, List <ulong> > .OptionsV2(
                    VariantNumberSerializer.UInt64, new ListSerializer <ulong>(VariantNumberSerializer.UInt64))
            {
                CreateFile = CreatePolicy.IfNeeded,
                FileName   = Path.Combine(databaseDirectory, "fileCompoundIdToWordCompoundIdsMap.b+tree")
            }.CalcBTreeOrder(8, 4 + 8 * MaxBatchSize)
                );

            wordCompoundIdToOccurrenceMap = new BPlusTree <ulong, WordOccurrence>(
                new BPlusTree <ulong, WordOccurrence> .OptionsV2(
                    VariantNumberSerializer.UInt64, WordOccurrenceSerializer.Instance)
            {
                CreateFile = CreatePolicy.IfNeeded,
                FileName   = Path.Combine(databaseDirectory, "wordCompoundIdToOccurrenceMap.b+tree")
            }.CalcBTreeOrder(8, 16)
                );
        }