From 7fe4385ef9e2442d506d293f8b9e50ccdad30562 Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Mon, 6 Oct 2014 14:19:18 +0800 Subject: [PATCH] raft: add comment for Compact interface of Node --- raft/node.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/raft/node.go b/raft/node.go index 8e166a608..a91c94a5d 100644 --- a/raft/node.go +++ b/raft/node.go @@ -104,7 +104,12 @@ type Node interface { ApplyConfChange(cc pb.ConfChange) // Stop performs any necessary termination of the Node Stop() - // Compact + // Compact discards the entrire log up to the given index. It also + // generates a raft snapshot containing the given nodes configuration + // and the given snapshot data. + // It is the caller's responsibility to ensure the given configuration + // and snapshot data match the actual point-in-time configuration and snapshot + // at the given index. Compact(index int64, nodes []int64, d []byte) }