Example #1
0
 public DataExportRequest(DateTimeOffset requestTime, DateTimeOffset beginTimeUtc, DateTimeOffset endTimeUtc, string uri, int seriesId, string servUrl)
     : base(DataExportRequest.GeneratePartitionKeyFromSeriesMetadata(seriesId), requestTime.ToDateTimeDescending())
 {
     this.RequestTime = requestTime; this.BeginTimeUtc = beginTimeUtc; this.EndTimeUtc = endTimeUtc; this.Uri = uri; this.ServUrl = servUrl;
 }
Example #2
0
 /// <summary>
 /// Gets a record of a particular series request if one exists in the WDC storage cache already (persists all already-downloaded files).
 /// </summary>
 /// <param name="csa"></param>
 /// <param name="seriesId"></param>
 /// <param name="startDate"></param>
 /// <param name="endDate"></param>
 /// <param name="requestTime"></param>
 /// <returns></returns>
 public async Task<DataExportRequest> CheckIfSeriesExistsInStorage(CloudStorageAccount csa, int seriesId, DateTimeOffset requestTime)
 {
     CloudTableClient tableClient = csa.CreateCloudTableClient();
     CloudTable tbl = tableClient.GetTableReference(DiscoveryStorageTableNames.SeriesDownloads);
     string pk = DataExportRequest.GeneratePartitionKeyFromSeriesMetadata(seriesId);
     string rk = requestTime.ToDateTimeDescending();
                 
     TableQuery<DataExportRequest> qry = new TableQuery<DataExportRequest>().Where(TableQuery.GenerateFilterCondition("PartitionKey", QueryComparisons.Equal, seriesId.ToString()));
     TableQuerySegment<DataExportRequest> result = await tbl.ExecuteQuerySegmentedAsync(qry, null);
     return result.Results.FirstOrDefault();
 }