Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

A sample of this output might be:

[{
"connector": "MyConnector",
"offsets": [{
"partition": {
"file": "a"
},
"offset": {
"offsetKey1": "offsetValue1",
"offsetKey2": "offsetValue2"
}
},{
"partition": {
"file": "b"
},
"offset": {
"offsetKey1": "offsetValue3",
"offsetKey2": "offsetValue4"
}]
}]

Note how the response is a JSON array of one or more documents for each connector. Each connector offset document contains a "connector" field with the name of the connector, and an "offsets" field that contains an array of nested document with field names that correspond to the connector names. The value of each field is an array containing zero or more documents each with a "partition" field and an "offset" field. The "partition" field contains a document with the string-valued fields representing the source-specific partition information, and the "offset" field contains a document with the string-valued fields representing the source-specific offset information.

...

Note that in addition to modifying the persisted partition-offset pairs, the tool can also be used to remove partition offset pairs when the "offset" object in the JSON is null. For example, consider the following input supplied to the tool:

 

[{
"connector": "MyConnector",
"offsets": [{
"partition": {
"file": "a"
},
"offset": {
"offsetKey1": "offsetValue1",
"offsetKey2": "offsetValue2"
}
},{
"partition": {
"file": "b"
},
"offset": null
}]
}]

The tool will update the "MyConnector" connector's offsets for the partition with file "a" but will remove the offsets for the partition with file "b". Any other partition-offset pairs for this or any other connector will be unmodified.

...