Class JdbcBulkLoadProcessor

  • All Implemented Interfaces:
    Closeable, AutoCloseable

    public class JdbcBulkLoadProcessor
    extends JdbcCursor
    JDBC wrapper around BulkLoadProcessor that provides extra logic. Unlike other "single shot" request-reply commands, the COPY command the client-server interaction looks like this:
     Thin JDBC client                            Server
            |                                       |
            |------- JdbcQueryExecuteRequest ------>|
            |         with SQL copy command         |
            |                                       |
            |<---- JdbcBulkLoadAckResult -----------|
            | with BulkLoadAckClientParameters      |
            | containing file name and batch size.  |
            |                                       |
     (open the file,                                |
      read portions and send them)                  |
            |                                       |
            |------- JdbcBulkLoadBatchRequest #1 -->|
            | with a portion of input file.         |
            |                                       |
            |<--- JdbcQueryExecuteResult -----------|
            | with current update counter.          |
            |                                       |
            |------- JdbcBulkLoadBatchRequest #2--->|
            | with a portion of input file.         |
            |                                       |
            |<--- JdbcQueryExecuteResult -----------|
            | with current update counter.          |
            |                                       |
            |------- JdbcBulkLoadBatchRequest #3--->|
            | with the LAST portion of input file.  |
            |                                       |
            |<--- JdbcQueryExecuteResult -----------|
            | with the final update counter.        |
            |                                       |
     (close the file)                               |
            |                                       |
     
    In case of input file reading error, a flag is carried to the server: JdbcBulkLoadBatchRequest.CMD_FINISHED_ERROR and the processing is aborted on the both sides.
    • Field Detail

      • nextBatchIdx

        protected long nextBatchIdx
        Next batch index (for a very simple check that all batches were delivered to us).
    • Constructor Detail

      • JdbcBulkLoadProcessor

        public JdbcBulkLoadProcessor​(BulkLoadProcessor processor,
                                     long reqId)
        Creates a JDBC-specific adapter for bulk load processor.
        Parameters:
        processor - Bulk load processor from the core to delegate calls to.
        reqId - Id of the request that created given processor.