Ejemplo n.º 1
0
 public static void Remove(this Dictionary <string, Dictionary <string, SyncDeletePartition> > dictionary,
                           SyncDeletePartition taskToDelete)
 {
     dictionary[taskToDelete.TableName].Remove(taskToDelete.PartitionKey);
     if (dictionary[taskToDelete.TableName].Count == 0)
     {
         dictionary.Remove(taskToDelete.TableName);
     }
 }
Ejemplo n.º 2
0
        public void SynchronizeDeletePartition(string tableName, string partitionKey, DataSynchronizationPeriod period)
        {
            lock (_lockObject)
            {
                if (CheckIfWeHaveSyncTableTaskEarlier(tableName, period))
                {
                    return;
                }

                if (!_deletePartitions.ContainsKey(tableName))
                {
                    _deletePartitions.Add(tableName, new Dictionary <string, SyncDeletePartition>());
                }

                var dict = _deletePartitions[tableName];

                if (!dict.ContainsKey(partitionKey))
                {
                    dict.Add(partitionKey, SyncDeletePartition.Create(tableName, partitionKey, period));
                }
            }
        }