public final class PreferenceServlet extends AbstractMyrrixServlet
Responds to a POST request to /pref/[userID]/[itemID] and in turn calls
MyrrixRecommender.setPreference(long, long, float). If the request body is empty,
the value is 1.0, otherwise the value in the request body's first line is used.
Also responds to a DELETE request to the same path, with the same defaults. This corresponds
to calling MyrrixRecommender.removePreference(long, long) instead.
| Modifier and Type | Field and Description |
|---|---|
static String |
AVG_ESTIMATE_ERROR_KEY |
ALL_PARTITIONS_REF_KEY, LOCAL_INPUT_DIR_KEY, PARTITION_KEY, READ_ONLY_KEY, RECOMMENDER_KEY, RESCORER_PROVIDER_KEY, TIMINGS_KEY| Constructor and Description |
|---|
PreferenceServlet() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doDelete(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
protected void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
protected Long |
getUnnormalizedPartitionToServe(javax.servlet.http.HttpServletRequest request) |
void |
init(javax.servlet.ServletConfig config) |
getConsiderKnownItems, getHowMany, getRecommender, getRescorerParams, getRescorerProvider, getTiming, output, servicedoGet, doHead, doOptions, doPut, doTrace, getLastModified, servicepublic static final String AVG_ESTIMATE_ERROR_KEY
public void init(javax.servlet.ServletConfig config)
throws javax.servlet.ServletException
init in interface javax.servlet.Servletinit in class AbstractMyrrixServletjavax.servlet.ServletExceptionprotected void doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws IOException
doPost in class javax.servlet.http.HttpServletIOExceptionprotected void doDelete(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws IOException
doDelete 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-2013. All Rights Reserved.