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

Allow manual cache purge via UI and API #3967

Merged
merged 3 commits into from Jul 4, 2017

Conversation

Projects
3 participants
@bernd
Member

bernd commented Jul 3, 2017

Also unbreak cache purging by using the data adapter id for the prefix everywhere.

Closes #3962

bernd added some commits Jul 3, 2017

Allow manual cache purge via UI and API
Also unbreak cache purging by using the data adapter id for the prefix
everywhere.

Closes #3962

@bernd bernd added this to the 2.3.0 milestone Jul 3, 2017

@bernd bernd requested a review from kroepke Jul 3, 2017

@kroepke

minor nitpick, rest lgtm

@@ -209,6 +211,30 @@ public LookupResult performLookup(@ApiParam(name = "name") @PathParam("name") @N
return lookupTableService.newBuilder().lookupTable(name).build().lookup(key);
}
@POST
@Path("tables/{idOrName}/purge")
@ApiOperation(value = "Query a lookup table")

This comment has been minimized.

@kroepke

kroepke Jul 4, 2017

Member

The operation name is wrong

This comment has been minimized.

@bernd

bernd Jul 4, 2017

Member

Fixed!

@kroepke

kroepke approved these changes Jul 4, 2017

@kroepke kroepke merged commit 937775c into master Jul 4, 2017

1 of 4 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/travis-ci/push The Travis CI build is in progress
Details
graylog-project/pr Jenkins build graylog-project-pr-snapshot 301 is running
Details
ci-web-linter Jenkins build graylog-pr-linter-check 1795 has succeeded
Details

@kroepke kroepke deleted the feature-3962 branch Jul 4, 2017

public void performPurge(@ApiParam(name = "idOrName") @PathParam("idOrName") @NotEmpty String idOrName,
@ApiParam(name = "key") @QueryParam("key") String key) {
final Optional<LookupTableDto> lookupTableDto = dbTableService.get(idOrName);
if (!lookupTableDto.isPresent()) {

This comment has been minimized.

@joschi

joschi Jul 4, 2017

Contributor

Drive-by-comment:

LookupTableDto lookupTableDto = dbTableService.get(idOrName).orElseThrow(() -> new NotFoundException("Lookup table <" + idOrName + "> not found"));
throw new NotFoundException("Lookup table <" + idOrName + "> not found");
}
final Optional<CachePurge> cachePurge = lookupTableService.newCachePurge(lookupTableDto.get().name());

This comment has been minimized.

@joschi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment