Exemplo n.º 1
0
 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");
 }
Exemplo n.º 2
0
            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;
            }
Exemplo n.º 3
0
 public Reader(CounterStorage parent, StorageEnvironment storageEnvironment)
     : this(parent, storageEnvironment.NewTransaction(TransactionFlags.Read))
 {
 }
Exemplo n.º 4
0
			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;
			}
Exemplo n.º 5
0
            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");
            }
Exemplo n.º 6
0
 public Reader(CounterStorage parent, StorageEnvironment storageEnvironment)
     : this(parent, storageEnvironment.NewTransaction(TransactionFlags.Read)) { }