O - type of emitted valuespublic abstract class BaseShardContext<O> extends BaseContext implements WorkerContext<O>
| Constructor and Description |
|---|
BaseShardContext(IncrementalTaskContext taskContext,
OutputWriter<O> outputWriter) |
| Modifier and Type | Method and Description |
|---|---|
void |
emit(O value)
Emits a value to the output.
|
Counter |
getCounter(String name)
Returns the
Counter with the given name. |
Counters |
getCounters()
Returns a
Counters object for doing simple aggregate calculations. |
int |
getShardCount()
Returns the total number of shards.
|
int |
getShardNumber()
Returns the number of this mapper or reducer shard (zero-based).
|
void |
incrementCounter(String name)
Increments the
Counter with the given name by 1. |
void |
incrementCounter(String name,
long delta)
Increments the
Counter with the given name by delta. |
getJobIdpublic BaseShardContext(IncrementalTaskContext taskContext, OutputWriter<O> outputWriter)
public int getShardCount()
ShardContextgetShardCount in interface ShardContextpublic int getShardNumber()
ShardContextgetShardNumber in interface ShardContextpublic Counters getCounters()
ShardContextCounters object for doing simple aggregate calculations.getCounters in interface ShardContextpublic Counter getCounter(String name)
ShardContextCounter with the given name.getCounter in interface ShardContextpublic final void incrementCounter(String name, long delta)
ShardContextCounter with the given name by delta.incrementCounter in interface ShardContextpublic final void incrementCounter(String name)
ShardContextCounter with the given name by 1.incrementCounter in interface ShardContextpublic void emit(O value)
WorkerContextemit in interface WorkerContext<O>Copyright © 2015 Google. All rights reserved.