Package backtype.storm.tuple

Examples of backtype.storm.tuple.Values


      _secondRelationStorageNewEpoch = new TupleStorage();
      createIndexes(2, false, true);// reinitialize untagged
    }

    if (_isMigratingRelationStorage || _isMigratingTaggedRelationStorage) {
      final Values tplSend = new Values("N/A", MyUtilities.stringToTuple(
          SystemParameters.ThetaJoinerMigrationSignal, getConf()), "N/A", -1);
      appendTimestampZero(tplSend);
      getCollector().emit(SystemParameters.ThetaDataMigrationJoinerToReshuffler, tplSend);
    } else {
      LOG.info(getID() + " joiner: " + _thisTaskIDindex + " D-M-E-E-O-F is being emitted"
          + " actualID: " + _thisTaskID);
      final Values tplSend = new Values("N/A", MyUtilities.stringToTuple(
          SystemParameters.ThetaJoinerDataMigrationEOF, getConf()), "N/A", -1);
      appendTimestampZero(tplSend);
      getCollector().emit(SystemParameters.ThetaDataMigrationJoinerToReshuffler, tplSend);
    }
  }
View Full Code Here


            }
            String messageId = tweetJson.optString("id");
            if (messageId == null) {
                return;
            }
            this.collector.emit(new Values(tweetJson.toString()), messageId);
        } catch (IOException e) {
            throw new LumifyException("Could not read file: " + fileName);
        }
    }
View Full Code Here

            ResponseList<Status> timeline = twitter.getHomeTimeline();
            for (Status status : timeline) {
                long tweetId = status.getId();
                String raw = TwitterObjectFactory.getRawJSON(status);
                LOGGER.debug("received tweet to process: %d", tweetId);
                collector.emit(new Values(raw), tweetId);
            }
            LOGGER.info("sleeping for %dms", DELAY_TIME);
            Utils.sleep(DELAY_TIME); // Sleep 15 minutes and then pool again
        } catch (TwitterException e) {
            collector.reportError(e);
View Full Code Here

                Utils.sleep(1000);
                return;
            }
            JSONObject json = new JSONObject(new String(delivery.getBody()));
            LOGGER.debug("emit (%s): %s", this.queueName, json.toString());
            this.collector.emit(new Values(json.toString()), delivery.getEnvelope().getDeliveryTag());
        } catch (InterruptedException ex) {
            LOGGER.error("Could not consume", ex);
            this.collector.reportError(ex);
        }
    }
View Full Code Here

            String tweet = tweetsToProcess.take();
            Matcher m = TWEET_ID_PATTERN.matcher(tweet);
            if (m.find()) {
                String tweetId = m.group(1);
                LOGGER.debug("received tweet to process: %s", tweetId);
                collector.emit(new Values(tweet), tweetId);
            } else {
                LOGGER.warn("Could not parse tweet id from: %s", tweet);
            }
        } catch (InterruptedException e) {
            collector.reportError(e);
View Full Code Here

    _currentDimExcDis = getNewMapping(_currentAction);
    LOG.info(_ID + ":" + _taskPhysicalID
        + " :Reshuffler (sending STOP) & current mapping changing to : "
        + _currentAction.toString() + " with epoch number:" + _currentEpochNumber);
    updateLogicalMappings();
    _collector.emit(SystemParameters.ThetaReshufflerSignal, new Values(
        SystemParameters.ThetaSignalStop, actionString));

  }
View Full Code Here

  protected void processMigrationEOF(Tuple stormTupleRcv) {
    _numRemainingParentsForDMEOF--;
    // LOG.info(_componentName+":"+_taskID+" :Reshuffler received one DMEOF remaining:"+_numRemainingParentsForDMEOF+" Buffered Storage:"+bufferedTuples.size());
    if (_numRemainingParentsForDMEOF == 0) {
      LOG.info(_componentName + " :Reshuffler emitting received last DEMOF");
      _collector.emit(SystemParameters.ThetaReshufflerSignal, new Values(
          SystemParameters.ThetaSignalDataMigrationEnded, "N/A"));// has to be broadcasted
      _numRemainingParentsForDMEOF = _numOfJoinWorkersTasks; // restart the counter
    }
    _collector.ack(stormTupleRcv);
View Full Code Here

  }

  protected void processMigrationSignal(Tuple stormTupleRcv) {
    final int sentFromTaskId = stormTupleRcv.getSourceTask();
    final Values tplSend = new Values("N/A", MyUtilities.stringToTuple(
        SystemParameters.ThetaJoinerMigrationSignal, _conf), "N/A", -1, "N/A");
    appendTimestampMigration(stormTupleRcv, tplSend);
    _collector.emitDirect(sentFromTaskId,
        SystemParameters.ThetaDataMigrationReshufflerToJoiner, tplSend);
    _collector.ack(stormTupleRcv);
View Full Code Here

      LOG.info(_componentName + " :synchronizer emitting Datamigration ended"
          + " with epoch number:" + _currentEpochNumber + " (" + _mAdvisor.totalRowTuples
          + "," + _mAdvisor.totalColumnTuples + ")");
      for (int i = 1; i < _resufflerIndex.size(); i++)
        _collector.emitDirect(_resufflerIndex.get(i),
            SystemParameters.ThetaSynchronizerSignal, new Values(
                SystemParameters.ThetaSignalDataMigrationEnded, "N/A")); // emit the proceed signal
      // **************************Local changes
      _currentState = state.NORMAL;
      // check if isFinalAcked=true --> emit LAST_ACK
      if (_isFinalAckReceived && !_isFinalAckSent) {
View Full Code Here

    else if (_secondEmitterIndex.equals(inputComponentIndex))
      taskIndices = _currentAction.getColumnExchangeReducersByNewId(sourceID);
    else
      throw new RuntimeException("inputComponentIndex does not conform with any relation");
    for (int i = 0; i < taskIndices.length; i++) {
      final Values tplSend = new Values(inputComponentIndex, MyUtilities.stringToTuple(
          inputTupleString, _conf), inputTupleHash, _currentEpochNumber,
          _currentDimExcDis);
      appendTimestampMigration(stormTupleRcv, tplSend);
      _collector.emitDirect(_taskPhysicalMapping.get(fooLogicalMappings(logicalMappings, taskIndices[i])),
          SystemParameters.ThetaDataMigrationReshufflerToJoiner, tplSend);
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.