public QueueStorageActions(TableStorage tableStorage, IUuidGenerator generator, Reference<SnapshotReader> snapshot, Reference<WriteBatch> writeBatch, IBufferPool bufferPool) : base(snapshot, bufferPool) { this.tableStorage = tableStorage; this.writeBatch = writeBatch; this.generator = generator; }
public GeneralStorageActions(TableStorage storage, Reference<WriteBatch> writeBatch, Reference<SnapshotReader> snapshot, IBufferPool bufferPool) : base(snapshot, bufferPool) { this.storage = storage; this.writeBatch = writeBatch; this.snapshot = snapshot; }
public MappedResultsStorageActions(TableStorage tableStorage, IUuidGenerator generator, OrderedPartCollection<AbstractDocumentCodec> documentCodecs, Reference<SnapshotReader> snapshot, Reference<WriteBatch> writeBatch, IBufferPool bufferPool) : base(snapshot, bufferPool) { this.tableStorage = tableStorage; this.generator = generator; this.documentCodecs = documentCodecs; this.writeBatch = writeBatch; }
public SchemaCreator(InMemoryRavenConfiguration configuration, TableStorage storage, Action<string> output, ILog log) { this.storage = storage; this.output = output; this.log = log; configuration.Container.SatisfyImportsOnce(this); }
public IndexingStorageActions(TableStorage tableStorage, IUuidGenerator generator, Reference<SnapshotReader> snapshot, Reference<WriteBatch> writeBatch, IStorageActionsAccessor storageActionsAccessor, IBufferPool bufferPool) : base(snapshot, bufferPool) { this.tableStorage = tableStorage; this.generator = generator; this.writeBatch = writeBatch; this.currentStorageActionsAccessor = storageActionsAccessor; }
public void UpdateSchemaVersion(TableStorage tableStorage, Action<string> output) { using (var tx = tableStorage.Environment.NewTransaction(TransactionFlags.ReadWrite)) { tx.ReadTree(Tables.Details.TableName).Add(tx, "schema_version", ToSchemaVersion); tx.Commit(); } tableStorage.SetDatabaseIdAndSchemaVersion(tableStorage.Id, ToSchemaVersion); }
public AttachmentsStorageActions(Table attachmentsTable, Reference<WriteBatch> writeBatch, Reference<SnapshotReader> snapshot, IUuidGenerator uuidGenerator, TableStorage tableStorage, Raven.Storage.Voron.TransactionalStorage transactionalStorage, IBufferPool bufferPool) :base(snapshot, bufferPool) { this.attachmentsTable = attachmentsTable; this.writeBatch = writeBatch; this.uuidGenerator = uuidGenerator; this.tableStorage = tableStorage; this.transactionalStorage = transactionalStorage; metadataIndex = tableStorage.Attachments.GetIndex(Tables.Attachments.Indices.Metadata); }
public DocumentsStorageActions(IUuidGenerator uuidGenerator, OrderedPartCollection<AbstractDocumentCodec> documentCodecs, IDocumentCacher documentCacher, Reference<WriteBatch> writeBatch, Reference<SnapshotReader> snapshot, TableStorage tableStorage, IBufferPool bufferPool) : base(snapshot, bufferPool) { this.uuidGenerator = uuidGenerator; this.documentCodecs = documentCodecs; this.documentCacher = documentCacher; this.writeBatch = writeBatch; this.tableStorage = tableStorage; metadataIndex = tableStorage.Documents.GetIndex(Tables.Documents.Indices.Metadata); }
public override void Update(TableStorage tableStorage, Action<string> output) { using (var tx = tableStorage.Environment.NewTransaction(TransactionFlags.ReadWrite)) { var lists = tx.ReadTree(Tables.Lists.TableName); var iterator = lists.Iterate(); if (iterator.Seek(Slice.BeforeAllKeys)) { do { var result = lists.Read(iterator.CurrentKey); using (var stream = result.Reader.AsStream()) { var listItem = stream.ToJObject(); if (listItem.ContainsKey("createdAt")) continue; listItem.Add("createdAt", SystemTime.UtcNow); using (var streamValue = new MemoryStream()) { listItem.WriteTo(streamValue); streamValue.Position = 0; lists.Add(iterator.CurrentKey, streamValue); } } } while (iterator.MoveNext()); } tx.Commit(); } UpdateSchemaVersion(tableStorage, output); }
private static void CreateDocumentReferencesSchema(Transaction tx, TableStorage storage) { storage.Environment.CreateTree(tx, Tables.DocumentReferences.TableName); storage.Environment.CreateTree(tx, storage.DocumentReferences.GetIndexKey(Tables.DocumentReferences.Indices.ByRef)); storage.Environment.CreateTree(tx, storage.DocumentReferences.GetIndexKey(Tables.DocumentReferences.Indices.ByView)); storage.Environment.CreateTree(tx, storage.DocumentReferences.GetIndexKey(Tables.DocumentReferences.Indices.ByViewAndKey)); storage.Environment.CreateTree(tx, storage.DocumentReferences.GetIndexKey(Tables.DocumentReferences.Indices.ByKey)); }
private static void CreateMappedResultsSchema(Transaction tx, TableStorage storage) { storage.Environment.CreateTree(tx, Tables.MappedResults.TableName); storage.Environment.CreateTree(tx, storage.MappedResults.GetIndexKey(Tables.MappedResults.Indices.ByView)); storage.Environment.CreateTree(tx, storage.MappedResults.GetIndexKey(Tables.MappedResults.Indices.ByViewAndDocumentId)); storage.Environment.CreateTree(tx, storage.MappedResults.GetIndexKey(Tables.MappedResults.Indices.ByViewAndReduceKey)); storage.Environment.CreateTree(tx, storage.MappedResults.GetIndexKey(Tables.MappedResults.Indices.ByViewAndReduceKeyAndSourceBucket)); storage.Environment.CreateTree(tx, storage.MappedResults.GetIndexKey(Tables.MappedResults.Indices.Data)); }
private static void CreateReduceKeyTypesSchema(Transaction tx, TableStorage storage) { storage.Environment.CreateTree(tx, Tables.ReduceKeyTypes.TableName); storage.Environment.CreateTree(tx, storage.ReduceKeyTypes.GetIndexKey(Tables.ReduceKeyCounts.Indices.ByView)); }
private static void CreateGeneralSchema(Transaction tx, TableStorage storage) { storage.Environment.CreateTree(tx, Tables.General.TableName); }
private static void CreateScheduledReductionsSchema(Transaction tx, TableStorage storage) { storage.Environment.CreateTree(tx, Tables.ScheduledReductions.TableName); storage.Environment.CreateTree(tx, storage.ScheduledReductions.GetIndexKey(Tables.ScheduledReductions.Indices.ByView)); storage.Environment.CreateTree(tx, storage.ScheduledReductions.GetIndexKey(Tables.ScheduledReductions.Indices.ByViewAndLevelAndReduceKey)); }
private static void CreateStalenessSchema(Transaction tx, TableStorage storage) { }
public void Initialize(IUuidGenerator generator, OrderedPartCollection<AbstractDocumentCodec> documentCodecs) { if (generator == null) throw new ArgumentNullException("generator"); if (documentCodecs == null) throw new ArgumentNullException("documentCodecs"); uuidGenerator = generator; _documentCodecs = documentCodecs; StorageEnvironmentOptions options = configuration.RunInMemory ? CreateMemoryStorageOptionsFromConfiguration(configuration) : CreateStorageOptionsFromConfiguration(configuration); tableStorage = new TableStorage(options, bufferPool); var schemaCreator = new SchemaCreator(configuration, tableStorage, Output, Log); schemaCreator.CreateSchema(); schemaCreator.SetupDatabaseIdAndSchemaVersion(); schemaCreator.UpdateSchemaIfNecessary(); SetupDatabaseId(); }
private static void CreateTasksSchema(Transaction tx, TableStorage storage) { storage.Environment.CreateTree(tx, Tables.Tasks.TableName); storage.Environment.CreateTree(tx, storage.Tasks.GetIndexKey(Tables.Tasks.Indices.ByIndexAndType)); storage.Environment.CreateTree(tx, storage.Tasks.GetIndexKey(Tables.Tasks.Indices.ByType)); storage.Environment.CreateTree(tx, storage.Tasks.GetIndexKey(Tables.Tasks.Indices.ByIndex)); }
private static void CreateListsSchema(Transaction tx, TableStorage storage) { storage.Environment.CreateTree(tx, Tables.Lists.TableName); storage.Environment.CreateTree(tx, storage.Lists.GetIndexKey(Tables.Lists.Indices.ByName)); storage.Environment.CreateTree(tx, storage.Lists.GetIndexKey(Tables.Lists.Indices.ByNameAndKey)); }
private static void CreateQueuesSchema(Transaction tx, TableStorage storage) { storage.Environment.CreateTree(tx, Tables.Queues.TableName); storage.Environment.CreateTree(tx, storage.Queues.GetIndexKey(Tables.Queues.Indices.ByName)); storage.Environment.CreateTree(tx, storage.Queues.GetIndexKey(Tables.Queues.Indices.Data)); }
public void Initialize(IUuidGenerator generator, OrderedPartCollection<AbstractDocumentCodec> documentCodecs) { if (generator == null) throw new ArgumentNullException("generator"); if (documentCodecs == null) throw new ArgumentNullException("documentCodecs"); uuidGenerator = generator; _documentCodecs = documentCodecs; StorageEnvironmentOptions options = configuration.RunInMemory ? CreateMemoryStorageOptionsFromConfiguration(configuration) : CreateStorageOptionsFromConfiguration(configuration); options.OnScratchBufferSizeChanged += size => { if (configuration.Storage.Voron.ScratchBufferSizeNotificationThreshold < 0) return; if (size < configuration.Storage.Voron.ScratchBufferSizeNotificationThreshold * 1024L * 1024L) return; RunTransactionalStorageNotificationHandlers(); }; tableStorage = new TableStorage(options, bufferPool); var schemaCreator = new SchemaCreator(configuration, tableStorage, Output, Log); schemaCreator.CreateSchema(); schemaCreator.SetupDatabaseIdAndSchemaVersion(); if (!configuration.Storage.PreventSchemaUpdate) schemaCreator.UpdateSchemaIfNecessary(); SetupDatabaseId(); }
private static void CreateLastIndexedEtagsSchema(Transaction tx, TableStorage storage) { storage.Environment.CreateTree(tx, Tables.LastIndexedEtags.TableName); }
public abstract void Update(TableStorage tableStorage, Action<string> output);
private static void CreateIndexingStatsSchema(Transaction tx, TableStorage storage) { storage.Environment.CreateTree(tx, Tables.IndexingStats.TableName); }
private static void CreateDetailsSchema(Transaction tx, TableStorage storage) { storage.Environment.CreateTree(tx, Tables.Details.TableName); }
private static void CreateDocumentsSchema(Transaction tx, TableStorage storage) { storage.Environment.CreateTree(tx, Tables.Documents.TableName); storage.Environment.CreateTree(tx, storage.Documents.GetIndexKey(Tables.Documents.Indices.KeyByEtag)); storage.Environment.CreateTree(tx, storage.Documents.GetIndexKey(Tables.Documents.Indices.Metadata)); }
public StalenessStorageActions(TableStorage tableStorage, Reference<SnapshotReader> snapshot, Reference<WriteBatch> writeBatch, IBufferPool bufferPool) : base(snapshot, bufferPool) { this.tableStorage = tableStorage; this.writeBatch = writeBatch; }
public void Initialize(IUuidGenerator generator, OrderedPartCollection<AbstractDocumentCodec> documentCodecs) { if (generator == null) throw new ArgumentNullException("generator"); if (documentCodecs == null) throw new ArgumentNullException("documentCodecs"); uuidGenerator = generator; _documentCodecs = documentCodecs; StorageEnvironmentOptions options = configuration.RunInMemory ? StorageEnvironmentOptions.CreateMemoryOnly() : CreateStorageOptionsFromConfiguration(configuration); tableStorage = new TableStorage(options, bufferPool); SetupDatabaseId(); }