Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge Header Info into JsonNode #267

Merged
merged 3 commits into from
May 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ Current
* Add a configurable property named "druid_uncovered_interval_limit"
* Add new response error messages as needed by Partial Data V2

- [Merge Druid Response Header into Druid Response Body Json Node in AsyncDruidWebServiceImplV2](https://github.com/yahoo/fili/pull/267)
Copy link
Collaborator

Choose a reason for hiding this comment

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

It may be worth calling out here that this is not a change to the default behavior, but is instead opt-in via configuration (and including how to configure that opt-in)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Should also call out the change to the AsyncDruidWebServiceClientImpl, in that it now takes a strategy for building the JSON from the entire response. (since that's what the ability we're adding hinges on)

* Add configuration to `AsyncDruidWebServiceImpl` so that we can opt-in configuration of JSON response content.
* `AsyncDruidWebServiceImpl` takes a strategy for building the JSON from the entire response.

- [Add MetricUnionCompositeTableDefinition](https://github.com/yahoo/fili/pull/258)

- [Add partition availability and table](https://github.com/yahoo/fili/pull/244)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
import com.yahoo.bard.webservice.druid.client.DruidServiceConfig;
import com.yahoo.bard.webservice.druid.client.DruidWebService;
import com.yahoo.bard.webservice.druid.client.impl.AsyncDruidWebServiceImpl;
import com.yahoo.bard.webservice.druid.client.impl.HeaderNestingJsonBuilderStrategy;
import com.yahoo.bard.webservice.druid.model.query.LookbackQuery;
import com.yahoo.bard.webservice.druid.util.FieldConverterSupplier;
import com.yahoo.bard.webservice.druid.util.FieldConverters;
Expand Down Expand Up @@ -169,6 +170,11 @@ public abstract class AbstractBinderFactory implements BinderFactory {
public static final String DEPRECATED_PERMISSIVE_AVAILABILITY_FLAG = SYSTEM_CONFIG.getPackageVariableName(
"permissive_column_availability_enabled");

public static final int DRUID_UNCOVERED_INTERVAL_LIMIT = SYSTEM_CONFIG.getIntProperty(
SYSTEM_CONFIG.getPackageVariableName("druid_uncovered_interval_limit"),
0
);

public static final String SYSTEM_CONFIG_TIMEZONE_KEY = "timezone";

private ObjectMappersSuite objectMappers;
Expand Down Expand Up @@ -937,7 +943,16 @@ protected Class<? extends PhysicalTableResolver> getPhysicalTableResolver() {
*/
protected DruidWebService buildDruidWebService(DruidServiceConfig druidServiceConfig, ObjectMapper mapper) {
Supplier<Map<String, String>> supplier = buildDruidWebServiceHeaderSupplier();
return new AsyncDruidWebServiceImpl(druidServiceConfig, mapper, supplier);
return DRUID_UNCOVERED_INTERVAL_LIMIT > 0
? new AsyncDruidWebServiceImpl(
druidServiceConfig,
mapper,
supplier,
new HeaderNestingJsonBuilderStrategy(
AsyncDruidWebServiceImpl.DEFAULT_JSON_NODE_BUILDER_STRATEGY
)
)
: new AsyncDruidWebServiceImpl(druidServiceConfig, mapper, supplier);
}

/**
Expand Down
Loading