예제 #1
0
        public void DeleteSearch(Guid searchId)
        {
            var entity = _tableStorageProvider.GetEntity <SearchEntity>(SearchEntity.AllUsersPk, searchId.ToString());

            if (entity == null)
            {
                throw new Exception("No such search " + searchId);
            }

            if (entity.InputContainer != null)
            {
                _blobStorageProvider.DeleteContainer(entity.InputContainer);
            }

            if (entity.OutputContainer != null)
            {
                _blobStorageProvider.DeleteContainer(entity.OutputContainer);
            }

            if (entity.JobId != null)
            {
                try
                {
                    _batchClient.JobOperations.DeleteJob(entity.JobId);
                }
                catch (BatchException be)
                {
                    if (be.RequestInformation.HttpStatusCode != HttpStatusCode.NotFound)
                    {
                        throw;
                    }
                }
            }

            var queries = _tableStorageProvider.ListEntities <SearchQueryEntity>(entity.RowKey);

            if (queries != null)
            {
                Parallel.ForEach(queries, q =>
                {
                    _tableStorageProvider.DeleteEntity(q);
                });
            }

            _tableStorageProvider.DeleteEntity(entity);
        }
예제 #2
0
 private void LoadConfiguration()
 {
     try
     {
         var entities = _tableStorageProvider.ListEntities <ConfigurationEntity>();
         if (entities != null)
         {
             foreach (var configurationEntity in entities)
             {
                 _configuration[configurationEntity.Key] = configurationEntity.Value;
             }
         }
     }
     catch (Exception e)
     {
         Console.WriteLine("Failed to load config {0}", e);
         _configuration = _defaultConfiguration;
     }
 }
예제 #3
0
 public IEnumerable <AnalysisEntity> ListAnalyses()
 {
     return(_tableStorageProvider.ListEntities <AnalysisEntity>(AnalysisEntity.AllUsersPk));
 }
예제 #4
0
 private IReadOnlyList <DatabaseEntity> ListSystemDatabases()
 {
     return(_tableStorageProvider.ListEntities <DatabaseEntity>().ToList());
 }
예제 #5
0
        public IReadOnlyList <DatabaseEntity> ListDatabases()
        {
            var databaseEntities = _tableStorageProvider.ListEntities <DatabaseEntity>();

            return(databaseEntities.ToList());
        }
예제 #6
0
 public IEnumerable <SearchEntity> ListSearches()
 {
     return(_tableStorageProvider.ListEntities <SearchEntity>(SearchEntity.AllUsersPk));
 }
예제 #7
0
 public IEnumerable <ExternalRepository> ListRepositories()
 {
     return(_tableStorageProvider.ListEntities <ExternalRepository>(ExternalRepository.DefaultPk).Select(HydrateEntity));
 }