Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package com.datatorrent.lib.io;
import java.io.IOException;
import java.lang.reflect.Array;
import java.net.URI;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.tuple.MutablePair;
import org.apache.commons.lang3.tuple.Pair;
import com.google.common.collect.Maps;
import com.datatorrent.api.Context.OperatorContext;
import com.datatorrent.api.DAG;
import com.datatorrent.api.DefaultInputPort;
import com.datatorrent.api.annotation.InputPortFieldAnnotation;
import com.datatorrent.common.util.BaseOperator;
import com.datatorrent.common.util.PubSubMessageCodec;
/**
* This operator outputs data in a format that can be displayed in DT UI widgets.
*
* There are 4 input ports each of which is compatible to one widget
*
simpleInput is used for simple input widget. It takes any object and push the toString() value to the UI
*
timeSeriesInput is used for a widget of bar chart of series number values at certain times. It takes a Long for time and a Number for value
*
percentageInput is used for either the percentage gadget or progress bar. It takes int value between 0 and 100 as input
*
topNInput is used for N key value table widget. It takes a Map as input
*
* By default it outputs data to WebSocket channel specified by DT gateway.
* If DT gateway is not specified, it will use output data to console.
*
* @displayName DT Widget Output
* @category Output
* @tags dt, output operator
*
* @since 0.9.3
*/
@org.apache.hadoop.classification.InterfaceStability.Evolving
public class WidgetOutputOperator extends BaseOperator
{
protected transient WebSocketOutputOperator> wsoo = new WebSocketOutputOperator>()
{
private transient PubSubMessageCodec