Beispiel #1
0
 private EventHubCheckpointer(AzureTableStreamCheckpointerOptions options, string streamProviderName, string partition, string serviceId, ILoggerFactory loggerFactory)
 {
     if (options == null)
     {
         throw new ArgumentNullException(nameof(options));
     }
     if (string.IsNullOrWhiteSpace(streamProviderName))
     {
         throw new ArgumentNullException(nameof(streamProviderName));
     }
     if (string.IsNullOrWhiteSpace(partition))
     {
         throw new ArgumentNullException(nameof(partition));
     }
     this.logger = loggerFactory.CreateLogger <EventHubCheckpointer>();
     this.logger.LogInformation(
         "Creating EventHub checkpointer for partition {Partition} of stream provider {StreamProviderName} with serviceId {ServiceId}.",
         partition,
         streamProviderName,
         serviceId);
     persistInterval = options.PersistInterval;
     dataManager     = new AzureTableDataManager <EventHubPartitionCheckpointEntity>(
         options,
         loggerFactory.CreateLogger <EventHubPartitionCheckpointEntity>());
     entity = EventHubPartitionCheckpointEntity.Create(streamProviderName, serviceId, partition);
 }
 private EventHubCheckpointer(ICheckpointerSettings settings, string streamProviderName, string partition, ILoggerFactory loggerFactory)
 {
     if (settings == null)
     {
         throw new ArgumentNullException(nameof(settings));
     }
     if (string.IsNullOrWhiteSpace(streamProviderName))
     {
         throw new ArgumentNullException(nameof(streamProviderName));
     }
     if (string.IsNullOrWhiteSpace(partition))
     {
         throw new ArgumentNullException(nameof(partition));
     }
     persistInterval = settings.PersistInterval;
     dataManager     = new AzureTableDataManager <EventHubPartitionCheckpointEntity>(settings.TableName, settings.DataConnectionString, loggerFactory);
     entity          = EventHubPartitionCheckpointEntity.Create(streamProviderName, settings.CheckpointNamespace, partition);
 }