anchor.diff:           dread/2,
            dappend/4,
            append_list/2,
  -         read/2,
  -	 threshold_read/3,
  -         append/3]).
  +	 	 threshold_read/3]).
   
   -export([init/1,
            terminate/2,
  
positive.code:                                         {append_list, Ops},
                                          ?LOGGINGMASTER).
  
  %% @doc Sends an `append' syncrhonous command to the Log in `Node' 
  append(Node, Key, Op) ->
      riak_core_vnode_master:sync_command(Node, {append, Key, Op}, ?LOGGINGMASTER).
  
  
  %% @doc Opens the persistent copy of the Log.
  %%	The name of the Log in disk is a combination of the the word `log' and
  %%	the partition identifier.
  init([Partition]) ->
      LogFile = string:concat(integer_to_list(Partition), "log"),
      LogPath = filename:join(
              app_helper:get_env(riak_core, platform_data_dir), LogFile),
      case dets:open_file(LogFile, [{file, LogPath}, {type, bag}]) of
          {ok, Log} ->
              {ok, #state{partition=Partition, log=Log}};
          {error, Reason} ->
              {error, Reason}
      end.
  
  %% @doc Read command: Returns the operations logged for Key
  %%	Input: Key of the object to read
  %%	Output: {vnode_id, Operations} | {error, Reason}
  handle_command({read, Key}, _Sender, #state{partition=Partition, log=Log}=State) ->
      case dets:lookup(Log, Key) of
          [] ->
              {reply, {{Partition, node()}, []}, State};
          [H|T] ->
              {reply, {{Partition, node()}, [H|T]}, State};
          {error, Reason}->
              {reply, {error, Reason}, State}
      end;
  
  %% @doc Threshold read command: Returns the operations logged for Key from a specified op_id-based threshold
  %%	Input:  Key of the object to read
  %%		From: the oldest op_id to return
  %%	Output: {vnode_id, Operations} | {error, Reason}
  handle_command({threshold_read, Key, From}, _Sender, #state{partition=Partition, log=Log}=State) ->
      case dets:lookup(Log, Key) of
          [] ->
              {reply, {{Partition, node()}, []}, State};
          [H|T] ->
  	    Operations =  [H|T],
  	    Operations2 = threshold_prune(Operations, From),
              {reply, {{Partition, node()}, Operations2}, State};
          {error, Reason}->
              {reply, {error, Reason}, State}
      end;
  
  %% @doc Repair command: Appends the Ops to the Log
  %%	Input: Ops: Operations to append
  %%	Output: ok | {error, Reason}
  handle_command({append_list, Ops}, _Sender, #state{log=Log}=State) ->
      Result = dets:insert_new(Log, Ops),
      {reply, Result, State};
  
  %% @doc Append command: Appends a new op to the Log of Key
  
negative.code: 
  -ignore_xref([start_vnode/1]).
  
  -record(state, {partition, logs_map}).
  
  %% API
  start_vnode(I) ->
  