bulkLoad

Places the ProvenDB system in or out of "bulkLoad" mode

Definition

bulkLoad allows multiple insert commands to be issued without incrementing the version number. It is useful when running imports, since multiple processes can import data simultaneously. All data imported using bulkLoad is contained within a single version.

πŸ“˜

If bulk load mode is on, update and delete operations are not permitted.

The bulkLoad command has the following form:

{
    "bulkLoad": <string>
}

The command accepts the following arguments:

FieldTypeMandatoryDescription
bulkLoadstringyesThe bulk load type. See Type for options.

Type

FieldTypeDescription
startstringStart the bulk load.
stopstringStop the bulk load.
killstringStop the bulk load regardless of any current executing operations.
statusstringShow the status of the bulk load.

Output

The returned document contains a subset of the following fields:

FieldTypeDescription
oknumberThe status of the command.
versionnumberThe version when bulk load mode has started.
statusstringEither "on" or "off".

Examples

Start Bulk Load

The following command will start a new bulk load session:

{
    "bulkLoad" : "start"
}

πŸ“˜

A bulk load session can only be started if there is no session already in progress.

The response from a successful start operation is:

> db.runCommand({ bulkLoad:'start' })
{ "ok" : 1, "version" : NumberLong(24911) }

Stop Bulk Load

The following command will stop the current bulk load session:

{
    "bulkLoad" : "stop"
}

πŸ“˜

A bulk load session can only be stopped successfully if there are no current operations that are executing within the current bulk load session. If you want to terminate the bulk load in progress, use the kill option. See Concepts for more information.

The response from a successful stop operation is:

> db.runCommand({ bulkLoad:'stop' })
{ "ok" : 1 }

Kill Bulk Load

The following command will kill a bulk load session:

{
    "bulkLoad" : "kill"
}

πŸ“˜

If a kill operation is executed, all current operations that are still executing will be terminated. Please use this with caution.

The response from a successful kill operation is:

> db.runCommand({ bulkLoad:'kill' });
{ "ok" : 1 }

Status

The following command will return the status of the current bulk load session:

{
    "bulkLoad" : "status"
}

The response from a status operation is:

> db.runCommand({ bulkLoad:'status' });
{ "ok" : 1, "status" : "on" }

Error starting bulk load when a session is already in progress

The following is an example of an error generated if attempting to start a new bulk load when a bulk load session has already been started and is still in progress.

{
    "ok" : 1
    "errmsg" : "Unable to start bulk load when a session is already in progress"
}

Notes

Data inserted during a bulk load is visible to other sessions during the load.

Operations that attempt to perform update or delete operations during a bulk load will receive an error. Administrative commands such as submitProof are also disabled.


What’s Next