Till Westmann has posted comments on this change. Change subject: Unify runtime type exceptions by using error code and message template. ......................................................................
Patch Set 10: (3 comments) I agree that this is one (big) step in the exception handling story and that we need to have more steps. And I think that we should use this state as the basis for the discussion of the next steps. For this discussion, we should also have a document (either on the Wiki or on the website) to describe the motivation and the approach. A few thoughts: Right now we have 2 mechanisms to structure errors: exception classes and error codes. We should be clear on how and why we use these 2 mechanisms to enable us to use them consistently in the code base. Some points that come to my mind right now are 1) There is a small number of coarse grained "root" exception classes (HyracksDataException, AlgebricksException, … something else?) that are used on method declarations. We are trying to keep this number small to avoid wrapping of exceptions to satisfy interfaces. 2) Every exception should contain an error code that uniquely identifies the error and the error message template. In addition to the error code each exception has a fixed set of parameters that are used to parameterize the error message. The goal of the error code is to enable error messages in different languages, evolution of error messages without breaking error identifiers, and the ability to easily search for problems (and solutions) in search engines. 3) Subclasses of the root exceptions can be used to simplify the construction of exception objects and to increase readability of the code. Based on such a document we should have a discussion with the whole AsterixDB community to find a consensual approach that will hopefully lead to a few simple guidelines that will be adopted quickly. https://asterix-gerrit.ics.uci.edu/#/c/1313/10/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/common/AsterixListAccessor.java File asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/common/AsterixListAccessor.java: Line 60: if (listBytes[start] != ATypeTag.SERIALIZED_UNORDEREDLIST_TYPE_TAG Pull this out? https://asterix-gerrit.ics.uci.edu/#/c/1313/10/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/comparisons/DeepEqualAssessor.java File asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/comparisons/DeepEqualAssessor.java: Line 60: double leftVal = ATypeHierarchy.getDoubleValue("deep-equal", 0, leftPointable.getByteArray(), constant for this? Line 64: return Math.abs(leftVal - rightVal) < 1E-10; constant for this? -- To view, visit https://asterix-gerrit.ics.uci.edu/1313 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie4fff8f5e64ffb027910a4899c0246b37ed5bce7 Gerrit-PatchSet: 10 Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Owner: Yingyi Bu <[email protected]> Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-Reviewer: Michael Blow <[email protected]> Gerrit-Reviewer: Till Westmann <[email protected]> Gerrit-Reviewer: Xikui Wang <[email protected]> Gerrit-Reviewer: Yingyi Bu <[email protected]> Gerrit-Reviewer: abdullah alamoudi <[email protected]> Gerrit-HasComments: Yes
