/** * Write the commit time into the document. * * @param commitTime * The commit time. */ public void commit(final long commitTime) throws IOException { // Total elapsed milliseconds from start of update request. final long totalElapsedMillis = TimeUnit.NANOSECONDS .toMillis(System.nanoTime() - begin); body.node("p") .text("COMMIT: totalElapsed=" + totalElapsedMillis + "ms, commitTime=" + commitTime + ", mutationCount=" + mutationCount.get())// .close(); }
/** * Write the commit time into the document. * * @param commitTime * The commit time. */ public void commit(final long commitTime) throws IOException { // Total elapsed milliseconds from start of update request. final long totalElapsedMillis = TimeUnit.NANOSECONDS .toMillis(System.nanoTime() - begin); body.node("p") .text("COMMIT: totalElapsed=" + totalElapsedMillis + "ms, commitTime=" + commitTime + ", mutationCount=" + mutationCount.get())// .close(); }
/** * @todo This does not actually test anything. You have to inspect the * output. */ public void testXMLBuilder() throws IOException { final StringWriter w = new StringWriter(); final XMLBuilder xml = new XMLBuilder(w); XMLBuilder.Node close = xml.root("data") .attr("id", "TheRoot") .attr("name", "Test") .node("child", "My Child") .node("child") .attr("name", "My Child") .close() .node("child") .attr("name", "My Child") .text("Content") .close() .close(); assertTrue(close == null); if(log.isInfoEnabled()) log.info(w.toString()); }
current.node("th").text("object").close(); current.node("th").text("category").close(); current.node("th").text("elapsed [ms]").close(); current.node("th").text("elapsed [us]").close(); current.node("th").text("numCalls").close(); if (pStat != null) { current = current.node("tr"); current.node("td").text(pStat.getStatName()).close(); current.node("td").text("Parser").close(); current.node("td").text(String.valueOf(pStat.getElapsed() / 1000000)).close(); current.node("td").text(String.valueOf(pStat.getElapsed() / 1000)).close(); current.node("td").text(String.valueOf(pStat.getNrCalls())).close(); if (rStat != null) { current = current.node("tr"); current.node("td").text(rStat.getStatName()).close(); current.node("td").text("Resolve Values").close(); current.node("td").text(String.valueOf(rStat.getElapsed() / 1000000)).close(); current.node("td").text(String.valueOf(rStat.getElapsed() / 1000)).close(); current.node("td").text(String.valueOf(rStat.getNrCalls())).close(); if (lStat != null) { current = current.node("tr"); current.node("td").text(lStat.getStatName()).close(); current.node("td").text("Optimizers (all)").close(); current.node("td").text(String.valueOf(lStat.getElapsed() / 1000000)).close(); current.node("td").text(String.valueOf(lStat.getElapsed() / 1000)).close(); current.node("td").text(String.valueOf(lStat.getNrCalls())).close();
current.node("th").text("object").close(); current.node("th").text("category").close(); current.node("th").text("elapsed [ms]").close(); current.node("th").text("elapsed [us]").close(); current.node("th").text("numCalls").close(); if (pStat != null) { current = current.node("tr"); current.node("td").text(pStat.getStatName()).close(); current.node("td").text("Parser").close(); current.node("td").text(String.valueOf(pStat.getElapsed() / 1000000)).close(); current.node("td").text(String.valueOf(pStat.getElapsed() / 1000)).close(); current.node("td").text(String.valueOf(pStat.getNrCalls())).close(); if (rStat != null) { current = current.node("tr"); current.node("td").text(rStat.getStatName()).close(); current.node("td").text("Resolve Values").close(); current.node("td").text(String.valueOf(rStat.getElapsed() / 1000000)).close(); current.node("td").text(String.valueOf(rStat.getElapsed() / 1000)).close(); current.node("td").text(String.valueOf(rStat.getNrCalls())).close(); if (lStat != null) { current = current.node("tr"); current.node("td").text(lStat.getStatName()).close(); current.node("td").text("Optimizers (all)").close(); current.node("td").text(String.valueOf(lStat.getElapsed() / 1000000)).close(); current.node("td").text(String.valueOf(lStat.getElapsed() / 1000)).close(); current.node("td").text(String.valueOf(lStat.getNrCalls())).close();
if (buildVer == null ) buildVer = "N/A"; current.node("p").text("Build Version=").node("span") .attr("id", "buildVersion").text(buildVer).close() .close(); if (gitCommit == null || "${git.commit}".equals(gitCommit)) gitCommit = "N/A"; current.node("p").text("Build Git Commit=").node("span") .attr("id", "gitCommit").text(gitCommit).close() .close(); if (gitBranch == null || "${git.branch}".equals(gitBranch)) gitBranch = "N/A"; current.node("p").text("Build Git Branch=").node("span") .attr("id", "gitBranch").text(gitBranch).close() .close(); current.node("p").text("Accepted query count=") .node("span").attr("id", "accepted-query-count") .text("" +getBigdataRDFContext().getQueryIdFactory().get()) .close() .close(); current.node("p").text("Running query count=") .node("span").attr("id", "running-query-count") .text("" + getBigdataRDFContext().getQueries().size()).close() .close();
if (buildVer == null ) buildVer = "N/A"; current.node("p").text("Build Version=").node("span") .attr("id", "buildVersion").text(buildVer).close() .close(); if (gitCommit == null || "${git.commit}".equals(gitCommit)) gitCommit = "N/A"; current.node("p").text("Build Git Commit=").node("span") .attr("id", "gitCommit").text(gitCommit).close() .close(); if (gitBranch == null || "${git.branch}".equals(gitBranch)) gitBranch = "N/A"; current.node("p").text("Build Git Branch=").node("span") .attr("id", "gitBranch").text(gitBranch).close() .close(); current.node("p").text("Accepted query count=") .node("span").attr("id", "accepted-query-count") .text("" +getBigdataRDFContext().getQueryIdFactory().get()) .close() .close(); current.node("p").text("Running query count=") .node("span").attr("id", "running-query-count") .text("" + getBigdataRDFContext().getQueries().size()).close() .close();
body.node("pre").text(thisOp.toString())// .close(); .text("totalElapsed=" + totalElapsedMillis + "ms, elapsed=" + elapsedMillis + "ms, parsed=" + parsed + ", tps=" pw.close(); body.node("p").text("ABORT").close()// .node("pre").text(e.getUpdate().toString()).close()// .node("pre").text(w.toString()).close()// .node("p").text("totalElapsed=" + totalElapsedMillis + "ms, elapsed=" + elapsedMillis + "ms") .close(); .text(e.getUpdate().toString()) .close(); .text("totalElapsed=" + totalElapsedMillis + "ms, elapsed=" + elapsedMillis + "ms, connFlush="+TimeUnit.NANOSECONDS.toMillis(e.getConnectionFlushNanos())//
.text("solutions=").node("span").attr("class", "solutions") .text(""+ solutionsOut).close() .text(", chunks=").node("span").attr("class", "chunks") .text(""+ chunksOut).close() .text(", children=").node("span").attr("class", "children") .text("" + children.length).close() current.node("p").attr("class", "query-string").text(queryString) .close(); .text(parseTree.dump("")).close(); .text(originalAST.toString()).close(); .text(optimizedAST.toString()).close(); .text(BOpUtility.toString(queryPlan)).close();
body.node("pre").text(thisOp.toString())// .close(); .text("totalElapsed=" + totalElapsedMillis + "ms, elapsed=" + elapsedMillis + "ms, parsed=" + parsed + ", tps=" pw.close(); body.node("p").text("ABORT").close()// .node("pre").text(e.getUpdate().toString()).close()// .node("pre").text(w.toString()).close()// .node("p").text("totalElapsed=" + totalElapsedMillis + "ms, elapsed=" + elapsedMillis + "ms") .close(); .text(e.getUpdate().toString()) .close(); .text("totalElapsed=" + totalElapsedMillis + "ms, elapsed=" + elapsedMillis + "ms, connFlush="+TimeUnit.NANOSECONDS.toMillis(e.getConnectionFlushNanos())//
.attr("class", "update") .text("elapsed=").node("span") .attr("class", "elapsed").text("" + elapsedMillis).close() .text("ms") .text(", ").text("mutationCount=").node("span") .attr("class", "mutationCount").text("" + mutationCount).close() .text(", ").node("a").attr("href", detailsURL) .text(queryString).close(); .text(parseTree.dump("")).close(); .text(originalAST.toString()).close();
.text("solutions=").node("span").attr("class", "solutions") .text(""+ solutionsOut).close() .text(", chunks=").node("span").attr("class", "chunks") .text(""+ chunksOut).close() .text(", children=").node("span").attr("class", "children") .text("" + children.length).close() .text(", elapsed=").node("span").attr("class", "elapsed") .text("" + elapsedMillis).close() .text("ms, ") .text("details").close()// .close(); current.node("p").attr("class", "query-string").text(queryString) .close(); .text(parseTree.dump("")).close(); .text(originalAST.toString()).close(); .text(optimizedAST.toString()).close(); .text(BOpUtility.toString(queryPlan)).close();
.attr("class", "update") .text("elapsed=").node("span") .attr("class", "elapsed").text("" + elapsedMillis).close() .text("ms") .text(", ").text("mutationCount=").node("span") .attr("class", "mutationCount").text("" + mutationCount).close() .text(", ").node("a").attr("href", detailsURL) .attr("class", "details-url") .text("details").close()// .close(); .text(queryString).close(); .text(parseTree.dump("")).close(); .text(originalAST.toString()).close();
/** * Generate an open element for the tag, output the indicated text, and * then output the closing element for that tag. * * @param tag * The tag (element name). * @param text * The text, which will be automatically encoded as * appropriate for a CDATA section. * * @return This {@link Node}. * * @throws IOException */ public Node node(final String tag, final String text) throws IOException { closeHead(); m_nodes++; final Node tmp = new Node(tag, this); tmp.text(text); final Node ret = tmp.close(); assert ret == this; return ret; }
/** * Generate an open element for the tag, output the indicated text, and * then output the closing element for that tag. * * @param tag * The tag (element name). * @param text * The text, which will be automatically encoded as * appropriate for a CDATA section. * * @return This {@link Node}. * * @throws IOException */ public Node node(final String tag, final String text) throws IOException { closeHead(); m_nodes++; final Node tmp = new Node(tag, this); tmp.text(text); final Node ret = tmp.close(); assert ret == this; return ret; }
/** * @todo This does not actually test anything. You have to inspect the * output. */ public void testXMLBuilder() throws IOException { final StringWriter w = new StringWriter(); final XMLBuilder xml = new XMLBuilder(w); XMLBuilder.Node close = xml.root("data") .attr("id", "TheRoot") .attr("name", "Test") .node("child", "My Child") .node("child") .attr("name", "My Child") .close() .node("child") .attr("name", "My Child") .text("Content") .close() .close(); assertTrue(close == null); if(log.isInfoEnabled()) log.info(w.toString()); }
public Node root(String name, String nodeText) throws IOException { Node root = new Node(name, null); root.text(nodeText); return root.close(); }
public Node root(String name, String nodeText) throws IOException { Node root = new Node(name, null); root.text(nodeText); return root.close(); }