Search in sources :

Example 86 with ObjectNode

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode in project heron by twitter.

the class MarathonScheduler method getFetchList.

protected ArrayNode getFetchList(ObjectMapper mapper) {
    String heronCoreURI = Context.corePackageUri(config);
    String topologyURI = Runtime.topologyPackageUri(runtime).toString();
    String[] uris = new String[] { heronCoreURI, topologyURI };
    ArrayNode urisNode = mapper.createArrayNode();
    for (String uri : uris) {
        ObjectNode uriObject = mapper.createObjectNode();
        uriObject.put(MarathonConstants.URI, uri);
        uriObject.put(MarathonConstants.EXECUTABLE, false);
        uriObject.put(MarathonConstants.EXTRACT, true);
        uriObject.put(MarathonConstants.CACHE, false);
        urisNode.add(uriObject);
    }
    return urisNode;
}
Also used : ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) ArrayNode(com.fasterxml.jackson.databind.node.ArrayNode)

Example 87 with ObjectNode

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode in project asterixdb by apache.

the class NodesRESTAPIFunction method enhanceSummaries.

private static ArrayNode enhanceSummaries(final ArrayNode summaries, String host, String servletPath) throws URISyntaxException {
    for (int i = 0; i < summaries.size(); ++i) {
        ObjectNode node = (ObjectNode) summaries.get(i);
        URI detailsUri = JSONOutputRequestUtil.uri(host, servletPath, node.get("node-id").asText());
        node.put("details", detailsUri.toString());
    }
    return summaries;
}
Also used : ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) URI(java.net.URI)

Example 88 with ObjectNode

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode in project asterixdb by apache.

the class ARecordType method toJSON.

@Override
public ObjectNode toJSON() {
    ObjectMapper om = new ObjectMapper();
    ObjectNode type = om.createObjectNode();
    type.put("type", ARecordType.class.getName());
    type.put("name", typeName);
    if (isOpen) {
        type.put("open", true);
    } else {
        type.put("open", false);
    }
    ArrayNode fields = om.createArrayNode();
    for (int i = 0; i < fieldNames.length; i++) {
        ObjectNode field = om.createObjectNode();
        field.set(fieldNames[i], fieldTypes[i].toJSON());
        fields.add(field);
    }
    type.set("fields", fields);
    return type;
}
Also used : ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) ArrayNode(com.fasterxml.jackson.databind.node.ArrayNode) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Example 89 with ObjectNode

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode in project asterixdb by apache.

the class AUnionType method toJSON.

@Override
public ObjectNode toJSON() {
    ObjectMapper om = new ObjectMapper();
    ObjectNode type = om.createObjectNode();
    type.put("type", AUnionType.class.getName());
    ArrayNode fields = om.createArrayNode();
    Iterator<IAType> iter = unionList.iterator();
    if (iter.hasNext()) {
        IAType t0 = iter.next();
        fields.add(t0.toJSON());
        while (iter.hasNext()) {
            fields.add(iter.next().toJSON());
        }
    }
    type.set("fields", fields);
    return type;
}
Also used : ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) ArrayNode(com.fasterxml.jackson.databind.node.ArrayNode) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Example 90 with ObjectNode

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode in project asterixdb by apache.

the class AUnorderedListType method toJSON.

@Override
public ObjectNode toJSON() {
    ObjectMapper om = new ObjectMapper();
    ObjectNode type = om.createObjectNode();
    type.put("type", AUnorderedListType.class.getName());
    type.set("item-type", itemType.toJSON());
    return type;
}
Also used : ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Aggregations

ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)2446 JsonNode (com.fasterxml.jackson.databind.JsonNode)556 Test (org.junit.Test)556 ArrayNode (com.fasterxml.jackson.databind.node.ArrayNode)509 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)370 IOException (java.io.IOException)214 ArrayList (java.util.ArrayList)119 HashMap (java.util.HashMap)107 Map (java.util.Map)106 List (java.util.List)96 StringEntity (org.apache.http.entity.StringEntity)94 Deployment (org.activiti.engine.test.Deployment)85 Test (org.testng.annotations.Test)81 CloseableHttpResponse (org.apache.http.client.methods.CloseableHttpResponse)69 ProcessInstance (org.activiti.engine.runtime.ProcessInstance)65 HttpPost (org.apache.http.client.methods.HttpPost)57 AbstractRpcLwM2MIntegrationTest (org.thingsboard.server.transport.lwm2m.rpc.AbstractRpcLwM2MIntegrationTest)54 TextNode (com.fasterxml.jackson.databind.node.TextNode)52 File (java.io.File)51 Task (org.activiti.engine.task.Task)51