public class CountTweetsInTimeperiod extends StageProvider
Modifier and Type | Class and Description |
---|---|
static class |
CountTweetsInTimeperiod.InMemoryCombiningReducer
reduce input:
|
static class |
CountTweetsInTimeperiod.Map
map input: tweetstatus # json twitter status with JSONPath to words map
output:
|
static class |
CountTweetsInTimeperiod.TimeIndexReducer
Identical to the
IdentityReducer but constructs a time index
found in TIMEINDEX_FILE |
Modifier and Type | Field and Description |
---|---|
static String |
GLOBAL_STATS_FILE
where to find the global stats file
|
static String |
TIMECOUNT_DIR
option for the timecount dir location
|
static String |
TIMEINDEX_FILE
A time index holding tweet totals and cumulative totals for each time
period
|
static String |
TIMEINDEX_LOCATION_PROP
A time index holding tweet totals and cumulative totals for each time
period
|
Constructor and Description |
---|
CountTweetsInTimeperiod(String[] nonHadoopArgs,
boolean inMemoryCombine,
long timedelta) |
CountTweetsInTimeperiod(String[] nonHadoopArgs,
long timedelta) |
Modifier and Type | Method and Description |
---|---|
static org.apache.hadoop.fs.Path |
constructIndexPath(org.apache.hadoop.fs.Path outpath) |
static TimeFrequencyHolder |
readTimeIndex(org.apache.hadoop.fs.Path indexOut)
Read a
TimeFrequencyHolder from a Path . |
TextLongByteStage |
stage() |
static void |
writeTimeIndex(TimeFrequencyHolder timeMap,
org.apache.hadoop.fs.Path indexOut)
Write a timeindex to a
Path |
public static final String TIMECOUNT_DIR
public static final String TIMEINDEX_FILE
public static final String GLOBAL_STATS_FILE
public static final String TIMEINDEX_LOCATION_PROP
public CountTweetsInTimeperiod(String[] nonHadoopArgs, long timedelta)
nonHadoopArgs
- to be sent to the stagetimedelta
- the time delta between which to quantise time periodspublic CountTweetsInTimeperiod(String[] nonHadoopArgs, boolean inMemoryCombine, long timedelta)
nonHadoopArgs
- to be sent to the stageinMemoryCombine
- whether an in memory combination of word counts should be
performedtimedelta
- the time delta between which to quantise time periodspublic TextLongByteStage stage()
stage
in class StageProvider
public static void writeTimeIndex(TimeFrequencyHolder timeMap, org.apache.hadoop.fs.Path indexOut) throws IOException
Path
timeMap
- indexOut
- IOException
public static TimeFrequencyHolder readTimeIndex(org.apache.hadoop.fs.Path indexOut) throws IOException
TimeFrequencyHolder
from a Path
. Path is assumed
to be a directory containing many TimeFrequencyHolder
instances.indexOut
- TimeFrequencyHolder
IOException
public static org.apache.hadoop.fs.Path constructIndexPath(org.apache.hadoop.fs.Path outpath)
outpath
-