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 . |
getJobId
public BaseShardContext(IncrementalTaskContext taskContext, OutputWriter<O> outputWriter)
public int getShardCount()
ShardContext
getShardCount
in interface ShardContext
public int getShardNumber()
ShardContext
getShardNumber
in interface ShardContext
public Counters getCounters()
ShardContext
Counters
object for doing simple aggregate calculations.getCounters
in interface ShardContext
public Counter getCounter(String name)
ShardContext
Counter
with the given name.getCounter
in interface ShardContext
public final void incrementCounter(String name, long delta)
ShardContext
Counter
with the given name by delta
.incrementCounter
in interface ShardContext
public final void incrementCounter(String name)
ShardContext
Counter
with the given name by 1.incrementCounter
in interface ShardContext
public void emit(O value)
WorkerContext
emit
in interface WorkerContext<O>
Copyright © 2015 Google. All rights reserved.