public class RetrieveCountsHandler extends AbstractHttpServiceHandler
| Constructor and Description |
|---|
RetrieveCountsHandler(WordCount.WordCountConfig config) |
| Modifier and Type | Method and Description |
|---|---|
void |
getAssoc(HttpServiceRequest request,
HttpServiceResponder responder,
String word1,
String word2)
Returns the count of associations for a specific word pair.
|
void |
getCount(HttpServiceRequest request,
HttpServiceResponder responder,
String word,
Integer limit)
Returns the count for a specific word and its word associations, up to the specified limit or
a pre-set limit of ten if not specified.
|
void |
getCounts(HttpServiceRequest request,
HttpServiceResponder responder)
Returns the counts for all words in the input.
|
void |
getMultiCounts(HttpServiceRequest request,
HttpServiceResponder responder)
Returns the counts for all words in the input.
|
void |
getStats(HttpServiceRequest request,
HttpServiceResponder responder)
Returns total number of words, the number of unique words, and the average word length.
|
void |
initialize(HttpServiceContext context) |
configure, configure, destroy, getConfigurer, getContext, setProperties, useDatasets, useDatasetsusePlugin, usePlugin, usePluginClass, usePluginClassaddDatasetModule, addDatasetType, addStream, addStream, createDataset, createDataset, createDataset, createDatasetpublic RetrieveCountsHandler(WordCount.WordCountConfig config)
public void initialize(HttpServiceContext context) throws Exception
initialize in interface HttpServiceHandlerinitialize in class AbstractHttpServiceHandlerException@Path(value="stats") @GET public void getStats(HttpServiceRequest request, HttpServiceResponder responder)
@Path(value="count/{word}") @GET public void getCount(HttpServiceRequest request, HttpServiceResponder responder, @PathParam(value="word") String word, @DefaultValue(value="10")@QueryParam(value="limit") Integer limit)
@Path(value="counts") @POST public void getCounts(HttpServiceRequest request, HttpServiceResponder responder)
@Path(value="multicounts") @POST public void getMultiCounts(HttpServiceRequest request, HttpServiceResponder responder)
This endpoint method differs from getCounts(HttpServiceRequest,HttpServiceResponder)
in using KeyValueTable.readAll(byte[][]) to perform a batched read.
@Path(value="assoc/{word1}/{word2}") @GET public void getAssoc(HttpServiceRequest request, HttpServiceResponder responder, @PathParam(value="word1") String word1, @PathParam(value="word2") String word2)
Copyright © 2016 Cask Data, Inc. Licensed under the Apache License, Version 2.0.