C# Class DataMigration.SqlPhaseLogger

The SqlPhaseLogger class performs phase logging on behalf of the C# code. It writes to a table, specified in the PhaseLoggerDescriptor in the Plan.
Inheritance: IPhaseLogger
ファイルを表示 Open project: scoutmedia/DataMigration

Public Methods

Method Description
GetLoadEntries ( int loadNumber ) : IOrderedEnumerable

Returns the collected entries for an entire load. We throw away the ones with null loadnumbers, because we can't order them, and because they're not very interesting anyway, for this purpose. Then we order by logsource, and then phase number, which gives an approximate logical order.

Log ( PhaseLogEntry entry ) : void

Logs the StageLogEntry to the implementation-specific persistence mechanism. In this implementation, it logs to a Sql Table (DataMigrationPhaseLog) in the cpms database in Sql Server.

Private Methods

Method Description
AttemptToLoadTheEntriesStoresInSql ( int loadNumber ) : void

Calls into Sql to get the actual list of Phase Log Entries. The cached set that we have is just an in-memory backup strategy, in case this fails. It only has the phase log entries that were done from the C#, not the ones done by T-SQL based Post-Processing stages. If this function is successful, it replaces the cached list of entries, so the entries can be more complete.

GetNullableNumericField ( IDataReader reader, string fieldName ) : int

Retrieves a nullable numeric field from an IDataReader.

Method Details

GetLoadEntries() public method

Returns the collected entries for an entire load. We throw away the ones with null loadnumbers, because we can't order them, and because they're not very interesting anyway, for this purpose. Then we order by logsource, and then phase number, which gives an approximate logical order.
public GetLoadEntries ( int loadNumber ) : IOrderedEnumerable
loadNumber int The load number.
return IOrderedEnumerable

Log() public method

Logs the StageLogEntry to the implementation-specific persistence mechanism. In this implementation, it logs to a Sql Table (DataMigrationPhaseLog) in the cpms database in Sql Server.
public Log ( PhaseLogEntry entry ) : void
entry PhaseLogEntry A StageLogEntry with all the information needed to produce /// a useful stage log entry.
return void