Permalink
Browse files

MapReduceStage does not take a payload as constructor because it was …

…confusing
  • Loading branch information...
Caleb Perkins
Caleb Perkins committed Apr 27, 2012
1 parent 376783b commit 64ef3e7d909a111480de3b647619a07ec2a07785
@@ -81,7 +81,7 @@ private static String replace(String filepath, String node) throws IOException {
}
public ClientStage() throws Exception {
- super(null, KeyValue.class, JobDone.class);
+ super(KeyValue.class, JobDone.class);
// Configure built-in stages to be less noisy
Logger.getLogger(bamboo.lss.ASyncCoreImpl.class).setLevel(Level.WARN);
@@ -49,7 +49,8 @@ public Job(String domain, BigInteger master) throws Exception {
.app_id(MappingStage.class);
public MappingStage() throws Exception {
- super(KeyValue.class, Dht.PutResp.class);
+ super(Dht.PutResp.class);
+ ostore.util.TypeTable.register_type(KeyValue.class);
ostore.util.TypeTable.register_type(JobStatus.class);
}
@@ -33,7 +33,8 @@
private WorkerTable workers = new WorkerTable();
public MasterStage() throws Exception {
- super(KeyValue.class, JobRequest.class, ReducingUnderway.class);
+ super(JobRequest.class, ReducingUnderway.class);
+ ostore.util.TypeTable.register_type(KeyValue.class);
ostore.util.TypeTable.register_type(KeyPayload.class);
}
@@ -32,7 +32,7 @@
private final Map<String, Set<String>> completed = new HashMap<String, Set<String>>();
public PartitioningStage() throws Exception {
- super(KeyPayload.class, MappingUnderway.class, Dht.GetResp.class);
+ super(MappingUnderway.class, Dht.GetResp.class);
ostore.util.TypeTable.register_type(KeyValue.class);
ostore.util.TypeTable.register_type(KeyPayload.class);
}
@@ -31,8 +31,9 @@
private final ExecutorService pool = Executors.newCachedThreadPool();
public ReducingStage() throws Exception {
- super(KeyPayload.class, Dht.GetResp.class);
+ super(Dht.GetResp.class);
ostore.util.TypeTable.register_type(KeyValue.class);
+ ostore.util.TypeTable.register_type(KeyPayload.class);
}
@Override
@@ -36,22 +36,17 @@
protected static final Random rand = new Random();
/**
- * Register a stage with one payload and zero or more events.
+ * Register a stage with zero or more events.
*
* This registers three common events for you.
*
- * @param payload
- * a payload, may be null
* @param events
* additional events to subscribe to
* @throws Exception
*/
- protected MapReduceStage(Class<?> payload, Class<?>... events)
+ protected MapReduceStage(Class<?>... events)
throws Exception {
super();
- if (payload != null) {
- ostore.util.TypeTable.register_type(payload);
- }
event_types = new Class[3 + events.length];
event_types[0] = StagesInitializedSignal.class;
event_types[1] = BambooRouteDeliver.class;

0 comments on commit 64ef3e7

Please sign in to comment.