public async Task<string> Load()
 {
     Tuple<EventHubPartitionCheckpointEntity, string> results =
         await dataManager.ReadSingleTableEntryAsync(entity.PartitionKey, entity.RowKey);
     if (results != null)
     {
         entity = results.Item1;
     }
     return entity.Offset;
 }
Beispiel #2
0
        /// <summary>
        /// Loads a checkpoint
        /// </summary>
        /// <returns></returns>
        public async Task <string> Load()
        {
            var results = await dataManager.ReadSingleTableEntryAsync(entity.PartitionKey, entity.RowKey);

            if (results.Entity != null)
            {
                entity = results.Entity;
            }

            return(entity.Offset);
        }
 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);
 }
 private EventHubPartitionCheckpoint(ICheckpointSettings settings, string streamProviderName, string partition)
 {
     if (settings == null)
     {
         throw new ArgumentNullException("settings");
     }
     if (string.IsNullOrWhiteSpace(streamProviderName))
     {
         throw new ArgumentNullException("streamProviderName");
     }
     if (string.IsNullOrWhiteSpace(partition))
     {
         throw new ArgumentNullException("partition");
     }
     persistInterval = settings.PersistInterval;
     dataManager = new AzureTableDataManager<EventHubPartitionCheckpointEntity>(settings.TableName, settings.DataConnectionString);
     entity = EventHubPartitionCheckpointEntity.Create(streamProviderName, settings.CheckpointNamespace, partition);
 }