public Plan findPlanByName ( String name ) throws WorkerDaoException { Stat planStat ; byte [ ] planBytes ; try { planStat = framework . getCuratorFramework ( ) . checkExists ( ) . forPath ( PLANS_ZK + "/" + name ) ; if ( planStat == null ) { return null ; } planBytes = framework . getCuratorFramework ( ) . getData ( ) . forPath ( PLANS_ZK + "/" + name ) ; } catch ( Exception e ) { LOGGER . warn ( e ) ; throw new WorkerDaoException ( e ) ; } Plan p = null ; try { p = deserializePlan ( planBytes ) ; } catch ( JsonParseException | JsonMappingException e ) { LOGGER . warn ( "while parsing plan " + name , e ) ; } catch ( IOException e ) { LOGGER . warn ( "while parsing plan " + name , e ) ; } return p ; }
Search zookeeper for a plan with given name .