Aproblem about Logcabin

54 views
Skip to first unread message

cwcwf...@gmail.com

unread,
Sep 28, 2015, 6:53:35 PM9/28/15
to raft-dev
        That is, now I want to add another player called Agent to transmit RPC from leader to follower, in order to unload the leader. And I simulate an environment to add the distance as a factor to influence to elect the Agent.

        But now I have a problem! I want to add the x,y(using a vector to store these two factor) into a new function AgentElection, and I do not know how to add it to the request. Because I got the 3 different clusters before that, for example: cluster[0] contains 3 peers cluster[0][0],cluster[0][1],cluster[0][2],and everyone contains X and Y, means cluster[0][0].X, cluster[0][0].Y, but I do not know how to set it to request, I try to put a message called  Tuple{ required x; required y},and in message AgentElection using required Tuple cluster[0],but it is wrong!!
        I do not know, under this condition, how to add the x y to the request, Could someone give me some advice?

Oren Eini (Ayende Rahien)

unread,
Sep 29, 2015, 4:49:26 AM9/29/15
to raft...@googlegroups.com

It is impossible (at least for me), to understand what you are trying to do here.
Can you explain from scratch?

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


--
You received this message because you are subscribed to the Google Groups "raft-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to raft-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

cwcwf...@gmail.com

unread,
Sep 29, 2015, 12:51:01 PM9/29/15
to raft-dev
OK, I mean , first I want to add a new player called Agent to transmit RPC from Leader to Follower, and then I need to solve the problem that is how to elect the Agent. So I using K-means to divide one configuration(cluster) into 3. And then I elect an Agent as a   'leader'   in each cluster. So, I need to creat a new message(RPC) for transmit from Leader to Follower to elect this Agent.

And now 2 of these factors can influence the result of election----X,Y(coordinates). And I define these structs:
struct Tuple{
float X;
float Y;
};
vector<Tuple> clusters[k];

So, maybe clusters[0] contains 1 or 10 or 100 servers,I do not know, and how can I creat the mesage and how to set it ,in order to put the cluster[i][j].X, cluster[i][j].Y to the request in the new message(like request.set_cluster1(cluster[0]))..
在 2015年9月29日星期二 UTC+8下午4:49:26,Ayende Rahien写道:

Diego Ongaro

unread,
Oct 6, 2015, 2:08:10 AM10/6/15
to raft...@googlegroups.com
I also don't understand what you're trying to do. I think your question relates to serializing data into an RPC request. LogCabin using Google's Protocol Buffers library version 2 for this, which is documented here: https://developers.google.com/protocol-buffers/docs/proto . Your "struct Tuple" could be defined as a protobuf message, and the vector could be represented as a repeated field in the Request message.

-Diego
Reply all
Reply to author
Forward
0 new messages