Exemplo n.º 1
0
 private MembershipTableData Convert(List<Tuple<SiloInstanceTableEntry, string>> entries)
 {
     try
     {
         var memEntries = new List<Tuple<MembershipEntry, string>>();
         TableVersion tableVersion = null;
         foreach (var tuple in entries)
         {
             var tableEntry = tuple.Item1;
             if (tableEntry.RowKey.Equals(SiloInstanceTableEntry.TABLE_VERSION_ROW))
             {
                 tableVersion = new TableVersion(Int32.Parse(tableEntry.MembershipVersion), tuple.Item2);
             }
             else
             {
                 try
                 {
                     
                     MembershipEntry membershipEntry = Parse(tableEntry);
                     memEntries.Add(new Tuple<MembershipEntry, string>(membershipEntry, tuple.Item2));
                 }
                 catch (Exception exc)
                 {
                     logger.Error(ErrorCode.AzureTable_61, String.Format(
                         "Intermediate error parsing SiloInstanceTableEntry to MembershipTableData: {0}. Ignoring this entry.",
                         tableEntry), exc);
                 }
             }
         }
         var data = new MembershipTableData(memEntries, tableVersion);
         return data;
     }
     catch (Exception exc)
     {
         logger.Error(ErrorCode.AzureTable_60, String.Format(
             "Intermediate error parsing SiloInstanceTableEntry to MembershipTableData: {0}.", 
             Utils.EnumerableToString(entries, tuple => tuple.Item1.ToString())), exc);
         throw;
     }
 }
Exemplo n.º 2
0
        private MembershipTableData Convert(List<SiloInstanceRecord> entries)
        {
            try
            {
                var memEntries = new List<Tuple<MembershipEntry, string>>();

                foreach (var tableEntry in entries)
                {
                    try
                    {
                        MembershipEntry membershipEntry = Parse(tableEntry);
                        memEntries.Add(new Tuple<MembershipEntry, string>(membershipEntry, tableEntry.ETag.ToString()));
                    }
                    catch (Exception exc)
                    {
                        logger.Error(ErrorCode.MembershipBase,
                            $"Intermediate error parsing SiloInstanceTableEntry to MembershipTableData: {tableEntry}. Ignoring this entry.", exc);
                    }
                }
                var data = new MembershipTableData(memEntries, _tableVersion);
                return data;
            }
            catch (Exception exc)
            {
                logger.Error(ErrorCode.AzureTable_60,
                    $"Intermediate error parsing SiloInstanceTableEntry to MembershipTableData: {Utils.EnumerableToString(entries, e => e.ToString())}.", exc);
                throw;
            }
        }