anchor.diff:           get_meta/2, update_meta/3]).	 
   
   % @type riak_ring(). The opaque data type used for partition ownership.
  --record(hstate, {
  -    nodename, % the Node responsible for this hstate
  -	vclock,   % for this hstate object, entries are {Node, Ctr}
  -	ring,     % chash ring of {IndexAsInt, Node} mappings
  +-record(chstate, {
  +    nodename, % the Node responsible for this chstate
  +    vclock,   % for this chstate object, entries are {Node, Ctr}
  +    chring,   % chash ring of {IndexAsInt, Node} mappings
       meta      % dict of cluster-wide other data (primarily bucket N-value, etc)
   }). 
   
  -% @type meta_entry(). Record for each entry in #hstate.meta
  +% @type meta_entry(). Record for each entry in #chstate.meta
   -record(meta_entry, {
       value,    % The value stored under this entry
       lastmod   % The last modified time of this entry, 
  -              % from calendar:datetime_to_gregorian_seconds(calendar:universal_time()), 
  +              %  from calendar:datetime_to_gregorian_seconds(
  +              %                             calendar:universal_time()), 
   }).
   
   % @doc This is used only when this node is creating a brand new cluster.
  -% @spec fresh() -> hstate()
  +% @spec fresh() -> chstate()
   fresh() ->
       % use this when starting a new cluster via this node
       fresh(node()).
   
   % @doc Equivalent to fresh/0 but allows specification of the local node name.
   %      Called by fresh/0, and otherwise only intended for testing purposes.
  -% @spec fresh(NodeName :: term()) -> hstate()
  +% @spec fresh(NodeName :: term()) -> chstate()
   fresh(NodeName) ->
       fresh(riak:get_app_env(ring_creation_size), NodeName).
   
   % @doc Equivalent to fresh/1 but allows specification of the ring size.
   %      Called by fresh/1, and otherwise only intended for testing purposes.
  -% @spec fresh(RingSize :: integer(), NodeName :: term()) -> hstate()
  +% @spec fresh(RingSize :: integer(), NodeName :: term()) -> chstate()
   fresh(RingSize, NodeName) ->
  -    #hstate{nodename=NodeName,
  +    #chstate{nodename=NodeName,
   	    vclock=vclock:fresh(),
  -	    ring=chash:fresh(RingSize, NodeName),
  +	    chring=chash:fresh(RingSize, NodeName),
               meta=dict:new()}.
   
   % @doc Return all partition indices owned by the node executing this function.
  -% @spec my_indices(State :: hstate()) -> [integer()]
  +% @spec my_indices(State :: chstate()) -> [integer()]
   my_indices(State) ->
       [I || {I,Owner} <- ?MODULE:all_owners(State), Owner =:= node()].
   
   % @doc Return a partition index not owned by the node executing this function.
   %      If this node owns all partitions, return any index.
  -% @spec random_other_index(State :: hstate()) -> integer()
  +% @spec random_other_index(State :: chstate()) -> integer()
   random_other_index(State) ->
       L = [I || {I,Owner} <- ?MODULE:all_owners(State), Owner =/= node()],
       case L of
  
positive.code:     {new_ring, C4} = reconcile(A3,C3),
      {new_ring, A4} = reconcile(C4,A3),
      {new_ring, B3} = reconcile(A4,B2),
      ?assertEqual(A4#hstate.ring, B3#hstate.ring),
      ?assertEqual(B3#hstate.ring, C4#hstate.ring).
  
  param_fresh_test() ->
      application:set_env(riak,ring_creation_size,4),
  
negative.code:     lists:usort(lists:flatten(AllDiff)).
  
  % @doc Return the number of partitions in this Riak ring.
  % @spec num_partitions(State :: chstate()) -> integer()
  num_partitions(State) ->
      chash:size(State#chstate.chring).
  
  % @doc For a given object key, produce the ordered list of
  %      {partition,node} pairs that could be responsible for that object.
  % @spec preflist(Key :: binary(), State :: chstate()) ->
  %                                 [{Index :: integer(), Node :: term()}]
  preflist(Key, State) ->
      chash:successors(Key, State#chstate.chring).
  
  filtered_preflist(Key, State, N) ->
      Preflist = preflist(Key, State),
  