Search in sources :

Example 1 with SPLWindow

use of com.ibm.streamsx.topology.spl.SPLWindow in project streamsx.topology by IBMStreams.

the class RestServer method viewerSpl.

private String viewerSpl(TWindow<Tuple, ?> window, String context, String name) {
    assert window.getStream() instanceof SPLStream;
    SPLWindow splWindow = SPLStreams.triggerCount(window, 1);
    Map<String, Object> params = new HashMap<>();
    params.put("port", port);
    params.put("context", context);
    params.put("contextResourceBase", "opt/html/" + context);
    TSink tv = SPL.invokeSink(name, "com.ibm.streamsx.inet.rest::HTTPTupleView", splWindow, params);
    if (firstInvocation == null)
        firstInvocation = tv;
    else
        firstInvocation.colocate(tv);
    // so currently it's always port 0.
    return name + "/ports/input/0";
}
Also used : TSink(com.ibm.streamsx.topology.TSink) HashMap(java.util.HashMap) SPLWindow(com.ibm.streamsx.topology.spl.SPLWindow) JSONObject(com.ibm.json.java.JSONObject) SPLStream(com.ibm.streamsx.topology.spl.SPLStream)

Aggregations

JSONObject (com.ibm.json.java.JSONObject)1 TSink (com.ibm.streamsx.topology.TSink)1 SPLStream (com.ibm.streamsx.topology.spl.SPLStream)1 SPLWindow (com.ibm.streamsx.topology.spl.SPLWindow)1 HashMap (java.util.HashMap)1