コード例 #1
0
        public async Task <bool> RemoveRow(GrainReference grainRef, string reminderName, string eTag)
        {
            var entry = new ReminderTableEntry
            {
                PartitionKey = ReminderTableEntry.ConstructPartitionKey(remTableManager.ServiceId, grainRef),
                RowKey       = ReminderTableEntry.ConstructRowKey(grainRef, reminderName),
                ETag         = eTag,
            };

            try
            {
                if (logger.IsEnabled(LogLevel.Trace))
                {
                    logger.Trace("RemoveRow entry = {0}", entry.ToString());
                }

                bool result = await remTableManager.DeleteReminderEntryConditionally(entry, eTag);

                if (result == false)
                {
                    logger.Warn((int)AzureUtils.Utilities.ErrorCode.AzureTable_43,
                                $"Delete failed on the reminder table. Will retry. Entry = {entry}");
                }
                return(result);
            }
            catch (Exception exc)
            {
                logger.Warn((int)AzureUtils.Utilities.ErrorCode.AzureTable_44,
                            $"Intermediate error when deleting reminder entry {entry} to the table {remTableManager.TableName}.", exc);
                throw;
            }
        }
コード例 #2
0
        public async Task <bool> RemoveRow(GrainReference grainRef, string reminderName, string eTag)
        {
            var entry = new ReminderTableEntry
            {
                PartitionKey = ReminderTableEntry.ConstructPartitionKey(remTableManager.ServiceId, grainRef),
                RowKey       = ReminderTableEntry.ConstructRowKey(grainRef, reminderName),
                ETag         = eTag,
            };

            try
            {
                if (logger.IsVerbose2)
                {
                    logger.Verbose2("RemoveRow entry = {0}", entry.ToString());
                }

                bool result = await remTableManager.DeleteReminderEntryConditionally(entry, eTag);

                if (result == false)
                {
                    logger.Warn(ErrorCode.AzureTable_43, String.Format("Delete failed on the reminder table. Will retry. Entry = {0}", entry));
                }
                return(result);
            }
            catch (Exception exc)
            {
                logger.Warn(ErrorCode.AzureTable_44, String.Format("Intermediate error when deleting reminder entry {0} to the table {1}.",
                                                                   entry, remTableManager.TableName), exc);
                throw;
            }
        }