Class RecordMakers.RecordsForTable

  • Enclosing class:
    RecordMakers

    public final class RecordMakers.RecordsForTable
    extends Object
    A SourceRecord factory for a specific table and consumer.
    • Method Detail

      • read

        public int read​(Object[] row,
                        Instant ts)
                 throws InterruptedException
        Produce a read record for the row.
        Parameters:
        row - the values of the row, in the same order as the columns in the Table definition in the MySqlSchema.
        ts - the timestamp for this row
        Returns:
        the number of records produced; will be 0 or more
        Throws:
        InterruptedException - if this thread is interrupted while waiting to give a source record to the consumer
      • read

        public int read​(Object[] row,
                        Instant ts,
                        int rowNumber,
                        int numberOfRows)
                 throws InterruptedException
        Produce a read record for the row.
        Parameters:
        row - the values of the row, in the same order as the columns in the Table definition in the MySqlSchema.
        ts - the timestamp for this row
        rowNumber - the number of this row; must be 0 or more
        numberOfRows - the total number of rows to be read; must be 1 or more
        Returns:
        the number of records produced; will be 0 or more
        Throws:
        InterruptedException - if this thread is interrupted while waiting to give a source record to the consumer
      • create

        public int create​(Object[] row,
                          Instant ts)
                   throws InterruptedException
        Produce a create record for the row.
        Parameters:
        row - the values of the row, in the same order as the columns in the Table definition in the MySqlSchema.
        ts - the timestamp for this row
        Returns:
        the number of records produced; will be 0 or more
        Throws:
        InterruptedException - if this thread is interrupted while waiting to give a source record to the consumer
      • create

        public int create​(Object[] row,
                          Instant ts,
                          int rowNumber,
                          int numberOfRows)
                   throws InterruptedException
        Produce a create record for the row.
        Parameters:
        row - the values of the row, in the same order as the columns in the Table definition in the MySqlSchema.
        ts - the timestamp for this row
        rowNumber - the number of this row; must be 0 or more
        numberOfRows - the total number of rows to be read; must be 1 or more
        Returns:
        the number of records produced; will be 0 or more
        Throws:
        InterruptedException - if this thread is interrupted while waiting to give a source record to the consumer
      • update

        public int update​(Object[] before,
                          Object[] after,
                          Instant ts)
                   throws InterruptedException
        Produce an update record for the row.
        Parameters:
        before - the values of the row before the update, in the same order as the columns in the Table definition in the MySqlSchema
        after - the values of the row after the update, in the same order as the columns in the Table definition in the MySqlSchema
        ts - the timestamp for this row
        Returns:
        the number of records produced; will be 0 or more
        Throws:
        InterruptedException - if this thread is interrupted while waiting to give a source record to the consumer
      • update

        public int update​(Object[] before,
                          Object[] after,
                          Instant ts,
                          int rowNumber,
                          int numberOfRows)
                   throws InterruptedException
        Produce an update record for the row.
        Parameters:
        before - the values of the row before the update, in the same order as the columns in the Table definition in the MySqlSchema
        after - the values of the row after the update, in the same order as the columns in the Table definition in the MySqlSchema
        ts - the timestamp for this row
        rowNumber - the number of this row; must be 0 or more
        numberOfRows - the total number of rows to be read; must be 1 or more
        Returns:
        the number of records produced; will be 0 or more
        Throws:
        InterruptedException - if this thread is interrupted while waiting to give a source record to the consumer
      • delete

        public int delete​(Object[] row,
                          Instant ts)
                   throws InterruptedException
        Produce a delete record for the row.
        Parameters:
        row - the values of the row, in the same order as the columns in the Table definition in the MySqlSchema.
        ts - the timestamp for this row
        Returns:
        the number of records produced; will be 0 or more
        Throws:
        InterruptedException - if this thread is interrupted while waiting to give a source record to the consumer
      • delete

        public int delete​(Object[] row,
                          Instant ts,
                          int rowNumber,
                          int numberOfRows)
                   throws InterruptedException
        Produce a delete record for the row.
        Parameters:
        row - the values of the row, in the same order as the columns in the Table definition in the MySqlSchema.
        ts - the timestamp for this row
        rowNumber - the number of this row; must be 0 or more
        numberOfRows - the total number of rows to be read; must be 1 or more
        Returns:
        the number of records produced; will be 0 or more
        Throws:
        InterruptedException - if this thread is interrupted while waiting to give a source record to the consumer