public void Initialize() { var generator = new UuidGenerator(); storage.Initialize(generator, FileCodecs); generator.EtagBase = new SequenceActions(storage).GetNextValue("Raven/Etag"); historian = new Historian(storage, new SynchronizationHiLo(storage)); InitializeTriggersExceptIndexCodecs(); search.Initialize(this); SecondStageInitialization(); synchronizationTask.Start(); }
public void Initialize() { try { var generator = new UuidGenerator(); storage.Initialize(generator, FileCodecs, storagePath => { if (configuration.RunInMemory) { return; } var resourceTypeFile = Path.Combine(storagePath, Constants.FileSystem.FsResourceMarker); if (File.Exists(resourceTypeFile) == false) { using (File.Create(resourceTypeFile)) { } } }); generator.EtagBase = new SequenceActions(storage).GetNextValue("Raven/Etag"); historian = new Historian(storage, new SynchronizationHiLo(storage)); InitializeTriggersExceptIndexCodecs(); search.Initialize(this); SecondStageInitialization(); synchronizationTask.Start(); } catch (Exception e) { Log.ErrorException(string.Format("Could not create file system '{0}'", Name ?? "unknown name"), e); try { Dispose(); } catch (Exception ex) { Log.FatalException("Failed to dispose when already getting an error during file system initialization", ex); } throw; } }