Class JsonFileCommitter

All Implemented Interfaces:
Committer, Configurable<JsonFileCommitterConfig>, AutoCloseable

public class JsonFileCommitter extends AbstractFsCommitter<Writer,JsonFileCommitterConfig>

Commits documents to JSON files. There are two kinds of entries representing document upserts and deletions.

The generated file entries are never updated. Sending a modified document with the same reference (typically unlikely) will create a new entry and won't modify any existing ones. You can think of the generated files as a set of commit instructions.

Generated JSON format:

 [
   {"upsert": {
     "reference": "document reference, e.g., URL",
     "metadata": {
       "name": ["value"],
       "anothername": [
         "multivalue1",
         "multivalue2"
       ],
       "anyname": ["name-value is repeated as necessary"]
     },
     "content": "Document Content Goes here"
   }},
   {"upsert": {
     // upsert is repeated as necessary
   }},
   {"delete": {
     "reference": "document reference, e.g., URL",
     "metadata": {
       "name": ["value"],
       "anothername": [
         "multivalue1",
         "multivalue2"
       ],
       "anyname": ["name-value is repeated as necessary"]
     }
   }},
   {"delete": {
     // delete is repeated as necessary
   }}
 ]