Exemple #1
0
 public TrainBag(ushort trainId,
                 IBucketFactory bucketFactory,
                 IMetaStorage metaStorage,
                 BagSettings bagSettings)
 {
     TrainId            = trainId;
     this.bucketFactory = bucketFactory;
     this.metaStorage   = metaStorage;
     this.bagSettings   = bagSettings;
 }
Exemple #2
0
 public Bag(ushort trainId, BagInfo bagInfo,
            IMetaStorage metaStorage,
            IBucketFactory bucketFactory)
 {
     this.trainId       = trainId;
     BagInfo            = bagInfo;
     this.metaStorage   = metaStorage;
     this.bucketFactory = bucketFactory;
     if (bagInfo.BagSettings.PerBucketMessages > (2 << 16))
     {
         throw new ArgumentException("PerBucketMessages must be < 2^16");
     }
 }
Exemple #3
0
        public Server(Settings settings,
                      IMetaStorage metaStorage,
                      IBucketFactory bucketFactory,
                      IIndexStore <long, ulong> piStore)
        {
            this.piStore = piStore;

            trainBags           = new LogBins.TrainBag[settings.TrainsCount];
            trainBagsSemaphores = new SemaphoreSlim[settings.TrainsCount];

            for (int i = 0; i < trainBags.Length; ++i)
            {
                trainBags[i] = new LogBins.TrainBag((ushort)(i + 1),
                                                    bucketFactory, metaStorage,
                                                    new LogBins.BagSettings
                {
                    PerBucketMessages = 8192
                });
                trainBagsSemaphores[i] = new SemaphoreSlim(1, 1);
            }

            piStore.Load(primaryIndex);
        }
Exemple #4
0
 public override void RegisterMetaStorages(IMetaStorageRegistrar registrar)
 {
     _groupStorage = registrar.AddMetaStorage(Feature, "groupinfo", 64, DiscStorageFlags.AppendOnly);
 }
Exemple #5
0
 public override void RegisterMetaStorages(IMetaStorageRegistrar registrar)
 {
     _transactionTargetsStorage = registrar.AddMetaStorage(Feature, "transactiontargets", 24, DiscStorageFlags.UnsortedDynamicIndex | DiscStorageFlags.AppendOnly);
 }