Package backtype.storm.tuple

Examples of backtype.storm.tuple.Values


  private void sendEOF() {
    if (MyUtilities.isAckEveryTuple(_conf))
      if (_pendingTuples == 0)
        if (!_hasSentEOF) {
          _hasSentEOF = true;
          _collector.emit(SystemParameters.EOF_STREAM, new Values(SystemParameters.EOF));
        }
  }
View Full Code Here


    if (relIndex == 1)
      index = _componentIndexRel1;
    else
      index = _componentIndexRel2;

    final Values stormTupleSnd = MyUtilities.createTupleValues(tuple, 0, index, _hashIndexes,
        _hashExpressions, _conf);
    MyUtilities.sendTuple(stormTupleSnd, _collector, _conf);
  }
View Full Code Here

      _targetBuffers[i] = new StringBuffer("");

      if (!tupleString.isEmpty())
        // some buffers might be empty
        if (MyUtilities.isCustomTimestampMode(_conf))
          _collector.emit(new Values(_componentIndex, tupleString, _targetTimestamps[i]));
        else
          _collector.emit(new Values(_componentIndex, tupleString));
    }
  }
View Full Code Here

        .equalsIgnoreCase(SystemParameters.DUMP_RESULTS_STREAM);
  }

  // non-ManualBatchMode
  private void regularTupleSend(List<String> tuple, Tuple stormTupleRcv, long timestamp) {
    final Values stormTupleSnd = MyUtilities.createTupleValues(tuple, timestamp,
        _componentIndex, _hashIndexes, _hashExpressions, _conf);
    MyUtilities.sendTuple(stormTupleSnd, stormTupleRcv, _collector, _conf);
  }
View Full Code Here

      List<ValueExpression> hashExpressions, Map conf) {

    final String outputTupleHash = MyUtilities.createHashString(tuple, hashIndexes,
        hashExpressions, conf);
    if (MyUtilities.isCustomTimestampMode(conf))
      return new Values(componentIndex, tuple, outputTupleHash, timestamp);
    else
      return new Values(componentIndex, tuple, outputTupleHash);
  }
View Full Code Here

    else
      return new Values(componentIndex, tuple, outputTupleHash);
  }

  public static Values createUniversalFinalAckTuple(Map map) {
    final Values values = new Values();
    values.add("N/A");
    if (!MyUtilities.isManualBatchingMode(map)) {
      final List<String> lastTuple = new ArrayList<String>(
          Arrays.asList(SystemParameters.LAST_ACK));
      values.add(lastTuple);
      values.add("N/A");
    } else
      values.add(SystemParameters.LAST_ACK);
    if (MyUtilities.isCustomTimestampMode(map))
      values.add(0);
    return values;
  }
View Full Code Here

    if (numRemainingParents == 0)
      // this task received from all the parent tasks
      // SystemParameters.LAST_ACK
      if (hierarchyPosition != StormComponent.FINAL_COMPONENT) {
        // if this component is not the last one
        final Values values = createUniversalFinalAckTuple(conf);
        collector.emit(values);
      } else
        collector.emit(SystemParameters.EOF_STREAM, new Values(SystemParameters.EOF));
    collector.ack(stormTupleRcv);
  }
View Full Code Here

        // timestamp has to be removed
        final String parts[] = tupleString.split("\\@");
        lineageTimestamp = Long.valueOf(new String(parts[0]));
        tupleString = new String(parts[1]);
      }
      final Values tplSend = new Values(emitterIndex, MyUtilities.stringToTuple(tupleString,
          getConf()), "N/A", _currentEpochNumber);
      appendTimestampExisting(tplSend, lineageTimestamp);

      getCollector().emit(SystemParameters.ThetaDataMigrationJoinerToReshuffler, tplSend);
    }
View Full Code Here

              + " has reached end of DataMigration" + " actualID: " + _thisTaskID
              + " got:" + _currentNumberOfAckedReshufflerWorkersTasks + "/"
              + _numParentTasks);
          _currentNumberOfAckedReshufflerWorkersTasks = 0;
          getCollector().emitDirect(_AdvisorIndex, SystemParameters.ThetaJoinerAcks,
              new Values(SystemParameters.ThetaAckDataMigrationEnded));
        }
      }
    }
    /**
     * Case 2 or 3) tuples only from the reshuffler; either
View Full Code Here

            _migratingTaggedRelationCursor, endIndex);
        _migratingTaggedRelationCursor += migrationBufferSize;
      }

    if (_isMigratingRelationStorage == true || _isMigratingTaggedRelationStorage == true) {
      final Values tplSend = new Values("N/A", MyUtilities.stringToTuple(
          SystemParameters.ThetaJoinerMigrationSignal, getConf()), "N/A", -1);
      appendTimestampZero(tplSend);
      getCollector().emit(SystemParameters.ThetaDataMigrationJoinerToReshuffler, tplSend);
    } else {
      final Values tplSend = new Values("N/A", MyUtilities.stringToTuple(
          SystemParameters.ThetaJoinerDataMigrationEOF, getConf()), "N/A", -1);
      appendTimestampZero(tplSend);
      getCollector().emit(SystemParameters.ThetaDataMigrationJoinerToReshuffler, tplSend);
    }
    getCollector().ack(stormTupleRcv);
View Full Code Here

TOP

Related Classes of backtype.storm.tuple.Values

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.