Class: Kcl::Workers::RecordCheckpointer

Inherits:
Object
  • Object
show all
Defined in:
lib/kcl/workers/record_checkpointer.rb

Instance Method Summary collapse

Constructor Details

#initialize(shard, checkpointer) ⇒ RecordCheckpointer

Returns a new instance of RecordCheckpointer.



3
4
5
6
# File 'lib/kcl/workers/record_checkpointer.rb', line 3

def initialize(shard, checkpointer)
  @shard = shard
  @checkpointer = checkpointer
end

Instance Method Details

#update_checkpoint(sequence_number) ⇒ Object



8
9
10
11
12
# File 'lib/kcl/workers/record_checkpointer.rb', line 8

def update_checkpoint(sequence_number)
  # checkpoint the last sequence of a closed shard
  @shard.checkpoint = sequence_number || Kcl::Checkpoints::Sentinel::SHARD_END
  @checkpointer.update_checkpoint(@shard)
end