norbert是一个方便做CS模式的集群的JAVAAPI,norbert封装了zookeeper和netty,使用了协议栈缓存,基于SCALA开发
示例代码:
publicclassNorbertClient{publicstaticvoidmain(String[]args){ClusterClientcc=newZooKeeperClusterClient("norbert","localhost:2181",30000);(1)cc.awaiteConnectionUninterruptibly();(2)cc.getNodes();(3)cc.addListener(newMyClusterListener());(4)cc.markNodeAvailable(1);(5).cluster.shutdown(6)}}
评论