Examples of ByteArrayCallback


Examples of org.voltcore.zk.ZKUtil.ByteArrayCallback

     * Update a modified child and republish a new snapshot. This may indicate
     * a deleted child or a child with modified data.
     */
    private void processChildEvent(WatchedEvent event) throws Exception {
        HashMap<Integer, Long> cacheCopy = new HashMap<Integer, Long>(m_publicCache);
        ByteArrayCallback cb = new ByteArrayCallback();
        m_zk.getData(event.getPath(), m_childWatch, cb, null);
        try {
            // cb.getData() and cb.getPath() throw KeeperException
            byte payload[] = cb.getData();
            long HSId = Long.valueOf(new String(payload, "UTF-8"));
            cacheCopy.put(getPartitionIdFromZKPath(cb.getPath()), HSId);
        } catch (KeeperException.NoNodeException e) {
            // rtb: I think result's path is the same as cb.getPath()?
            cacheCopy.remove(getPartitionIdFromZKPath(event.getPath()));
        }
        m_publicCache = ImmutableMap.copyOf(cacheCopy);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.