Class DifferenceLogger

Object
gudusoft.gsqlparser.sqlenv.catalog.DifferenceLogger

public class DifferenceLogger extends Object
差异日志(记录新旧实现的差异)

用于 Phase 1-2 期间验证新实现的正确性。

Since:
3.2.0 (Phase 1)
  • Constructor Details

  • Method Details

    • logLegacyPutError

      public void logLegacyPutError(TSQLSchemaObject object, Throwable e)
      记录旧实现的 put 错误
      Parameters:
      object - the schema object
      e - the exception
    • logNewPutError

      public void logNewPutError(TSQLSchemaObject object, Throwable e)
      记录新实现的 put 错误
      Parameters:
      object - the schema object
      e - the exception
    • logSearchDifference

      public void logSearchDifference(String catalog, String schema, String objectName, ESQLDataObjectType type, TSQLSchemaObject legacyResult, TSQLSchemaObject newResult)
      记录搜索结果差异
      Parameters:
      catalog - catalog name
      schema - schema name
      objectName - object name
      type - object type
      legacyResult - legacy implementation result
      newResult - new implementation result
    • logSearchMiss

      public void logSearchMiss(String catalog, String schema, String objectName, ESQLDataObjectType type)
      记录搜索 miss(新实现未找到对象)
      Parameters:
      catalog - catalog name
      schema - schema name
      objectName - object name
      type - object type
    • logNewSearchError

      public void logNewSearchError(String catalog, String schema, String objectName, ESQLDataObjectType type, Throwable e)
      记录新实现的 search 错误
      Parameters:
      catalog - catalog name
      schema - schema name
      objectName - object name
      type - object type
      e - the exception
    • getStatistics

      获取统计信息
      Returns:
      statistics map
    • reset

      public void reset()
      重置统计
    • generateReport

      生成统计报告
      Returns:
      statistics report string
    • hasSeriousErrors

      public boolean hasSeriousErrors()
      检查是否有严重错误(用于测试)
      Returns:
      true if there are serious errors
    • getNewPutErrorRate

      public double getNewPutErrorRate(long totalOperations)
      获取新实现的错误率
      Parameters:
      totalOperations - total number of operations
      Returns:
      error rate (0.0 to 1.0)
    • getSearchDifferenceRate

      public double getSearchDifferenceRate(long totalSearches)
      获取搜索差异率
      Parameters:
      totalSearches - total number of searches
      Returns:
      difference rate (0.0 to 1.0)