Search in sources :

Example 1 with Rankings

use of org.apache.storm.starter.tools.Rankings in project storm by apache.

the class TotalRankingsBolt method updateRankingsWithTuple.

@Override
void updateRankingsWithTuple(Tuple tuple) {
    Rankings rankingsToBeMerged = (Rankings) tuple.getValue(0);
    super.getRankings().updateWith(rankingsToBeMerged);
    super.getRankings().pruneZeroCounts();
}
Also used : Rankings(org.apache.storm.starter.tools.Rankings)

Example 2 with Rankings

use of org.apache.storm.starter.tools.Rankings in project storm by apache.

the class TotalRankingsBoltTest method mockRankingsTuple.

private Tuple mockRankingsTuple(Object obj, long count) {
    Tuple tuple = MockTupleHelpers.mockTuple(ANY_NON_SYSTEM_COMPONENT_ID, ANY_NON_SYSTEM_STREAM_ID);
    Rankings rankings = mock(Rankings.class);
    when(tuple.getValue(0)).thenReturn(rankings);
    return tuple;
}
Also used : Rankings(org.apache.storm.starter.tools.Rankings) Tuple(org.apache.storm.tuple.Tuple)

Example 3 with Rankings

use of org.apache.storm.starter.tools.Rankings in project jstorm by alibaba.

the class TotalRankingsBolt method updateRankingsWithTuple.

@Override
void updateRankingsWithTuple(Tuple tuple) {
    Rankings rankingsToBeMerged = (Rankings) tuple.getValue(0);
    super.getRankings().updateWith(rankingsToBeMerged);
    super.getRankings().pruneZeroCounts();
}
Also used : Rankings(org.apache.storm.starter.tools.Rankings)

Example 4 with Rankings

use of org.apache.storm.starter.tools.Rankings in project jstorm by alibaba.

the class WindowTestTotalRankingsBolt method updateRankingsWithTuple.

@Override
void updateRankingsWithTuple(Tuple tuple) {
    Rankings rankingsToBeMerged = (Rankings) tuple.getValue(0);
    super.getRankings().updateWith(rankingsToBeMerged);
    super.getRankings().pruneZeroCounts();
    LOG.info("TotalRankingsBolt updateRankingsWithTuple " + getRankings());
}
Also used : Rankings(org.apache.storm.starter.tools.Rankings)

Aggregations

Rankings (org.apache.storm.starter.tools.Rankings)4 Tuple (org.apache.storm.tuple.Tuple)1