Skip to content

Update doc for query errors and add unit tests for JsonParserIterator#10833

Merged
clintropolis merged 4 commits intoapache:masterfrom
jihoonson:query-errors-doc
Feb 5, 2021
Merged

Update doc for query errors and add unit tests for JsonParserIterator#10833
clintropolis merged 4 commits intoapache:masterfrom
jihoonson:query-errors-doc

Conversation

@jihoonson
Copy link
Copy Markdown
Contributor

Description

A follow-up of #10746. This PR updates the query error doc and adds unit tests for JsonParserIterator. Integration tests will be added in another PR.


This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

public static final String ERROR_CODE = "Resource limit exceeded";

public ResourceLimitExceededException(String message, Object... arguments)
public ResourceLimitExceededException(String message)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, the built in format seemed useful and cleaner than having callers deal with it everywhere, and consistent with many of our other exceptions, why this change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a mistake in my previous PR that creates a ResourceLimitExceededException by calling new ResourceLimitExceededException(errorCode, message, errorClass, host) which actually calls ResourceLimitExceededException(String message, Object... arguments). I didn't notice my mistake until I add a test for it because Intellij says you are cool. This change was to avoid such mistakes, but I agree it is useful. I added a static constructor that does the same.

@jihoonson jihoonson added this to the 0.21.0 milestone Feb 3, 2021
@clintropolis clintropolis merged commit ac41e41 into apache:master Feb 5, 2021
jihoonson added a commit to jihoonson/druid that referenced this pull request Apr 12, 2021
…apache#10833)

* Update doc for query errors and add unit tests for JsonParserIterator

* static constructor for convenience

* rename method
jihoonson added a commit that referenced this pull request Apr 13, 2021
…#10833) (#11101)

* Update doc for query errors and add unit tests for JsonParserIterator

* static constructor for convenience

* rename method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants