anchor.diff:  	end.
       
       
  -%% @doc Check whether a Key's Snapshot is included in a snapshot
  +%% @doc Check whether a Key's operation or stored snapshot is included
  +%%		in a snapshot defined by a vector clock
   %%      Input: Dc = Datacenter Id
   %%             CommitTime = local commit time of this Snapshot at DC
  -%%             SnapshotTime = Orddict of [{Dc, Ts}]
  +%%             SnapshotTime = vector clock
   %%      Outptut: true or false
   -spec belongs_to_snapshot({Dc::term(),CommitTime::non_neg_integer()},
                           SnapshotTime::vectorclock:vectorclock()) -> boolean().
  
positive.code: %% the mechanism is very simple; when there are more than OPS_THRESHOLD
  %% operations for a given key, just perform a read, that will trigger
  %% the GC mechanism.
  
  op_insert_gc(Key,DownstreamOp, OpsDict, OpsCache, SnapshotCache)-> 
      case (orddict:size(OpsDict))>=?OPS_THRESHOLD of 
      true ->
  	    lager:info("too many operations: time to GC: ~p"),
  	    Type=DownstreamOp#clocksi_payload.type,
  	    SnapshotTime=DownstreamOp#clocksi_payload.snapshot_time,
  	    lager:info("redading key: ~p ~n type: ~p ~n snapshot time: ~p", [Key, Type, SnapshotTime]),
  
negative.code:             false
      end.
  
  %% @doc Operation to insert a Snapshot in the cache and start 
  %%      Garbage collection triggered by reads.
  -spec snapshot_insert_gc(Key::term(), SnapshotDict::orddict:orddict(), 
  	OpsDict::orddict:orddict(), atom() , atom() ) -> true.
  snapshot_insert_gc(Key, SnapshotDict, OpsDict, SnapshotCache, OpsCache)-> 
  	case (orddict:size(SnapshotDict))==?SNAPSHOT_THRESHOLD of 
  	true ->
  