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

Reorganizes the asynchronous classes. #19

Merged
merged 10 commits into from
Aug 31, 2016
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
27 changes: 24 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Change Log
==========

All notable changes to Fili will be documented here. Changes are accumulated as new paragraphs at the top of the current
major version. Each change has a link to the issue that triggered the change, and to the pull request that makes the
change.
major version. Each change has a link to the pull request that makes the change and to the issue that triggered the
pull request if there was one.

Current
-------
Expand All @@ -17,15 +17,36 @@ Current
### Removed:


#### Changed:
### Changed:

- [Reorganizes asynchronous package structure](https://github.com/yahoo/fili/pull/19)
* The `jobs` package is renamed to `async` and split into the following subpackages:
- `broadcastchannels` - Everything dealing with broadcast channels
- `jobs` - Everything related to `jobs`, broken into subpackages
* `jobrows` - Everything related to the content of the job metadata
* `payloads` - Everything related to building the version of the job metadata to send to the user
* `stores` - Everything related to the databases for job data
- `preresponses` - Everything related to `PreResponses`, broken into subpackages
* `stores` - Everything related to the the databases for PreResponse data
- `workflows` - Everything related to the asynchronous workflow

- [Removed timing component in JobsApiRequestSpec](https://github.com/yahoo/fili/pull/27)
* Rather than setting an async timeout, and then sleeping,
`JobsApiReqeustSpec::handleBroadcastChannelNotification returns an empty Observable if a timeout occurs before the notification is received`
now verifies that the Observable returned terminates without sending any
messages.

- [Fix Dimension Serialization Problem with Nested Queries](https://github.com/yahoo/fili/pull/15)
* Modified `DimensionToDefaultDimensionSpec` serializer to serialize dimension to apiName if it is not the inner most query
* Added helper `hasInnerQuery` to `Util` in serializer package to determine if current query is the inner most query or not
* Added tests for `DimensionToDefaultDimensionSpec`


### Fixed:

- [`DruidDimensionsLoader` doesn't set the dimension's lastUpdated date](https://github.com/yahoo/fili/pull/24)
* `DruidDimensionsLoader` now properly sets the `lastUpdated` field after it finished processing the Druid response


### Known Issues:

2 changes: 1 addition & 1 deletion docs/usage.sample
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<dependency>
<groupId>com.yahoo.fili</groupId>
<artifactId>fili-core</artifactId>
<artifactId>fili</artifactId>
<version>0.1</version>
</dependency>
15 changes: 2 additions & 13 deletions fili-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<parent>
<groupId>com.yahoo.fili</groupId>
<artifactId>fili-parent-pom</artifactId>
<version>0.1.3</version>
<version>0.1-SNAPSHOT</version>
</parent>

<properties>
Expand All @@ -29,7 +29,7 @@
<dependency>
<groupId>com.yahoo.fili</groupId>
<artifactId>fili-system-config</artifactId>
<version>${fili.version}</version>
<version>0.1-SNAPSHOT</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -261,16 +261,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.16</version>
<configuration>
<configLocation>${checkstyle.config.location}</configLocation>
<suppressionsLocation>${checkstyle.suppressions.location}</suppressionsLocation>
<suppressionsFileExpression>checkstyle.suppressions.file</suppressionsFileExpression>
<includes>**\/*.java</includes>
<resourceIncludes>**/*.properties,**/*.sample</resourceIncludes>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<consoleOutput>true</consoleOutput>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -284,7 +274,6 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
import com.yahoo.bard.webservice.application.healthchecks.DruidDimensionsLoaderHealthCheck;
import com.yahoo.bard.webservice.application.healthchecks.SegmentMetadataLoaderHealthCheck;
import com.yahoo.bard.webservice.application.healthchecks.VersionHealthCheck;
import com.yahoo.bard.webservice.jobs.AsynchronousWorkflowsBuilder;
import com.yahoo.bard.webservice.jobs.DefaultAsynchronousWorkflowsBuilder;
import com.yahoo.bard.webservice.async.workflows.AsynchronousWorkflowsBuilder;
import com.yahoo.bard.webservice.async.workflows.DefaultAsynchronousWorkflowsBuilder;
import com.yahoo.bard.webservice.config.BardFeatureFlag;
import com.yahoo.bard.webservice.config.FeatureFlag;
import com.yahoo.bard.webservice.config.FeatureFlagRegistry;
Expand Down Expand Up @@ -55,17 +55,17 @@
import com.yahoo.bard.webservice.druid.util.FieldConverterSupplier;
import com.yahoo.bard.webservice.druid.util.FieldConverters;
import com.yahoo.bard.webservice.druid.util.SketchFieldConverter;
import com.yahoo.bard.webservice.jobs.ApiJobStore;
import com.yahoo.bard.webservice.jobs.BroadcastChannel;
import com.yahoo.bard.webservice.jobs.DefaultJobField;
import com.yahoo.bard.webservice.jobs.DefaultJobPayloadBuilder;
import com.yahoo.bard.webservice.jobs.DefaultJobRowBuilder;
import com.yahoo.bard.webservice.jobs.JobPayloadBuilder;
import com.yahoo.bard.webservice.jobs.JobRowBuilder;
import com.yahoo.bard.webservice.jobs.NoOpApiJobStore;
import com.yahoo.bard.webservice.jobs.NoOpPreResponseStore;
import com.yahoo.bard.webservice.jobs.PreResponseStore;
import com.yahoo.bard.webservice.jobs.SimpleBroadcastChannel;
import com.yahoo.bard.webservice.async.jobs.stores.ApiJobStore;
import com.yahoo.bard.webservice.async.broadcastchannels.BroadcastChannel;
import com.yahoo.bard.webservice.async.jobs.jobrows.DefaultJobField;
import com.yahoo.bard.webservice.async.jobs.payloads.DefaultJobPayloadBuilder;
import com.yahoo.bard.webservice.async.jobs.jobrows.DefaultJobRowBuilder;
import com.yahoo.bard.webservice.async.jobs.payloads.JobPayloadBuilder;
import com.yahoo.bard.webservice.async.jobs.jobrows.JobRowBuilder;
import com.yahoo.bard.webservice.async.jobs.stores.NoOpApiJobStore;
import com.yahoo.bard.webservice.async.preresponses.stores.NoOpPreResponseStore;
import com.yahoo.bard.webservice.async.preresponses.stores.PreResponseStore;
import com.yahoo.bard.webservice.async.broadcastchannels.SimpleBroadcastChannel;
import com.yahoo.bard.webservice.metadata.DataSourceMetadataLoader;
import com.yahoo.bard.webservice.metadata.DataSourceMetadataService;
import com.yahoo.bard.webservice.metadata.QuerySigningService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ public void invoke(JsonNode rootNode) {
}
}
}

// Tell the dimension it's been updated
dimension.setLastUpdated(DateTime.now());
}
};
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2016 Yahoo Inc.
// Licensed under the terms of the Apache license. Please see LICENSE file distributed with this work for terms.
package com.yahoo.bard.webservice.jobs;
package com.yahoo.bard.webservice.async;

import com.yahoo.bard.webservice.data.ResultSet;
import com.yahoo.bard.webservice.druid.model.query.AllGranularity;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2016 Yahoo Inc.
// Licensed under the terms of the Apache license. Please see LICENSE file distributed with this work for terms.
package com.yahoo.bard.webservice.jobs;
package com.yahoo.bard.webservice.async;

import javax.validation.constraints.NotNull;
import javax.ws.rs.ProcessingException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2016 Yahoo Inc.
// Licensed under the terms of the Apache license. Please see LICENSE file distributed with this work for terms.
package com.yahoo.bard.webservice.jobs;
package com.yahoo.bard.webservice.async;

import static com.yahoo.bard.webservice.web.handlers.workflow.DruidWorkflow.RESPONSE_WORKFLOW_TIMER;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2016 Yahoo Inc.
// Licensed under the terms of the Apache license. Please see LICENSE file distributed with this work for terms.
package com.yahoo.bard.webservice.jobs;
package com.yahoo.bard.webservice.async;

import com.yahoo.bard.webservice.druid.model.query.DruidAggregationQuery;
import com.yahoo.bard.webservice.druid.model.query.DruidQuery;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2016 Yahoo Inc.
// Licensed under the terms of the Apache license. Please see LICENSE file distributed with this work for terms.
package com.yahoo.bard.webservice.jobs;
package com.yahoo.bard.webservice.async.broadcastchannels;

import rx.Observable;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2016 Yahoo Inc.
// Licensed under the terms of the Apache license. Please see LICENSE file distributed with this work for terms.
package com.yahoo.bard.webservice.jobs;
package com.yahoo.bard.webservice.async.broadcastchannels;

import com.yahoo.bard.webservice.config.SystemConfig;
import com.yahoo.bard.webservice.config.SystemConfigProvider;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2016 Yahoo Inc.
// Licensed under the terms of the Apache license. Please see LICENSE file distributed with this work for terms.
package com.yahoo.bard.webservice.jobs;
package com.yahoo.bard.webservice.async.broadcastchannels;

import rx.Observable;
import rx.subjects.Subject;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2016 Yahoo Inc.
// Licensed under the terms of the Apache license. Please see LICENSE file distributed with this work for terms.
package com.yahoo.bard.webservice.jobs;
package com.yahoo.bard.webservice.async.jobs.jobrows;

import com.yahoo.bard.webservice.util.EnumUtils;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2016 Yahoo Inc.
// Licensed under the terms of the Apache license. Please see LICENSE file distributed with this work for terms.
package com.yahoo.bard.webservice.jobs;
package com.yahoo.bard.webservice.async.jobs.jobrows;

import org.joda.time.DateTime;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2016 Yahoo Inc.
// Licensed under the terms of the Apache license. Please see LICENSE file distributed with this work for terms.
package com.yahoo.bard.webservice.jobs;
package com.yahoo.bard.webservice.async.jobs.jobrows;

import java.util.Locale;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2016 Yahoo Inc.
// Licensed under the terms of the Apache license. Please see LICENSE file distributed with this work for terms.
package com.yahoo.bard.webservice.jobs;
package com.yahoo.bard.webservice.async.jobs.jobrows;

/**
* Represents a column in the table of job metadata.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2016 Yahoo Inc.
// Licensed under the terms of the Apache license. Please see LICENSE file distributed with this work for terms.
package com.yahoo.bard.webservice.jobs;
package com.yahoo.bard.webservice.async.jobs.jobrows;

import com.yahoo.bard.webservice.util.StreamUtils;
import com.yahoo.bard.webservice.web.ErrorMessageFormat;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2016 Yahoo Inc.
// Licensed under the terms of the Apache license. Please see LICENSE file distributed with this work for terms.
package com.yahoo.bard.webservice.jobs;
package com.yahoo.bard.webservice.async.jobs.jobrows;

import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.core.UriInfo;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2016 Yahoo Inc.
// Licensed under the terms of the Apache license. Please see LICENSE file distributed with this work for terms.
package com.yahoo.bard.webservice.jobs;
package com.yahoo.bard.webservice.async.jobs.jobrows;

/**
* A job status describes the current state of a job (i.e. 'pending', 'success', 'failure').
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Copyright 2016 Yahoo Inc.
// Licensed under the terms of the Apache license. Please see LICENSE file distributed with this work for terms.
package com.yahoo.bard.webservice.jobs;
package com.yahoo.bard.webservice.async.jobs.payloads;

import com.yahoo.bard.webservice.async.jobs.jobrows.DefaultJobField;
import com.yahoo.bard.webservice.async.jobs.jobrows.JobRow;
import com.yahoo.bard.webservice.web.ErrorMessageFormat;
import com.yahoo.bard.webservice.web.JobRequestFailedException;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Copyright 2016 Yahoo Inc.
// Licensed under the terms of the Apache license. Please see LICENSE file distributed with this work for terms.
package com.yahoo.bard.webservice.jobs;
package com.yahoo.bard.webservice.async.jobs.payloads;

import com.yahoo.bard.webservice.async.jobs.jobrows.JobRow;
import com.yahoo.bard.webservice.web.endpoints.JobsServlet;

import java.util.Map;
Expand Down Expand Up @@ -44,7 +45,7 @@ static String getResultsUrl(String ticket, UriInfo uriInfo) {
/**
* Get the url for obtaining the job results synchronously.
* <pre>
* "http://localhost:9998/jobs/ticket1/results?async=never"
* "http://localhost:9998/jobs/ticket1/results?asyncAfter=never"
* </pre>
*
* @param ticket The ticket that can uniquely identify a Job
Expand All @@ -60,11 +61,11 @@ static String getSyncResultsUrl(String ticket, UriInfo uriInfo) {
}

/**
* Get the UriBuilder for the /job/ticket/results endpoint.
* Get the UriBuilder for the /jobs/ticket/results endpoint.
*
* @param uriInfo UriInfo of the request
*
* @return the UriBuilder for the /job/ticket/results endpoint
* @return the UriBuilder for the /jobs/ticket/results endpoint
*/
static UriBuilder getResultsBaseUrl(UriInfo uriInfo) {
return uriInfo.getBaseUriBuilder()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright 2016 Yahoo Inc.
// Licensed under the terms of the Apache license. Please see LICENSE file distributed with this work for terms.
package com.yahoo.bard.webservice.jobs;
package com.yahoo.bard.webservice.async.jobs.stores;

import com.yahoo.bard.webservice.async.jobs.jobrows.JobRow;

import rx.Observable;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright 2016 Yahoo Inc.
// Licensed under the terms of the Apache license. Please see LICENSE file distributed with this work for terms.
package com.yahoo.bard.webservice.jobs;
package com.yahoo.bard.webservice.async.jobs.stores;

import com.yahoo.bard.webservice.async.jobs.jobrows.JobRow;

/**
* Class for exception thrown while saving a record in ApiJobStore.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright 2016 Yahoo Inc.
// Licensed under the terms of the Apache license. Please see LICENSE file distributed with this work for terms.
package com.yahoo.bard.webservice.jobs;
package com.yahoo.bard.webservice.async.jobs.stores;

import com.yahoo.bard.webservice.async.jobs.jobrows.JobRow;

import rx.Observable;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright 2016 Yahoo Inc.
// Licensed under the terms of the Apache license. Please see LICENSE file distributed with this work for terms.
package com.yahoo.bard.webservice.jobs;
package com.yahoo.bard.webservice.async.jobs.stores;

import com.yahoo.bard.webservice.async.jobs.jobrows.JobRow;

import rx.Observable;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2016 Yahoo Inc.
// Licensed under the terms of the Apache license. Please see LICENSE file distributed with this work for terms.
package com.yahoo.bard.webservice.jobs;
package com.yahoo.bard.webservice.async.preresponses.stores;

import com.yahoo.bard.webservice.web.PreResponse;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2016 Yahoo Inc.
// Licensed under the terms of the Apache license. Please see LICENSE file distributed with this work for terms.
package com.yahoo.bard.webservice.jobs;
package com.yahoo.bard.webservice.async.preresponses.stores;

import com.yahoo.bard.webservice.web.PreResponse;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2016 Yahoo Inc.
// Licensed under the terms of the Apache license. Please see LICENSE file distributed with this work for terms.
package com.yahoo.bard.webservice.jobs;
package com.yahoo.bard.webservice.async.preresponses.stores;

import com.yahoo.bard.webservice.web.PreResponse;

Expand Down
Loading