コード例 #1
0
        public void Initialize()
        {
            bool runInMemory;
            bool.TryParse(settings["Raven/RunInMemory"], out runInMemory);

            var persistenceSource = runInMemory ? StorageEnvironmentOptions.CreateMemoryOnly() :
                CreateStorageOptionsFromConfiguration(path, settings);

            tableStorage = new TableStorage(persistenceSource, bufferPool);
	        var schemaCreator = new SchemaCreator(configuration, tableStorage, Output, Log);
			schemaCreator.CreateSchema();
			schemaCreator.SetupDatabaseIdAndSchemaVersion();
			schemaCreator.UpdateSchemaIfNecessary();

            SetupDatabaseId();
            idGenerator = new IdGenerator(tableStorage);
        }
コード例 #2
0
        public void Initialize(UuidGenerator generator, OrderedPartCollection<AbstractFileCodec> codecs)
        {
            if (codecs == null)
                throw new ArgumentNullException("codecs");

            fileCodecs = codecs;
            uuidGenerator = generator;

            bool runInMemory;
            bool.TryParse(settings[Constants.RunInMemory], out runInMemory);

            var persistenceSource = runInMemory ? StorageEnvironmentOptions.CreateMemoryOnly() :
                CreateStorageOptionsFromConfiguration(path, settings);

            tableStorage = new TableStorage(persistenceSource, bufferPool);
            var schemaCreator = new SchemaCreator(configuration, tableStorage, Output, Log);
            schemaCreator.CreateSchema();
            schemaCreator.SetupDatabaseIdAndSchemaVersion();
            schemaCreator.UpdateSchemaIfNecessary();

            SetupDatabaseId();
            idGenerator = new IdGenerator(tableStorage);
        }