Module: Pione::Util::TaskID

Defined in:
lib/pione/util/id.rb

Overview

ID is a set of ID generators.

Class Method Summary collapse

Class Method Details

.generate(inputs, params) ⇒ Object

Make a task id by input data names and parameters.



6
7
8
9
10
11
# File 'lib/pione/util/id.rb', line 6

def generate(inputs, params)
  # NOTE: auto variables are ignored
  param_set = params.delete_all(["I", "INPUT", "O", "OUTPUT", "*"])
  inputs = inputs.map {|t| t.is_a?(TupleSpace::DataTuple) ? t.name : t}
  Digest::MD5.hexdigest("%s::%s" % [inputs.join(":"), param_set.textize])
end