public Reader(CounterStorage parent, Transaction t) { this.parent = parent; transaction = t; serverNamesToIds = parent.storageEnvironment.CreateTree(transaction, "serverNames->Ids"); serverIdsToNames = parent.storageEnvironment.CreateTree(transaction, "Ids->serverNames"); serversLastEtag = parent.storageEnvironment.CreateTree(transaction, "servers->lastEtag"); counters = parent.storageEnvironment.CreateTree(transaction, "counters"); countersGroups = parent.storageEnvironment.CreateTree(transaction, "countersGroups"); countersEtags = parent.storageEnvironment.CreateTree(transaction, "counters->etags"); etagsCounters = parent.storageEnvironment.CreateTree(transaction, "etags->counters"); metadata = parent.storageEnvironment.CreateTree(transaction, "$metadata"); }
public Writer(CounterStorage parent, StorageEnvironment storageEnvironment) { this.parent = parent; transaction = storageEnvironment.NewTransaction(TransactionFlags.ReadWrite); reader = new Reader(parent, transaction); serverNamesToIds = parent.storageEnvironment.CreateTree(transaction, "serverNames->Ids"); serverIdsToNames = parent.storageEnvironment.CreateTree(transaction, "Ids->serverNames"); serversLastEtag = parent.storageEnvironment.CreateTree(transaction, "servers->lastEtag"); counters = parent.storageEnvironment.CreateTree(transaction, "counters"); countersGroups = parent.storageEnvironment.CreateTree(transaction, "countersGroups"); etagsCountersIx = parent.storageEnvironment.CreateTree(transaction, "etags->counters"); countersEtagIx = parent.storageEnvironment.CreateTree(transaction, "counters->etags"); metadata = parent.storageEnvironment.CreateTree(transaction, "$metadata"); storeBuffer = new byte[sizeof(long) + //positive sizeof(long)]; // negative storeBufferLength = storeBuffer.Length; }
public Reader(CounterStorage parent, StorageEnvironment storageEnvironment) : this(parent, storageEnvironment.NewTransaction(TransactionFlags.Read)) { }
public Writer(CounterStorage parent, StorageEnvironment storageEnvironment) { this.parent = parent; transaction = storageEnvironment.NewTransaction(TransactionFlags.ReadWrite); reader = new Reader(parent, transaction); serverNamesToIds = transaction.State.GetTree(transaction, "serverNames->Ids"); serverIdsToNames = transaction.State.GetTree(transaction, "Ids->serverNames"); serversLastEtag = transaction.State.GetTree(transaction, "servers->lastEtag"); counters = transaction.State.GetTree(transaction, "counters"); countersGroups = transaction.State.GetTree(transaction, "countersGroups"); etagsCountersIx = transaction.State.GetTree(transaction, "etags->counters"); countersEtagIx = transaction.State.GetTree(transaction, "counters->etags"); metadata = transaction.State.GetTree(transaction, "$metadata"); storeBuffer = new byte[sizeof(long) + //positive sizeof(long)]; // negative storeBufferLength = storeBuffer.Length; }
public Reader(CounterStorage parent, Transaction t) { this.parent = parent; transaction = t; serverNamesToIds = transaction.State.GetTree(transaction, "serverNames->Ids"); serverIdsToNames = transaction.State.GetTree(transaction, "Ids->serverNames"); serversLastEtag = transaction.State.GetTree(transaction, "servers->lastEtag"); counters = transaction.State.GetTree(transaction, "counters"); countersGroups = transaction.State.GetTree(transaction, "countersGroups"); countersEtags = transaction.State.GetTree(transaction, "counters->etags"); etagsCounters = transaction.State.GetTree(transaction, "etags->counters"); metadata = transaction.State.GetTree(transaction, "$metadata"); }