Package backtype.storm.tuple

Examples of backtype.storm.tuple.Values


    }

    final int[] taskIndices = Advisor.getAssignedReducers(isFirstRel, _numOfJoinWorkersTasks,
        currDim[0], currDim[1]);
    for (int i = 0; i < taskIndices.length; i++) {
      final Values tplSend = new Values(inputComponentIndex, MyUtilities.stringToTuple(
          inputTupleString, _conf), inputTupleHash, _currentEpochNumber,
          _currentDimExcDis);
      appendTimestampNew(tplSend);
      _collector.emitDirect(_taskPhysicalMapping.get(fooLogicalMappings(logicalMappings, taskIndices[i])),
          SystemParameters.ThetaDataReshufflerToJoiner, tplSend);
View Full Code Here


        for (int i = 1; i < _resufflerIndex.size(); i++)
          _collector.emitDirect(
              _resufflerIndex.get(i),
              SystemParameters.ThetaSynchronizerSignal,
              new Values(SystemParameters.ThetaSignalStop, advisorcurrentAction
                  .toString()));
        // emit the stop signal with mapping
        _mAdvisor.updateMapping(advisorcurrentAction);
        // **************************Local changes
        _currentState = state.FLUSHING;
        _currentEpochNumber++;
        _currentAction = advisorcurrentAction;
        _currentDimExcDis = getNewMapping(_currentAction);

        LOG.info(_ID + ":" + _taskPhysicalID
            + " :Reshuffler (sending STOP) & current mapping changing to :("
            + _currentAction.toString() + ") with epoch number:" + _currentEpochNumber
            + " (" + _mAdvisor.totalRowTuples + "," + _mAdvisor.totalColumnTuples + ")");
        updateLogicalMappings();
        _collector.emit(SystemParameters.ThetaReshufflerSignal, new Values(
            SystemParameters.ThetaSignalStop, advisorcurrentAction.toString()));
        // ///*****************************
      }
  }
 
View Full Code Here

            this.set.add(tuple.getString(1));
        }

        @Override
        public void finishBatch() {
            collector.emit(new Values(this.id, this.set.size()));
        }
View Full Code Here

            this.count += tuple.getInteger(1);
        }

        @Override
        public void finishBatch() {
            this.collector.emit(new Values(this.id, this.count));
        }
View Full Code Here

        String delimVal = columns.get(this.columnKeyField);
        if (delimVal != null) {
            String[] vals = delimVal.split(this.delimiter);
            for (String val : vals) {
                if (this.isDrpc) {
                    values.add(new Values(input.getValue(0), rowKey, val));
                } else {
                    values.add(new Values(rowKey, val));
                }
            }
        }
        return values;
    }
View Full Code Here

    public void nextTuple() {
        final String[] words = new String[] { "nathan", "mike", "jackson", "golda", "bertels" };
        final Random rand = new Random();
        final String word = words[rand.nextInt(words.length)];
        this.collector.emit(new Values(word), UUID.randomUUID());
        Thread.yield();
    }
View Full Code Here

    public List<Values> mapToValues(String rowKey, Map<String, String> columns, Tuple input) {
        List<Values> values = new ArrayList<Values>();
        Set<String> vals = columns.keySet();
        for(String columnName : vals){
            if(this.isDrpc){
                values.add(new Values(input.getValue(0), rowKey, columnName));
            } else {
                values.add(new Values(rowKey, columnName));
            }
        }
        return values;
    }
View Full Code Here

    @Override
    public void execute(Tuple tuple, BasicOutputCollector collector) {
      String arg = tuple.getString(0);
      Object retInfo = tuple.getValue(1);
      collector.emit(new Values(arg + "!!!", retInfo));
    }
View Full Code Here

      _count++;
    }

    @Override
    public void finishBatch() {
      _collector.emit(new Values(_id, _count));
    }
View Full Code Here

        DATABASE.put(GLOBAL_COUNT_KEY, newval);
      }
      else {
        newval = val;
      }
      _collector.emit(new Values(_attempt, newval.count));
    }
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.