Ejemplo n.º 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);
        }
Ejemplo n.º 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;
     }
 }
Ejemplo n.º 3
0
 public IEnumerable <AnalysisEntity> ListAnalyses()
 {
     return(_tableStorageProvider.ListEntities <AnalysisEntity>(AnalysisEntity.AllUsersPk));
 }
Ejemplo n.º 4
0
 private IReadOnlyList <DatabaseEntity> ListSystemDatabases()
 {
     return(_tableStorageProvider.ListEntities <DatabaseEntity>().ToList());
 }
Ejemplo n.º 5
0
        public IReadOnlyList <DatabaseEntity> ListDatabases()
        {
            var databaseEntities = _tableStorageProvider.ListEntities <DatabaseEntity>();

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