ulong setCheckpoint(String checkpoint [, String name] [, sync=false])

The setCheckpoint method sets checkpoints in the indexing system. If the optional name is specified, then the related checkpoint is changed.

Checkpoints are used when:

  • The connector must process a journalized or logged data source, which can be abstractly represented as a flow of "add" and "delete" events in the corpus, and where an id can be used to refer to events on a timeline. The connector will then call the setCheckpoint command from time to time, with the id referring to the last add or delete events which have been sent to the Indexing System.

  • Crash-proof synchronization is required. Upon crash, or system restart, the connector will call the getCheckpoint method to retrieve the last checkpoint saved by the Indexing System. The Indexing System guarantees that any add or delete commands called before that checkpoint were saved and will never be lost.

  • To keep track of the synchronization.

The optional parameter name can be used if many checkpoints are needed for a given source. Default value is "".

The sync flag can be used to force the sync of the pending operations before returning control. Once synced, the document is pushed and securely handled by Exalead CloudView.

The setCheckpoint method returns the serial of the last pending operation before the checkpoint. It could be used to check when this document is indexed and searchable.

Note: A getCheckpoint() called immediately after a setCheckpoint() set with the sync parameter to false may not return the last value. getCheckpoint() always returns the last synced checkpoint.

This page discusses:

HTTP method

The method used is:

POST http://<host>:<port>/papi/4/connectors/<connectorName>/set_checkpoint

HTTP parameters

The parameters are described in the table below.

Parameter

Location

Description

PAPI_checkpoint

[URL]

The checkpoint parameter is the string of the checkpoint value.

PAPI_name

[URL]

This optional parameter can be used when you need to manage many checkpoints for a connector.

PAPI_sync

[URL]

The sync parameter is the string representation of the sync’s value. If true, it triggers a sync operation.

PAPI_session

[URL]

The optional parameter that retrieves the session given by a previous call to get_current_session_id

Action: if there is a session mismatch, the Push API server refuses the command and returns an exception.

HTTP response

The command uses the standard responses. See HTTP command response.

If successful (status = OK), then the body contains the serialized form of the serial, which is the string value of the serial.