@Singleton @Path(value="/ingest") public final class Ingest extends AbstractOryxResource
Responds to a POST to /ingest. For each line in the request body, a line of CSV text
is written to the input Kafka topic, in the form userID,itemID,strength,timestamp.
Strength must be a number and defaults to 1; an empty strength value signifies a delete.
Timestamp must be a number of milliseconds since Jany 1, 1970.
These values are parsed directly from the request body line, which may be in one of
several forms:
userID,itemID: strength defaults to 1 and timestamp is current system timeuserID,itemID,: interpreted as a "delete" for the user-item association.
timestamp is current system timeuserID,itemID,strength: timestamp is current system timeuserID,itemID,strength,timestamp: all given values are parsed and used,
including timestamp.The body may be compressed with gzip or deflate Content-Encoding.
It may also by multipart/form-data encoded, and each part may be compressed with
Content-Type application/zip, application/gzip, or
application/x-gzip.
In all events the uncompressed data should be text, encoding with UTF-8, and with
\n line separators.
INPUT_PRODUCER_KEY, MODEL_MANAGER_KEY| Constructor and Description |
|---|
Ingest() |
| Modifier and Type | Method and Description |
|---|---|
void |
post(javax.servlet.http.HttpServletRequest request) |
void |
post(Reader reader) |
check, check, checkExists, checkNotReadOnly, getServingModel, isReadOnly, maybeBuffer, maybeBuffer, maybeDecompress, parseMultipart, sendInputgetInputProducer, getServingModelManager, init@POST
@Consumes(value={"text/plain","text/csv","application/json"})
public void post(Reader reader)
throws IOException,
OryxServingException
IOExceptionOryxServingException@POST
@Consumes(value="multipart/form-data")
public void post(@Context
javax.servlet.http.HttpServletRequest request)
throws IOException,
OryxServingException
IOExceptionOryxServingExceptionCopyright © 2014–2018. All rights reserved.