public JournalSettings(Config config)
 {
     if (config == null) throw new ArgumentNullException("config", "Table Storage journal settings cannot be initialized, because required HOCON section couldn't be found");
     TableName = config.GetString("table-name");
     ConnectionStrings = config.GetStringList("connection-strings");
     _settings = new AzureStorageSettings(ConnectionStrings);
 }
Esempio n. 2
0
 public JournalSettings(Config config)
 {
     if (config == null)
     {
         throw new ArgumentNullException("config", "Table Storage journal settings cannot be initialized, because required HOCON section couldn't be found");
     }
     TableName         = config.GetString("table-name");
     ConnectionStrings = config.GetStringList("connection-strings");
     _settings         = new AzureStorageSettings(ConnectionStrings);
 }
Esempio n. 3
0
 public BlobSnapshotStoreSettings(Config config)
 {
     if (config == null)
     {
         throw new ArgumentNullException("config", "Azure Blob Storage snapshot store settings cannot be initialized, because required HOCON section couldn't be found");
     }
     ContainerName     = config.GetString("container-name");
     ConnectionStrings = config.GetStringList("connection-strings");
     _settings         = new AzureStorageSettings(ConnectionStrings);
 }
        public static void Clean(string tableName, IList<string> connectionStrings)
        {
            AzureStorageSettings settings =
                new AzureStorageSettings(connectionStrings);
            foreach (CloudStorageAccount conn in settings.GetStorageAccounts())
            {
                CloudTableClient tableClient = conn.CreateCloudTableClient();
                CloudTable table = tableClient.GetTableReference(tableName);
                TableQuery<DynamicTableEntity> query =
                        new TableQuery<DynamicTableEntity>();
                IEnumerable<DynamicTableEntity> results = table.ExecuteQuery(query);
                if (results.Count() > 0)
                {
                    TableBatchOperation batchOperation = new TableBatchOperation();
                    foreach (DynamicTableEntity s in results)
                    {
                        batchOperation.Delete(s);
                    }
                    table.ExecuteBatch(batchOperation);
                }

            }
        }
 public BlobSnapshotStoreSettings(Config config)
 {
     if (config == null) throw new ArgumentNullException("config", "Azure Blob Storage snapshot store settings cannot be initialized, because required HOCON section couldn't be found");
     ContainerName = config.GetString("container-name");
     ConnectionStrings = config.GetStringList("connection-strings");
     _settings = new AzureStorageSettings(ConnectionStrings);
 }