use of com.yahoo.slime.Cursor in project vespa by vespa-engine.
the class ContentHandler method createResponse.
private HttpResponse createResponse(ContentRequest request) {
Slime slime = new Slime();
Cursor root = slime.setObject();
root.setString("prepared", request.getUrlBase("/prepared"));
return new SessionResponse(slime, root);
}
use of com.yahoo.slime.Cursor in project vespa by vespa-engine.
the class ConfigChangeActionsSlimeConverter method refeedActionsToSlime.
private void refeedActionsToSlime(Cursor actionsCursor) {
Cursor refeedCursor = actionsCursor.setArray("refeed");
for (RefeedActions.Entry entry : actions.getRefeedActions().getEntries()) {
Cursor entryCursor = refeedCursor.addObject();
entryCursor.setString("name", entry.name());
entryCursor.setBool("allowed", entry.allowed());
entryCursor.setString("documentType", entry.getDocumentType());
entryCursor.setString("clusterName", entry.getClusterName());
messagesToSlime(entryCursor, entry.getMessages());
servicesToSlime(entryCursor, entry.getServices());
}
}
use of com.yahoo.slime.Cursor in project vespa by vespa-engine.
the class ConfigChangeActionsSlimeConverter method restartActionsToSlime.
private void restartActionsToSlime(Cursor actionsCursor) {
Cursor restartCursor = actionsCursor.setArray("restart");
for (RestartActions.Entry entry : actions.getRestartActions().getEntries()) {
Cursor entryCursor = restartCursor.addObject();
entryCursor.setString("clusterName", entry.getClusterName());
entryCursor.setString("clusterType", entry.getClusterType());
entryCursor.setString("serviceType", entry.getServiceType());
messagesToSlime(entryCursor, entry.getMessages());
servicesToSlime(entryCursor, entry.getServices());
}
}
use of com.yahoo.slime.Cursor in project vespa by vespa-engine.
the class SlimeTraceSerializer method addChildrenCursors.
private void addChildrenCursors(Cursor current, TraceNode node) {
Iterator<TraceNode> it = node.children().iterator();
if (it.hasNext()) {
Cursor childrenArray = current.setArray(CHILDREN);
while (it.hasNext()) {
cursors.push(childrenArray.addObject());
it.next();
}
}
}
use of com.yahoo.slime.Cursor in project vespa by vespa-engine.
the class SlimeTraceSerializer method visit.
@Override
public void visit(TraceNode node) {
Cursor current = cursors.pop();
current.setLong(TIMESTAMP, node.timestamp());
encodePayload(current, node.payload());
addChildrenCursors(current, node);
}
Aggregations