Example #1
0
 public Partitions(IPartitionKeyGenerator partitionKeyGenerator, IStringHasher <THashOutput> hasher, IPartitioner <THashOutput> partitioner, int partitionCount)
 {
     _partitionCount        = partitionCount;
     _partitionKeyGenerator = partitionKeyGenerator;
     _partitions            = new Partition[_partitionCount];
     _partitioner           = partitioner;
     _hasher = hasher;
 }
Example #2
0
 public SessionClient(ISessionIdGenerator sessionIdGenerator, IPartitionKeyGenerator partitionKeyGenerator, IHttpContextAccessor httpContextAccessor, SessionConfig sessionConfig, ILogger <SessionClient> logger)
 {
     this.sessionIdGenerator    = sessionIdGenerator;
     this.partitionKeyGenerator = partitionKeyGenerator;
     this.httpContextAccessor   = httpContextAccessor;
     this.sessionConfig         = sessionConfig;
     this.logger = logger;
 }
 public EventHubEventProcessor(
     IPartitionKeyGenerator generator,
     ISettings settings,
     IBatchSender batchSender,
     IJsonConverter jsonConverter)
 {
     this.MaxBatchSize  = 1024 * settings.GetInt32("MaxBatchSizeKB", 192);
     this.keyGenerator  = generator;
     this.batchSender   = batchSender;
     this.jsonConverter = jsonConverter;
     this.currentBatch  = Batch <EventData> .Empty(MaxBatchSize);
 }
 public EventHubEventProcessor(
     IPartitionKeyGenerator generator,
     ISettings settings,
     IBatchSender batchSender,
     IJsonConverter jsonConverter)
 {
     this.MaxBatchSize = 1024 * settings.GetInt32("MaxBatchSizeKB", 192);
       this.keyGenerator = generator;
       this.batchSender = batchSender;
       this.jsonConverter = jsonConverter;
       this.currentBatch = Batch<EventData>.Empty(MaxBatchSize);
 }
        public SessionClientTests()
        {
            this.partitionKeyGenerator      = A.Fake <IPartitionKeyGenerator>();
            this.sessionIdGenerator         = A.Fake <ISessionIdGenerator>();
            this.httpContextAccessor        = A.Fake <IHttpContextAccessor>();
            httpContextAccessor.HttpContext = new DefaultHttpContext();

            this.config = new SessionConfig
            {
                ApplicationName = "UnitTestAppName",
                Salt            = "TestSalt",
            };
            this.logger = A.Fake <ILogger <SessionClient> >();

            this.sessionClient = new SessionClient(sessionIdGenerator, partitionKeyGenerator, httpContextAccessor, config, logger);
        }
 public void AddPartitionKeyGenerator(IPartitionKeyGenerator partitionKeyGenerator)
 {
     _partitionKeyGenerators.Add(partitionKeyGenerator);
 }
Example #7
0
 public RequestRepository(IRepository <RequestEntity> repository,
                          IPartitionKeyGenerator partitionKeyGenerator)
 {
     _repository            = repository;
     _partitionKeyGenerator = partitionKeyGenerator;
 }