@Override
   public void preSourceTasks () throws SQLException {
      // Because chunkSize is static it's required to initialize it
      // when the unit tests are running
      chunkSize = 0L;

      // Only calculate the chunk size when parallel execution is active
      if (this.options.getJobs() != 1) {
         /*
          * Calculating the chunk size for parallel job processing
          */
         Statement statement = this.getConnection().createStatement();
         String sql = "SELECT " + " CEIL(count(*) / " + options.getJobs() + ") chunk_size" + ", count(*) total_rows" + " FROM ";

         // Source Query
         if (options.getSourceQuery() != null && !options.getSourceQuery().isEmpty()) {
            sql = sql + "( " + this.options.getSourceQuery() + " ) as REPLICADB_TABLE";

         } else {

            sql = sql + this.options.getSourceTable();
            // Source Where
            if (options.getSourceWhere() != null && !options.getSourceWhere().isEmpty()) {
               sql = sql + " WHERE " + options.getSourceWhere();
            }
         }

         LOG.debug("Calculating the chunks size with this sql: {}", sql);
         ResultSet rs = statement.executeQuery(sql);
         rs.next();
         chunkSize = rs.getLong(1);
         long totalNumberRows = rs.getLong(2);
         LOG.debug("chunkSize: {} totalNumberRows: {}", chunkSize, totalNumberRows);

         statement.close();
         this.getConnection().commit();
      }
   }
Constructs the SqlManager.

@param opts the ReplicaDB ToolOptions describing the user's requested action.
src/main/java/org/replicadb/manager/MySQLManager.java