use of com.yahoo.text.XMLWriter in project vespa by vespa-engine.
the class Metric method toXml.
public String toXml(int secondsPassed, int verbosity) {
StringWriter writer = new StringWriter();
printXml(new XMLWriter(writer), secondsPassed, verbosity);
return writer.toString();
}
use of com.yahoo.text.XMLWriter in project vespa by vespa-engine.
the class QueryContext method render.
public boolean render(Writer writer) throws java.io.IOException {
if (owner.getTraceLevel() != 0) {
XMLWriter xmlWriter = XMLWriter.from(writer);
xmlWriter.openTag("meta").attribute("type", ID);
TraceNode traceRoot = owner.getModel().getExecution().trace().traceNode().root();
traceRoot.accept(new DefaultRenderer.RenderingVisitor(xmlWriter, owner.getStartTime()));
xmlWriter.closeTag();
}
return true;
}
use of com.yahoo.text.XMLWriter in project vespa by vespa-engine.
the class DefaultRenderer method queryContext.
@SuppressWarnings("UnusedParameters")
public void queryContext(XMLWriter writer, QueryContext queryContext, Query owner) throws IOException {
if (owner.getTraceLevel() != 0) {
XMLWriter xmlWriter = XMLWriter.from(writer);
xmlWriter.openTag("meta").attribute("type", QueryContext.ID);
TraceNode traceRoot = owner.getModel().getExecution().trace().traceNode().root();
traceRoot.accept(new RenderingVisitor(xmlWriter, owner.getStartTime()));
xmlWriter.closeTag();
}
}
use of com.yahoo.text.XMLWriter in project vespa by vespa-engine.
the class MetricResponse method render.
@Override
public void render(OutputStream stream) throws IOException {
XMLWriter writer = new XMLWriter(new OutputStreamWriter(stream));
writer.openTag("status");
set.printXml(writer, 0, 2);
writer.closeTag();
writer.flush();
}
use of com.yahoo.text.XMLWriter in project vespa by vespa-engine.
the class SearchRendererAdaptor method simpleRenderDefaultErrorHit.
public static boolean simpleRenderDefaultErrorHit(Writer writer, ErrorHit defaultErrorHit) throws IOException {
XMLWriter xmlWriter = (writer instanceof XMLWriter) ? (XMLWriter) writer : new XMLWriter(writer, 10, -1);
xmlWriter.openTag("errordetails");
for (Iterator i = defaultErrorHit.errorIterator(); i.hasNext(); ) {
ErrorMessage error = (ErrorMessage) i.next();
renderMessageDefaultErrorHit(xmlWriter, error);
}
xmlWriter.closeTag();
return true;
}
Aggregations