예제 #1
0
 public TrainBag(ushort trainId,
                 IBucketFactory bucketFactory,
                 IMetaStorage metaStorage,
                 BagSettings bagSettings)
 {
     TrainId            = trainId;
     this.bucketFactory = bucketFactory;
     this.metaStorage   = metaStorage;
     this.bagSettings   = bagSettings;
 }
예제 #2
0
파일: Bag.cs 프로젝트: arkhivania/LogsML
 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");
     }
 }
예제 #3
0
파일: Server.cs 프로젝트: arkhivania/LogsML
        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);
        }
예제 #4
0
 /// <summary>
 ///     Creates a new Instance of RestClient.
 /// </summary>
 /// <param name="token">The Token of the Bot.</param>
 /// <param name="factory">Factory which creates IBucket to use</param>
 public RestClient(string token, IBucketFactory factory) : this(token)
     => BucketFactory = factory;