static void Main(string[] args) { var parser = new Parser(); parser.ReadFile(); parser.ParseFile(); using (var context = new SerratusSummaryContext()) { context.CommentLines.Add(parser.CommentLine); context.SaveChanges(); } }
public CommentLinesController(SerratusSummaryContext context, ISerratusSummaryService serratusSummaryService) { _context = context; _serratusSummaryService = serratusSummaryService; }
public SerratusSummaryService(SerratusSummaryContext serratusSummaryContext) { _serratusSummaryContext = serratusSummaryContext; }
public RunsController(SerratusSummaryContext context) { _context = context; }
public async Task GetDataFromBucketList() { ReadFile(); Console.WriteLine($"get data from bucket started"); AmazonS3Config config = new AmazonS3Config(); AmazonS3Client s3Client = new AmazonS3Client( _accessKey, _secretKey, config ); var oneFile = Stopwatch.StartNew(); var tasks = new List <Task>(); foreach (string fileName in SummaryFiles) { var request = new GetObjectRequest { BucketName = "lovelywater", Key = $"{fileName}" }; string responseBody = ""; var s3Stopwatch = Stopwatch.StartNew(); try { Console.WriteLine("test"); var result = await s3Client.GetObjectAsync(request); using (var stream = result.ResponseStream) using (var reader = new StreamReader(stream)) { Console.WriteLine($"file read"); var readerStopwatch = Stopwatch.StartNew(); responseBody = await reader.ReadToEndAsync(); //Console.WriteLine($"{readerStopwatch.ElapsedMilliseconds}"); var task = Task.Run(async() => { using (var context = new SerratusSummaryContext()) { var parserStopwatch = Stopwatch.StartNew(); var lines = responseBody.Split('\n'); var unparsedFile = ReadFile(lines); var finishedFile = ParseFile(fileName, unparsedFile); Console.WriteLine($"file parsed"); //Console.WriteLine($"{parserStopwatch.ElapsedMilliseconds}"); var dbStopwatch = Stopwatch.StartNew(); context.ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.NoTracking; context.Runs.Add(finishedFile.Run); await context.SaveChangesAsync(); Console.WriteLine($"file saved in db"); //Console.WriteLine($"{dbStopwatch.ElapsedMilliseconds}"); } }); tasks.Add(task); } } catch { continue; } if (tasks.Count == 100) { await Task.WhenAll(tasks); Console.WriteLine("tasks done!"); } //Console.WriteLine($"{s3Stopwatch.ElapsedMilliseconds}"); } Console.WriteLine("PARSER COMPLETE"); //if (moreKeys == true) //{ // Console.WriteLine("getting more buckets"); // GetBucketsFromS3(); //} //else //{ // return; //} }
public AccessionSectionsController(SerratusSummaryContext context, ISerratusSummaryService serratusSummaryService) { _context = context; _serratusSummaryService = serratusSummaryService; }
public FastaSectionsController(SerratusSummaryContext context) { _context = context; }