Package stream

Examples of stream.Data


   * @since 0.3.0
   * @version 0.3.0
   */
  public void update(java.util.Map<String, Serializable> values)
      throws Exception {
    final Data item = DataFactory.create();
    for (Entry<String, Serializable> entry : values.entrySet()) {
      item.put(entry.getKey().replace('`', ' ').trim(), entry.getValue());
    }
    write(item);
  }
View Full Code Here


   * @throws Exception
   * @version 0.3.0
   * @since 0.0.1
   */
  public void update(Serializable... values) throws Exception {
    final Data item = DataFactory.create();
    for (int i = 0; i < values.length; ++i) {
      item.put(_keys[i], values[i]);
    }
    //item.put(key, value);
    write(item);
  }
View Full Code Here

   * @since 0.0.1
   * @version 0.3.0
   */
  public void update(java.util.Map<String, Serializable> values)
      throws Exception {
    final Data item = DataFactory.create();
    for (Entry<String, Serializable> entry : values.entrySet()) {
      // TODO make this configurable
      item.put(entry.getKey().replace('`', ' ').trim(), entry.getValue());
    }
    write(item);
  }
View Full Code Here

      // Write the original item to the first sink and write copies
      // thereof to the following streams if any.
      // _log.debug("Updating subscriber {}, item {}", item);
      _sinksList[0].write(item);
      for (int s = 1; s < _sinksList.length; ++s) {
        final Data result = stream.data.DataFactory.copy(item);
        result.put(KEY_STREAM, _sinksListId[s]);
        // _log.debug("Updating subscriber {}, item {}", result);
        _sinksList[s].write(result);
      }
    }
  }
View Full Code Here

   * @return null, since this implementation works asynchronously.
   */
  @Override
  public Data process(Data input) {
    final String mapEventTypeName = (String) input.get("@stream");
    final Data event = input.createCopy();
    event.remove("@stream");
    event.remove("@stream:id");

    // If this event defines a start time, then adjust the current time if
    // necessary and replace the string value with the long value.
    final String startTimeKey = _startTimestampMap.get(mapEventTypeName);
    if (startTimeKey != null) {
      final long dataStartTime = Long.parseLong(input.get(startTimeKey)
          .toString());
      event.put(startTimeKey, dataStartTime);
      if (dataStartTime > _currentTime) {
        _currentTime = dataStartTime;
        final CurrentTimeEvent timeEvent = new CurrentTimeEvent(
            _currentTime);
        _log.debug("Sending time event new time: {}", _currentTime);
        _epRuntime.sendEvent(timeEvent);
      }
    }

    // If this event defines an end time, then replace the string value with
    // the long value.
    final String endTimeKey = _endTimestampMap.get(mapEventTypeName);
    if (endTimeKey != null) {
      final long dataEndTime = Long.parseLong(input.get(endTimeKey)
          .toString());
      event.put(endTimeKey, dataEndTime);
    }

    _epRuntime.sendEvent(event, mapEventTypeName);
    return null;
  }
View Full Code Here

   * @return null, since this implementation works asynchronously.
   */
  @Override
  public Data process(Data input) {
    final String mapEventTypeName = (String) input.get("@stream");
    final Data event = input.createCopy();
    event.remove("@stream");
    event.remove("@stream:id");

    // If this event defines a start time, then adjust the current time if
    // necessary and replace the string value with the long value.
    final String startTimeKey = _startTimestampMap.get(mapEventTypeName);
    if (startTimeKey != null) {
      final long dataStartTime = Long.parseLong(input.get(startTimeKey)
          .toString());
      event.put(startTimeKey, dataStartTime);
      if (dataStartTime > _currentTime) {
        _currentTime = dataStartTime;
        final CurrentTimeEvent timeEvent = new CurrentTimeEvent(
            _currentTime);
        _log.debug("Sending time event new time: {}", _currentTime);
        _epRuntime.sendEvent(timeEvent);
      }
    }

    // If this event defines an end time, then replace the string value with
    // the long value.
    final String endTimeKey = _endTimestampMap.get(mapEventTypeName);
    if (endTimeKey != null) {
      final long dataEndTime = Long.parseLong(input.get(endTimeKey)
          .toString());
      event.put(endTimeKey, dataEndTime);
    }

    _epRuntime.sendEvent(event, mapEventTypeName);
    return null;
  }
View Full Code Here

   *            the values of an Esper event.
   * @throws Exception
   */
  public void update(Object... values) throws Exception {
    synchronized (_sink) {
      Data item = DataFactory.create();
      for (int i = 0; i < values.length; ++i) {
        item.put(_keys[i], (Serializable) values[i]);
      }
      _log.debug("Updating subscriber {}, item {}", values, item);
      _sink.write(item);
    }
  }
View Full Code Here

TOP

Related Classes of stream.Data

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.