use of com.yahoo.text.Utf8String in project vespa by vespa-engine.
the class FeedResponse method render.
@Override
public void render(OutputStream outputStream) throws IOException {
if (!errorMessages.isEmpty())
setStatus(VespaHeaders.getStatus(false, errorMessages.get(0), errorMessages.iterator()));
XMLWriter writer = new XMLWriter(new OutputStreamWriter(outputStream));
writer.openTag("result");
if (metrics != null) {
metrics.printXml(writer, 0, 0);
}
if (traces.length() > 0) {
writer.openTag("trace");
writer.append(traces);
writer.closeTag();
}
if (!errors.isEmpty()) {
writer.openTag("errors");
writer.attribute(new Utf8String("count"), errors.size());
for (int i = 0; i < errors.size() && i < 10; ++i) {
writer.openTag("error");
writer.attribute(new Utf8String("message"), errors.get(i));
writer.closeTag();
}
writer.closeTag();
}
writer.closeTag();
writer.flush();
outputStream.close();
}
use of com.yahoo.text.Utf8String in project vespa by vespa-engine.
the class VespaDocumentDeserializer42 method readDocumentType.
public DocumentType readDocumentType() {
Utf8Array docTypeName = parseNullTerminatedString();
// used to hold the version
int ignored = getShort(null);
DocumentType docType = manager.getDocumentType(new DataTypeName(docTypeName));
if (docType == null) {
throw new DeserializationException("No known document type with name " + new Utf8String(docTypeName).toString());
}
return docType;
}
Aggregations