register stats
This commit is contained in:
parent
156ed948b1
commit
e2bb71d18c
|
@ -1,20 +1,23 @@
|
|||
package common;
|
||||
public enum EMSGID
|
||||
{
|
||||
nr_read, //WebApp send read request to R-Memcached
|
||||
nr_read_res, //R-Memcached respond read request from WebServer
|
||||
nr_write, //WebApp send write request to R-Memcached
|
||||
nr_read,
|
||||
nr_read_res,
|
||||
nr_write,
|
||||
nr_write_copy,
|
||||
nr_write_res, //R-Memcached respond write request from WebServer
|
||||
nr_connected_mem, //Init connection channel between WebApp and R-Memcached
|
||||
nr_write_res,
|
||||
nr_connected_mem,
|
||||
nr_connected_mem_back,
|
||||
|
||||
nm_connected, //Init connection channel between R-Memcached and R-Memcached
|
||||
nm_connected,
|
||||
nm_connected_mem_back,
|
||||
nm_connected_web_back,
|
||||
nm_read, //R-Memcached send read request to another R-Memcached
|
||||
nm_read_recovery, //data recovery
|
||||
nm_write_1, //write phase 1
|
||||
nm_read,
|
||||
nm_read_recovery,
|
||||
nm_write_1,
|
||||
nm_write_1_res,
|
||||
nm_write_2 //write phase 2
|
||||
nm_write_2,
|
||||
|
||||
nr_stats,
|
||||
nr_stats_res
|
||||
}
|
||||
|
|
|
@ -11,29 +11,31 @@ import messageBody.memcachedmsg.nm_write_1_res;
|
|||
import messageBody.memcachedmsg.nm_write_2;
|
||||
import messageBody.requestMsg.nr_Connected_mem;
|
||||
import messageBody.requestMsg.nr_Read;
|
||||
import messageBody.requestMsg.nr_Stats;
|
||||
import messageBody.requestMsg.nr_write;
|
||||
|
||||
import com.google.protobuf.GeneratedMessage;
|
||||
|
||||
public class RegisterHandler {
|
||||
public static void initHandler() // register all messages created by
|
||||
// protobuf and will be handled by R-Memcached
|
||||
{
|
||||
|
||||
public class RegisterHandler
|
||||
{
|
||||
public static void initHandler()
|
||||
{
|
||||
initHandler(EMSGID.nm_connected.ordinal(), nm_Connected.class);
|
||||
initHandler(EMSGID.nm_connected_mem_back.ordinal(),
|
||||
nm_Connected_mem_back.class);
|
||||
initHandler(EMSGID.nm_connected_mem_back.ordinal(), nm_Connected_mem_back.class);
|
||||
initHandler(EMSGID.nr_connected_mem.ordinal(), nr_Connected_mem.class);
|
||||
initHandler(EMSGID.nr_stats.ordinal(), nr_Stats.class);
|
||||
initHandler(EMSGID.nr_read.ordinal(), nr_Read.class);
|
||||
initHandler(EMSGID.nm_read.ordinal(), nm_read.class);
|
||||
initHandler(EMSGID.nm_read_recovery.ordinal(), nm_read_recovery.class);
|
||||
initHandler(EMSGID.nr_write.ordinal(), nr_write.class);
|
||||
initHandler(EMSGID.nm_write_1.ordinal(), nm_write_1.class);
|
||||
initHandler(EMSGID.nm_write_1_res.ordinal(), nm_write_1_res.class);
|
||||
initHandler(EMSGID.nm_write_2.ordinal(), nm_write_2.class);
|
||||
}
|
||||
|
||||
private static void initHandler(int id,
|
||||
Class<? extends GeneratedMessage> msgCla) {
|
||||
initHandler(EMSGID.nm_write_2.ordinal(), nm_write_2.class);
|
||||
}
|
||||
|
||||
private static void initHandler(int id, Class<? extends GeneratedMessage> msgCla)
|
||||
{
|
||||
try {
|
||||
MessageManager.addMessageCla(id, msgCla);
|
||||
} catch (NoSuchMethodException e) {
|
||||
|
@ -52,5 +54,5 @@ public class RegisterHandler {
|
|||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue