-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Abort request when too many Druid filters are generated (#690)
- Loading branch information
Showing
6 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...-core/src/main/java/com/yahoo/bard/webservice/exception/TooManyDruidFiltersException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright 2016 Yahoo Inc. | ||
// Licensed under the terms of the Apache license. Please see LICENSE.md file distributed with this work for terms. | ||
package com.yahoo.bard.webservice.exception; | ||
|
||
/** | ||
* Unchecked exception for situations when too many Druid filters a generated for a Druid query. | ||
* <p> | ||
* Dimensions with extremely large cardinalities could result in such error when user put a "contain" filter on the | ||
* dimension value. For example, a filter of dimension|id-contains[123], where there are 10,000 ID's starting with 123, | ||
* could generate 10,000 Druid filters using | ||
* {@link com.yahoo.bard.webservice.data.filterbuilders.DefaultDruidFilterBuilder}. This giant query shall eventually | ||
* timeout the Druid query and returns the timeout error to API user. | ||
*/ | ||
public class TooManyDruidFiltersException extends RuntimeException { | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @param message Message of the exception | ||
*/ | ||
public TooManyDruidFiltersException(String message) { | ||
super(message); | ||
} | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @param cause Cause of the exception | ||
*/ | ||
public TooManyDruidFiltersException(Throwable cause) { | ||
super(cause); | ||
} | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @param message Message of the exception | ||
* @param cause Cause of the exception | ||
*/ | ||
public TooManyDruidFiltersException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters