Пример #1
0
        internal async Task <Tuple <GossipTableEntry, Dictionary <SiloAddress, GossipTableEntry> > > ReadAllEntriesAsync()
        {
            var queryResults = await storage.ReadAllTableEntriesForPartitionAsync(this.GlobalServiceId).ConfigureAwait(false);

            // organize the returned storage entries by what they represent
            GossipTableEntry configInStorage = null;
            var gatewayInfoInStorage         = new Dictionary <SiloAddress, GossipTableEntry>();

            foreach (var x in queryResults)
            {
                var tableEntry = x.Item1;

                if (tableEntry.RowKey.Equals(GossipTableEntry.CONFIGURATION_ROW))
                {
                    configInStorage = tableEntry;
                }
                else
                {
                    try
                    {
                        tableEntry.ParseSiloAddressFromRowKey();
                        gatewayInfoInStorage.Add(tableEntry.SiloAddress, tableEntry);
                    }
                    catch (Exception exc)
                    {
                        logger.Error(
                            (int)TableStorageErrorCode.AzureTable_61,
                            string.Format("Intermediate error parsing GossipTableEntry: {0}. Ignoring this entry.", tableEntry),
                            exc);
                    }
                }
            }

            return(new Tuple <GossipTableEntry, Dictionary <SiloAddress, GossipTableEntry> >(configInStorage, gatewayInfoInStorage));
        }
Пример #2
0
        public static async Task <int> GetDeliveryFailureCount(string streamProviderName)
        {
            var dataManager = new AzureTableDataManager <TableEntity>(TableName, TestDefaultConfiguration.DataConnectionString);

            dataManager.InitTableAsync().Wait();
            IEnumerable <Tuple <TableEntity, string> > deliveryErrors =
                await
                dataManager.ReadAllTableEntriesForPartitionAsync(
                    StreamDeliveryFailureEntity.MakeDefaultPartitionKey(streamProviderName, DeploymentId));

            return(deliveryErrors.Count());
        }
Пример #3
0
        public static async Task <int> GetDeliveryFailureCount(string streamProviderName, ILoggerFactory loggerFactory)
        {
            var dataManager = new AzureTableDataManager <TableEntity>(
                new AzureStorageOperationOptions {
                TableName = TableName
            }.ConfigureTestDefaults(),
                loggerFactory.CreateLogger <AzureTableDataManager <TableEntity> >());
            await dataManager.InitTableAsync();

            IEnumerable <Tuple <TableEntity, string> > deliveryErrors =
                await
                dataManager.ReadAllTableEntriesForPartitionAsync(
                    StreamDeliveryFailureEntity.MakeDefaultPartitionKey(streamProviderName, DeploymentId));

            return(deliveryErrors.Count());
        }