/** * the node count of the datatree * @return the node count of datatree */ public int getNodeCount() { return dataTree.getNodeCount(); }
public int getNodeCount() { return dataTree.getNodeCount(); }
/** * the node count of the datatree * @return the node count of datatree */ public int getNodeCount() { return dataTree.getNodeCount(); }
public int getNodeCount() { return dataTree.getNodeCount(); }
private long printZnodeDetails(DataTree dataTree, boolean dumpData) { System.out.println(String.format( "ZNode Details (count=%d):", dataTree.getNodeCount() )); final long zxid = printZnode(dataTree, "/", dumpData); System.out.println("----"); return zxid; }
private void printZnodeDetails(DataTree dataTree) { System.out.println(String.format("ZNode Details (count=%d):", dataTree.getNodeCount())); printZnode(dataTree, "/"); System.out.println("----"); }
private static void serializeTree(int depth, int width, int len) throws InterruptedException, IOException, KeeperException.NodeExistsException, KeeperException.NoNodeException { DataTree tree = new DataTree(); createNodes(tree, "/", depth, width, tree.getNode("/").stat.getCversion(), new byte[len]); int count = tree.getNodeCount(); BinaryOutputArchive oa = BinaryOutputArchive.getArchive(new NullOutputStream()); System.gc(); long start = System.nanoTime(); tree.serialize(oa, "test"); long end = System.nanoTime(); long durationms = (end - start)/1000000L; long pernodeus = ((end - start)/1000L)/count; LOG.info("Serialized " + count + " nodes in " + durationms + " ms (" + pernodeus + "us/node), depth=" + depth + " width=" + width + " datalen=" + len); }
private static void deserializeTree(int depth, int width, int len) throws InterruptedException, IOException, KeeperException.NodeExistsException, KeeperException.NoNodeException { BinaryInputArchive ia; int count; { DataTree tree = new DataTree(); SerializationPerfTest.createNodes(tree, "/", depth, width, tree.getNode("/").stat.getCversion(), new byte[len]); count = tree.getNodeCount(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); BinaryOutputArchive oa = BinaryOutputArchive.getArchive(baos); tree.serialize(oa, "test"); baos.flush(); ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); ia = BinaryInputArchive.getArchive(bais); } DataTree dserTree = new DataTree(); System.gc(); long start = System.nanoTime(); dserTree.deserialize(ia, "test"); long end = System.nanoTime(); long durationms = (end - start) / 1000000L; long pernodeus = ((end - start) / 1000L) / count; Assert.assertEquals(count, dserTree.getNodeCount()); LOG.info("Deserialized " + count + " nodes in " + durationms + " ms (" + pernodeus + "us/node), depth=" + depth + " width=" + width + " datalen=" + len); }
/** * the node count of the datatree * @return the node count of datatree */ public int getNodeCount() { return dataTree.getNodeCount(); }
public int getNodeCount() { return dataTree.getNodeCount(); }