Package ai.vespa.feed.client
Class JsonFeeder
java.lang.Object
ai.vespa.feed.client.JsonFeeder
- All Implemented Interfaces:
Closeable,AutoCloseable
- Author:
- jonmv, bjorncs
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic interface -
Method Summary
Modifier and TypeMethodDescriptionstatic JsonFeeder.Builderbuilder(FeedClient client) voidclose()feedMany(InputStream jsonStream) Same asfeedMany(InputStream, ResultCallback), but without a providedJsonFeeder.ResultCallbackinstance.feedMany(InputStream jsonStream, JsonFeeder.ResultCallback resultCallback) Feeds a stream containing a JSON array of feed operations on the formfeedSingle(String json) Feeds single JSON feed operations on the form
-
Method Details
-
builder
-
feedSingle
Feeds single JSON feed operations on the form{ "id": "id:ns:type::boo", "fields": { ... document fields ... } }Exceptional completion will use be an instance ofFeedExceptionor one of its sub-classes. -
feedMany
public CompletableFuture<Void> feedMany(InputStream jsonStream, JsonFeeder.ResultCallback resultCallback) Feeds a stream containing a JSON array of feed operations on the form[ { "id": "id:ns:type::boo", "fields": { ... document fields ... } }, { "put": "id:ns:type::foo", "fields": { ... document fields ... } }, { "update": "id:ns:type:n=4:bar", "create": true, "fields": { ... partial update fields ... } }, { "remove": "id:ns:type:g=foo:bar", "condition": "type.baz = \"bax\"" }, ... ]Note that"id"is an alias for the document put operation. Exceptional completion will use be an instance ofFeedExceptionor one of its sub-classes. The input stream will be closed upon exhaustion, or error. -
feedMany
Same asfeedMany(InputStream, ResultCallback), but without a providedJsonFeeder.ResultCallbackinstance.- See Also:
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-