Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

file 24 lines (20 sloc) 0.691 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
require 'fileutils'

def run_in_background(command)
  fork { system command }
end

def with_all_segments(&block)
  0.upto(9) do |segment_number|
    block_size = 100000
    start_index = segment_number * block_size
    end_index = start_index + block_size - 1
    block.call(start_index, end_index)
  end
end

#with_all_segments do |start_index, end_index|
# puts "Initializing keys from #{start_index} to #{end_index}"
# system "ruby worker.rb initialize #{start_index} #{end_index} 0"
#end

with_all_segments do |start_index, end_index|
  run_in_background "ruby worker.rb write #{start_index} #{end_index} 10"
  run_in_background "ruby worker.rb read #{start_index} #{end_index} 1"
end
Something went wrong with that request. Please try again.