private static void CreateHistoryTables( string connectionString, int commandTimeoutSecs, int maxDegreeOfParallelism, Pipelines pipelineOptions) { var hs = new HistorySchema(connectionString, commandTimeoutSecs, maxDegreeOfParallelism, pipelineOptions); hs.CreateTables(); }
private string RestrictedStatusValuesAsCsv() { var sb = new StringBuilder(); foreach (var v in _restrictToValues) { if (sb.Length > 0) { sb.Append(","); } sb.AppendFormat("'{0}'", HistorySchema.HistoryStatusToString(v)); } return(sb.ToString()); }
/// <summary> /// Performs a 'full-data' diff between Primary and Secondary stages and updates the /// history tables accordingly /// </summary> public void UpdateHistory() { try { OnProgressEvent(new VertoProgressEventArgs { ProgressString = "Updating history schema", Section = ProcessingSection.UpdatingHistory }); long logId = Log("Updating History", "Updating history schema"); _log.DebugFormat( "Updating history tables in Admin database: {0}", DatabaseUtils.GetConnectionDescription(AdminConnectionString)); var hs = new HistorySchema( AdminConnectionString, Timeouts.AdminDatabase, _configuration.MaxDegreeOfParallelism, _configuration.Pipelines); var pkInfo = DatabaseUtils.GetPrimaryKeyInfo(TimetableConnectionStrings.First(), Timeouts.SourceTimetables); AddPrimaryKeyInfoForPseudoRegisterMarkTable(pkInfo); var duration = hs.PerformDiff(pkInfo, logId); var msg = $"Updated history in {duration.TotalSeconds:F2} secs"; Log("Updated", msg); } catch (AggregateException ex) { LogError(ex.InnerExceptions[0].Message); throw ex.InnerExceptions[0]; } catch (Exception ex) { LogError(ex.Message); throw; } }