lib/rocket_job/sliced/input.rb
def upload_integer_range_in_reverse_order(start_id, last_id)
        create_indexes
        end_id = last_id
        count  = 0
        while end_id >= start_id
          first_id = end_id - slice_size + 1
          first_id = start_id if first_id.negative? || (first_id < start_id)
          create!(records: [[first_id, end_id]])
          end_id -= slice_size
          count  += 1
        end
        count
      end
# Upload sliced range of integer requests as an arrays of start and end ids
# starting with the last range first
#
# Returns [Integer] the number of slices uploaded
#
# Uploads one range per slice so that the response can return multiple records
# for each slice processed.
# Useful for when the highest order integer values should be processed before
# the lower integer value ranges. For example when processing every record
# in a database based on the id column
#
# Example
#   job.slice_size = 100
#   job.record_count = job.upload_integer_range_in_reverse_order(200, 421) * job.slice_size
#
#   # Equivalent to calling:
#   job.insert([400,421])
#   job.insert([300,399])
#   job.insert([200,299])
Upload sliced range of integer requests as an arrays of start and end ids
starting with the last range first

Returns [Integer] the number of slices uploaded

Uploads one range per slice so that the response can return multiple records
for each slice processed.
Useful for when the highest order integer values should be processed before
the lower integer value ranges. For example when processing every record
in a database based on the id column




Upload sliced range of integer requests as an arrays of start and end ids starting with the last range first Returns [ Integer ] the number of slices uploaded Uploads one range per slice so that the response can return multiple records for each slice processed . Useful for when the highest order integer values should be processed before the lower integer value ranges . For example when processing every record in a database based on the id column
def upload_integer_range_in_reverse_order(start_id, last_id)
        create_indexes
        end_id = last_id
        count  = 0
        while end_id >= start_id
          first_id = end_id - slice_size + 1
          first_id = start_id if first_id.negative? || (first_id < start_id)
          create!(records: [[first_id, end_id]])
          end_id -= slice_size
          count  += 1
        end
        count
      end
def upload_integer_range_in_reverse_order ( start_id , last_id ) create_indexes end_id = last_id count = 0 while end_id >= start_id first_id = end_id - slice_size + 1 first_id = start_id if first_id . negative? || ( first_id < start_id ) create! ( records : [ [ first_id , end_id ] ] ) end_id -= slice_size count += 1 end count end
Upload sliced range of integer requests as an arrays of start and end ids
starting with the last range first
Upload sliced range of integer requests as an arrays of start and end ids starting with the last range first
start_id
last_id