Class DifferenceLogger
Object
gudusoft.gsqlparser.sqlenv.catalog.DifferenceLogger
差异日志(记录新旧实现的差异)
用于 Phase 1-2 期间验证新实现的正确性。
- Since:
- 3.2.0 (Phase 1)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription生成统计报告doublegetNewPutErrorRate(long totalOperations) 获取新实现的错误率doublegetSearchDifferenceRate(long totalSearches) 获取搜索差异率获取统计信息boolean检查是否有严重错误(用于测试)voidlogLegacyPutError(TSQLSchemaObject object, Throwable e) 记录旧实现的 put 错误voidlogNewPutError(TSQLSchemaObject object, Throwable e) 记录新实现的 put 错误voidlogNewSearchError(String catalog, String schema, String objectName, ESQLDataObjectType type, Throwable e) 记录新实现的 search 错误voidlogSearchDifference(String catalog, String schema, String objectName, ESQLDataObjectType type, TSQLSchemaObject legacyResult, TSQLSchemaObject newResult) 记录搜索结果差异voidlogSearchMiss(String catalog, String schema, String objectName, ESQLDataObjectType type) 记录搜索 miss(新实现未找到对象)voidreset()重置统计
-
Constructor Details
-
DifferenceLogger
public DifferenceLogger()
-
-
Method Details
-
logLegacyPutError
记录旧实现的 put 错误- Parameters:
object- the schema objecte- the exception
-
logNewPutError
记录新实现的 put 错误- Parameters:
object- the schema objecte- the exception
-
logSearchDifference
public void logSearchDifference(String catalog, String schema, String objectName, ESQLDataObjectType type, TSQLSchemaObject legacyResult, TSQLSchemaObject newResult) 记录搜索结果差异- Parameters:
catalog- catalog nameschema- schema nameobjectName- object nametype- object typelegacyResult- legacy implementation resultnewResult- new implementation result
-
logSearchMiss
public void logSearchMiss(String catalog, String schema, String objectName, ESQLDataObjectType type) 记录搜索 miss(新实现未找到对象)- Parameters:
catalog- catalog nameschema- schema nameobjectName- object nametype- object type
-
logNewSearchError
public void logNewSearchError(String catalog, String schema, String objectName, ESQLDataObjectType type, Throwable e) 记录新实现的 search 错误- Parameters:
catalog- catalog nameschema- schema nameobjectName- object nametype- object typee- the exception
-
getStatistics
获取统计信息- Returns:
- statistics map
-
reset
重置统计 -
generateReport
生成统计报告- Returns:
- statistics report string
-
hasSeriousErrors
检查是否有严重错误(用于测试)- Returns:
- true if there are serious errors
-
getNewPutErrorRate
获取新实现的错误率- Parameters:
totalOperations- total number of operations- Returns:
- error rate (0.0 to 1.0)
-
getSearchDifferenceRate
获取搜索差异率- Parameters:
totalSearches- total number of searches- Returns:
- difference rate (0.0 to 1.0)
-