JackieTien97 opened a new pull request, #17749: URL: https://github.com/apache/iotdb/pull/17749
This pull request enhances error handling and internationalization for schema fetching and data region operations in the IoTDB DataNode module. The main improvements are the addition of more descriptive and localized error messages, better exception handling for missing query executions and timeouts, and clearer logging for data region issues. **Error handling and messaging improvements:** * Added new error messages for query timeouts and missing query executions during schema fetching, with support for both English and Chinese localizations in `DataNodeQueryMessages` (`en/org/apache/iotdb/db/i18n/DataNodeQueryMessages.java`, `zh/org/apache/iotdb/db/i18n/DataNodeQueryMessages.java`) [[1]](diffhunk://#diff-61b3507ac9a80934d7ecfffe5151a8b0dffacdd2c9cc2ad7f230995fd845a5b0R1425-R1429) [[2]](diffhunk://#diff-90a2ab34c2a35627d94fea1b116e736e1751d1d67f215886940235c3bf471382R1424-R1429). * Improved error messages for missing or null data regions in `StorageEngineMessages`, also localized in both English and Chinese (`en/org/apache/iotdb/db/i18n/StorageEngineMessages.java`, `zh/org/apache/iotdb/db/i18n/StorageEngineMessages.java`) [[1]](diffhunk://#diff-cc31e94fc32f5c8f4be845445dfe22aff8866cd93747d7bc7bef80ee327a7709R514-R517) [[2]](diffhunk://#diff-0805be6595b7c16da2972bf75962449791a18ae61b59e3447a31b86dc3f4faedR514-R517). **Exception handling and logging enhancements:** * Updated `TableDeviceSchemaFetcher` and `ClusterSchemaFetchExecutor` to throw `IoTDBRuntimeException` with localized messages when query executions are missing, and to throw a specific `QueryTimeoutException` when a schema fetch times out (`TableDeviceSchemaFetcher.java`, `ClusterSchemaFetchExecutor.java`) [[1]](diffhunk://#diff-8666a9ce3ad0556e8bdcceaaa24895874f904e6211cdccd26225c6c2aa0d0ac8R153-R165) [[2]](diffhunk://#diff-8666a9ce3ad0556e8bdcceaaa24895874f904e6211cdccd26225c6c2aa0d0ac8R194-R200) [[3]](diffhunk://#diff-8666a9ce3ad0556e8bdcceaaa24895874f904e6211cdccd26225c6c2aa0d0ac8R507-R511) [[4]](diffhunk://#diff-8666a9ce3ad0556e8bdcceaaa24895874f904e6211cdccd26225c6c2aa0d0ac8L504-R545) [[5]](diffhunk://#diff-8666a9ce3ad0556e8bdcceaaa24895874f904e6211cdccd26225c6c2aa0d0ac8R570-R579) [[6]](diffhunk://#diff-0a3a6c9f42ab5060602d3fd721136a859d83a024d7f5de5d1dbb114e90bfe785L297-R302). * Refactored `QueryTimeoutRuntimeException` to extend `IoTDBRuntimeException` and include a status code, improving consistency in exception handling (`QueryTimeoutRuntimeException.java`). **Codebase robustness and maintainability:** * Added null checks and error logging for data region retrieval in `DataRegionConsensusImpl` and `DataRegionStateMachine`, ensuring that missing or null regions are handled gracefully and with clear error messages (`DataRegionConsensusImpl.java`, `DataRegionStateMachine.java`) [[1]](diffhunk://#diff-3c23802b8067e5d5eabe910e2dedca920e8ea64e5244e2ad2205bcb993691588R121-R125) [[2]](diffhunk://#diff-8c557d27a49100d41e3cf7e7ce434c88cbbe5cafc7dcdb9c0f4f047d08992584R252-R255). * Introduced new logger instances where needed and improved imports for better code clarity and maintainability (`DataRegionConsensusImpl.java`, `TableDeviceSchemaFetcher.java`) [[1]](diffhunk://#diff-3c23802b8067e5d5eabe910e2dedca920e8ea64e5244e2ad2205bcb993691588R46) [[2]](diffhunk://#diff-3c23802b8067e5d5eabe910e2dedca920e8ea64e5244e2ad2205bcb993691588R55-R56) [[3]](diffhunk://#diff-3c23802b8067e5d5eabe910e2dedca920e8ea64e5244e2ad2205bcb993691588R66-R67) [[4]](diffhunk://#diff-8666a9ce3ad0556e8bdcceaaa24895874f904e6211cdccd26225c6c2aa0d0ac8R24) [[5]](diffhunk://#diff-8666a9ce3ad0556e8bdcceaaa24895874f904e6211cdccd26225c6c2aa0d0ac8R34-R41) [[6]](diffhunk://#diff-8666a9ce3ad0556e8bdcceaaa24895874f904e6211cdccd26225c6c2aa0d0ac8R83-R84). These changes make error reporting more informative for both users and developers, improve localization support, and ensure that exceptional cases in schema fetching and data region operations are handled in a robust and maintainable way. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
