libzookeeper icon indicating copy to clipboard operation
libzookeeper copied to clipboard

get function always return null

Open 599259501 opened this issue 6 years ago • 3 comments

but i can see data in zkClient

599259501 avatar Apr 13 '18 10:04 599259501

Could you please provide me a sample to help me reproduce this issue?

Timandes avatar Apr 13 '18 11:04 Timandes

`

  public function GetZkNodeData($svrIp, $path, &$msg){

	$zc = self::GetZkClient($svrIp, $msg);

	if (is_null($zc)){
		return "";
	}
	if (($data = $zc->get($path)) !== false){
		return $data;
	}

	$msg = "err!";
	return "";
 }

public static function GetZkClient($svrIp, &$msg){
	try{
		$zc = new ZookeeperClient();
		$zc->connect($svrIp);
	} catch(\Exception $e){
		$msg = $e->getMessage();
		return null;
	}
	return $zc;
}

`

599259501 avatar Apr 13 '18 11:04 599259501

What about version info? :)

Timandes avatar Apr 14 '18 13:04 Timandes