anchor.diff:      end.
   
   %% @doc This method successively calls disk_log:chunk so all the log is read.
  -%% With each valid chunk, filter_terms_for_key is called.
  -%% TODO: upgrade to newer erlang version so can use dict type spec
  -%% -spec get_ops_from_log(log_id(), key(), disk_log:continuation() | start, snapshot_time(),
  -%%                dict:dict(txid(), [any_log_payload()]), dict:dict(key(), [{non_neg_integer(), #clocksi_payload()}]), load_all | load_per_chunk) ->
  -%%                    {disk_log:continuation(), dict:dict(txid(), [any_log_payload()]), dict:dict(key(), [{non_neg_integer(), #clocksi_payload()}])}
  -%%                    | {error, reason()} | {eof, dict:dict(key(), [{non_neg_integer(), #clocksi_payload()}])}.
  --spec get_ops_from_log(log_id(), key(), disk_log:continuation() | start, snapshot_time(), dict:dict(), dict:dict(), load_all | load_per_chunk) ->
  -                  {disk_log:continuation(), dict:dict(), dict:dict()}
  -                  | {error, reason()} | {eof, dict:dict()}.
  +%%      With each valid chunk, filter_terms_for_key is called.
  +-spec get_ops_from_log(
  +    log_id(),
  +    key(),
  +    disk_log:continuation() | start,
  +    snapshot_time(),
  +    update_ops_dict(),
  +    ops_dict(),
  +    load_all | load_per_chunk
  +) -> {disk_log:continuation(), update_ops_dict(), ops_dict()} | {error, reason()} | {eof, ops_dict()}.
   get_ops_from_log(Log, Key, Continuation, MinSnapshotTime, Ops, CommittedOpsDict, LoadAll) ->
       case disk_log:chunk(Log, Continuation) of
           {error, Reason} ->
  
positive.code: -spec handle_commit(
      txid(),
      snapshot_time() | undefined,
      dict:dict(txid(), [any_log_payload()]),
      dict:dict(key(), [clocksi_payload()]),
      #commit_log_payload{}
  ) -> {dict:dict(txid(), [any_log_payload()]), dict:dict(key(), [clocksi_payload()])}.
  handle_commit(TxId, MinSnapshotTime, Ops, CommittedOpsDict, _OpPayload = #commit_log_payload{
      commit_time = CommitTime,
      snapshot_time = SnapshotTime
  
negative.code: %% If key is undefined then is returns all records for all keys
  %% It returns a dict corresponding to all the ops matching Key and
  %% a list of the commited operations for that key which have a smaller commit time than MinSnapshotTime.
  -spec filter_terms_for_key(
      [{non_neg_integer(), #log_record{}}],
      key(),
      snapshot_time(),
      update_ops_dict(),
      committed_ops_dict()
  ) -> {update_ops_dict(), committed_ops_dict()}.
  filter_terms_for_key([], _Key, _MinSnapshotTime, Ops, CommittedOpsDict) ->
      {Ops, CommittedOpsDict};
  
  