get get_children方法
来源:互联网 发布:mysql递归 编辑:程序博客网 时间:2024/06/05 05:31
get 方法:[root@wx03 zook]# cat a4.pl use ZooKeeper;use AnyEvent;use AE;use Data::Dumper; my $zk = ZooKeeper->new(hosts => '127.0.0.1:2181'); my $stat = $zk->exists('/zk/child600'); if ($stat){ $zk->delete('/zk/child600'); } my $created_path = $zk->create('/zk/child600', 'child600', ephemeral => 1, sequential => 1, 'acl' => ZOO_OPEN_ACL_UNSAFE); ###获取数据 my ($data,$stat)=$zk->get('/zk'); print $data;[root@wx03 zook]# perl a4.pl Odd number of elements in hash assignment at /usr/local/perl/lib/site_perl/5.22.1/x86_64-linux/ZooKeeper.pm line 392.myData[root@wx03 zook]#get_child 方法: my $zk = ZooKeeper->new(hosts => '127.0.0.1:2181'); my $stat = $zk->exists('/zk/child600'); if ($stat){ $zk->delete('/zk/child600'); } my $created_path = $zk->create('/zk/child600', 'child600', ephemeral => 1, sequential => 1, 'acl' => ZOO_OPEN_ACL_UNSAFE); ###获取数据 my (@data,$stat)=$zk->get_children('/zk'); foreach (@data){ print "\$_ is $_\n"; };[root@wx03 zook]# perl a4.pl Odd number of elements in hash assignment at /usr/local/perl/lib/site_perl/5.22.1/x86_64-linux/ZooKeeper.pm line 392.$_ is child500$_ is child700$_ is child600$_ is test$_ is child300$_ is child1$_ is child200获取child 子节点的值:[root@wx03 zook]# cat a4.pl use ZooKeeper;use AnyEvent;use AE;use Data::Dumper; my $zk = ZooKeeper->new(hosts => '127.0.0.1:2181'); my $stat = $zk->exists('/zk/child600'); if ($stat){ $zk->delete('/zk/child600'); } my $created_path = $zk->create('/zk/child600', 'child600', ephemeral => 1, sequential => 1, 'acl' => ZOO_OPEN_ACL_UNSAFE); ###获取数据 my (@data,$stat)=$zk->get_children('/zk'); foreach (@data){ print "\$_ is $_\n"; print $zk->get("/zk/$_"); print "\n"; };[root@wx03 zook]# perl a4.pl Odd number of elements in hash assignment at /usr/local/perl/lib/site_perl/5.22.1/x86_64-linux/ZooKeeper.pm line 392.$_ is test2d4rwrHASH(0x14d0e28)$_ is child600HASH(0x14e5f38)$_ is testaaaHASH(0x14e5f38)$_ is test1dadadHASH(0x14e5f38)
0 0
- get get_children方法
- WP程序函数:get_children()使用介绍
- get方法
- get方法
- get方法
- get方法
- $.get()方法
- get与post方法
- HTTP Get 方法
- javascript get find 方法
- Http方法 GET/POST
- Flex get set方法
- jquery的get方法
- hibernate的get方法
- ext.get 方法介绍。
- get与post方法 .
- JQuery--Ajax--get方法
- httpClient中的GET方法
- fopen函数使用
- 多网卡情况下如何正确获得IP
- 1017. A除以B (20)--做题纪录
- poj 1987 Distance Statistics 点分治
- bzoj 3894(最小割)
- get get_children方法
- jvisualvm远程监控Tomcat
- 使用SpringAop 验证方法参数是否合法
- 向服务器端发送请求 GET POST
- spark aggregateByKey函数执行结果异常问题
- Integer Break
- 作业五
- shell 的ftp简单应用
- 搭建Spring所需的各类jar包汇总详解