public final class RecommendToAnonymousServlet extends AbstractMyrrixServlet
Responds to a GET request to
/recommendToAnonymous/[itemID1(=value1)](/[itemID2(=value2)]/...)?howMany=n[&rescorerParams=...],
and in turn calls MyrrixRecommender.recommendToAnonymous(long[], float[], int, IDRescorer)
with the supplied values. That is, 1 or more item IDs are supplied, which may each optionally correspond to
a value or else default to 1. If howMany is not specified, defaults to
AbstractMyrrixServlet.DEFAULT_HOW_MANY.
Unknown item IDs are ignored, unless all are unknown, in which case a
HttpServletResponse.SC_BAD_REQUEST status is returned.
Outputs item/score pairs in CSV or JSON format, like RecommendServlet does.
ALL_PARTITIONS_REF_KEY, LOCAL_INPUT_DIR_KEY, PARTITION_KEY, READ_ONLY_KEY, RECOMMENDER_KEY, RESCORER_PROVIDER_KEY, TIMINGS_KEY| Constructor and Description |
|---|
RecommendToAnonymousServlet() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
protected Long |
getUnnormalizedPartitionToServe(javax.servlet.http.HttpServletRequest request) |
getConsiderKnownItems, getHowMany, getRecommender, getRescorerParams, getRescorerProvider, getTiming, init, output, servicedoDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, serviceprotected void doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws IOException
doGet in class javax.servlet.http.HttpServletIOExceptionprotected Long getUnnormalizedPartitionToServe(javax.servlet.http.HttpServletRequest request)
getUnnormalizedPartitionToServe in class AbstractMyrrixServletrequest - request containing info that may determine which partition needs to serve itnull if any partition may serve, or an integral value that should be used to
determine the partiiton. This is usually an ID value, which will be possibly hashed and
reduced modulo the number of partitions.Copyright © 2012. All Rights Reserved.