Class: Rafflesia::FoldCollectionDistributedSearchPlan

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/proteins/fold_collection_distributed_search_plan.rb

Constant Summary collapse

HASH_ATTRS =
{
  collection_id: :collection_id,
  created_at: :created_at,
  distributed: :distributed,
  kind: :kind,
  max_workers: :max_workers,
  plan_id: :plan_id,
  query_id: :query_id,
  ref: :ref,
  require_complete: :require_complete,
  routing_plan: :routing_plan,
  schema_version: :schema_version,
  snapshot_ref: :snapshot_ref,
  task_count: :task_count,
  tasks: :tasks
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ FoldCollectionDistributedSearchPlan

Returns a new instance of FoldCollectionDistributedSearchPlan.



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/rafflesia/proteins/fold_collection_distributed_search_plan.rb', line 41

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @collection_id = hash[:collection_id]
  @created_at = hash[:created_at]
  @distributed = hash[:distributed]
  @kind = hash[:kind]
  @max_workers = hash[:max_workers]
  @plan_id = hash[:plan_id]
  @query_id = hash[:query_id]
  @ref = hash[:ref]
  @require_complete = hash[:require_complete]
  @routing_plan = hash[:routing_plan] ? Rafflesia::FoldCollectionRoutingPlan.new(hash[:routing_plan]) : nil
  @schema_version = hash[:schema_version]
  @snapshot_ref = hash[:snapshot_ref]
  @task_count = hash[:task_count]
  @tasks = (hash[:tasks] || []).map { |item| item ? Rafflesia::FoldCollectionSearchWorkerTask.new(item) : nil }
end

Instance Attribute Details

#collection_idObject

Returns the value of attribute collection_id.



25
26
27
# File 'lib/rafflesia/proteins/fold_collection_distributed_search_plan.rb', line 25

def collection_id
  @collection_id
end

#created_atObject

Returns the value of attribute created_at.



25
26
27
# File 'lib/rafflesia/proteins/fold_collection_distributed_search_plan.rb', line 25

def created_at
  @created_at
end

#distributedObject

Returns the value of attribute distributed.



25
26
27
# File 'lib/rafflesia/proteins/fold_collection_distributed_search_plan.rb', line 25

def distributed
  @distributed
end

#kindObject

Returns the value of attribute kind.



25
26
27
# File 'lib/rafflesia/proteins/fold_collection_distributed_search_plan.rb', line 25

def kind
  @kind
end

#max_workersObject

Returns the value of attribute max_workers.



25
26
27
# File 'lib/rafflesia/proteins/fold_collection_distributed_search_plan.rb', line 25

def max_workers
  @max_workers
end

#plan_idObject

Returns the value of attribute plan_id.



25
26
27
# File 'lib/rafflesia/proteins/fold_collection_distributed_search_plan.rb', line 25

def plan_id
  @plan_id
end

#query_idObject

Returns the value of attribute query_id.



25
26
27
# File 'lib/rafflesia/proteins/fold_collection_distributed_search_plan.rb', line 25

def query_id
  @query_id
end

#refObject

Returns the value of attribute ref.



25
26
27
# File 'lib/rafflesia/proteins/fold_collection_distributed_search_plan.rb', line 25

def ref
  @ref
end

#require_completeObject

Returns the value of attribute require_complete.



25
26
27
# File 'lib/rafflesia/proteins/fold_collection_distributed_search_plan.rb', line 25

def require_complete
  @require_complete
end

#routing_planObject

Returns the value of attribute routing_plan.



25
26
27
# File 'lib/rafflesia/proteins/fold_collection_distributed_search_plan.rb', line 25

def routing_plan
  @routing_plan
end

#schema_versionObject

Returns the value of attribute schema_version.



25
26
27
# File 'lib/rafflesia/proteins/fold_collection_distributed_search_plan.rb', line 25

def schema_version
  @schema_version
end

#snapshot_refObject

Returns the value of attribute snapshot_ref.



25
26
27
# File 'lib/rafflesia/proteins/fold_collection_distributed_search_plan.rb', line 25

def snapshot_ref
  @snapshot_ref
end

#task_countObject

Returns the value of attribute task_count.



25
26
27
# File 'lib/rafflesia/proteins/fold_collection_distributed_search_plan.rb', line 25

def task_count
  @task_count
end

#tasksObject

Returns the value of attribute tasks.



25
26
27
# File 'lib/rafflesia/proteins/fold_collection_distributed_search_plan.rb', line 25

def tasks
  @tasks
end