<protected> new Batch(job, batchId)
Batch (extends RecordStream implements Sendable)
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
job |
Bulk~Job | Bulk job object | |
batchId |
String |
<optional> |
Batch ID (if already available) |
Extends
Methods
-
check(callback) → {Promise.<Bulk~BatchInfo>}
-
Check batch status in server
Parameters:
Name Type Argument Description callback
Callback.<Bulk~BatchInfo> <optional>
Callback function Returns:
- Type
- Promise.<Bulk~BatchInfo>
-
destroy()
-
Destroy record stream;
- Inherited From:
- Source:
-
destroySoon()
-
Destroy record stream after all record submission in the queue;
- Inherited From:
- Source:
-
end()
-
End sending records into stream.
- Inherited From:
- Source:
-
execute(input, callback) → {Bulk~Batch}
-
Execute batch operation
Parameters:
Name Type Argument Description input
Array.<Record> | stream.Stream | String <optional>
Input source for batch operation. Accepts array of records, CSv string, and CSV data input stream. callback
Callback.<Array.<RecordResult>> <optional>
Callback function Returns:
- Type
- Bulk~Batch
-
filter(fn) → {RecordStream}
-
Filtering incoming record from upstream, and pass to downstream
Parameters:
Name Type Description fn
RecordFilterFunction Record filtering function - Inherited From:
- Source:
Returns:
- Type
- RecordStream
-
map(fn) → {RecordStream}
-
Mapping incoming record from upstream, and pass to downstream
Parameters:
Name Type Description fn
RecordMapFunction Record mapping function - Inherited From:
- Source:
Returns:
- Type
- RecordStream
-
pipe(dest, options) → {RecordStream}
-
Streaming pipe for record manipulation Originally from Node.js's Stream#pipe https://github.com/joyent/node/blob/master/lib/stream.js
Parameters:
Name Type Argument Description dest
RecordStream Destination output stream for records options
Object <optional>
- Inherited From:
- Source:
Returns:
- Type
- RecordStream
-
poll(interval, timeout)
-
Polling the batch result and retrieve
Parameters:
Name Type Description interval
Number Polling interval in milliseconds timeout
Number Polling timeout in milliseconds -
<abstract> resume()
-
Resume record fetch and query execution
- Inherited From:
- Source:
-
retrieve(callback) → {Promise.<Array.<RecordResult>>}
-
Retrieve batch result
Parameters:
Name Type Argument Description callback
Callback.<Array.<RecordResult>> <optional>
Callback function Returns:
- Type
- Promise.<Array.<RecordResult>>
-
send(record)
-
Output record into stream.
Parameters:
Name Type Description record
Record Record object - Inherited From:
- Source:
-
stream() → {stream.Stream}
-
Create Node.js stream instance for serializing/deserialize records
- Inherited From:
- Source:
Returns:
- Type
- stream.Stream
-
then()
-
Promise/A+ interface http://promises-aplus.github.io/promises-spec/ Delegate to deferred promise, return promise instance for batch result
-
thenCall()
-
Promise/A+ extension Call "then" using given node-style callback function