anchor.diff:           read_from/3,
            get/5,
            get_all/4,
  +         get_commits/2,
            request_bucket_op_id/4,
            request_op_id/3]).
   
  
positive.code:     riak_core_vnode_master:sync_command(IndexNode, {get_all, LogId, Continuation, PrevOps},
                                          ?LOGGING_MASTER,
                                          infinity).
  
  %% @doc Gets the last id of operations stored in the log for the given DCID
  -spec request_op_id(index_node(), dcid(), partition()) -> {ok, non_neg_integer()}.
  
negative.code:                 error -> []
              end,
              {ok, Ops}
      end.
  
  -spec get_commits_from_log(log()) -> {ok, list()} | {error, reason()}.
  get_commits_from_log(Log) ->
      get_commits_from_log(Log, start, []).
  
  -spec get_commits_from_log(log(), start | disk_log:continuation(), list()) -> {ok, list()} | {error, reason()}.
  get_commits_from_log(Log, Continuation, Acc) ->
      case disk_log:chunk(Log, Continuation) of
          {error, Reason} ->
              {error, Reason};
  
          eof ->
              {ok, Acc};
  
          {NewContinuation, NewTerms} ->
              Commits = filter_commits(NewTerms),
              get_commits_from_log(Log, NewContinuation, [Commits | Acc]);
  
          {NewContinuation, NewTerms, BadBytes} ->
              case BadBytes > 0 of
                  true ->
                      {error, bad_bytes};
                  false ->
                      Commits = filter_commits(NewTerms),
                      get_commits_from_log(Log, NewContinuation, [Commits | Acc])
              end
      end.
  
  -spec filter_commits([{non_neg_integer(), #log_record{}}]) -> list().
  filter_commits(Terms) ->
      filter_commits(Terms, []).
  
  -spec filter_commits([{non_neg_integer(), #log_record{}}], list()) -> list().
  filter_commits([], Acc) ->
      Acc;
  
  filter_commits([{_, LogRecord} | Terms], Acc) ->
      #log_record{log_operation = LogOperation} = log_utilities:check_log_record_version(LogRecord),
      #log_operation{op_type = OpType, log_payload = OpPayload} = LogOperation,
      case OpType of
          commit ->
              filter_commits(Terms, [OpPayload | Acc]);
          _ ->
              filter_commits(Terms, Acc)
      end.
  
  %% @doc This method successively calls disk_log:chunk so all the log is read.
  