@@ -17,6 +17,7 @@ use option::Some;
17
17
use option:: None ;
18
18
use std:: map;
19
19
use std:: map:: hashmap;
20
+ use hash:: Hash ;
20
21
use io:: WriterUtil ;
21
22
22
23
use std:: time;
@@ -25,6 +26,8 @@ use comm::Chan;
25
26
use comm:: Port ;
26
27
use comm:: recv;
27
28
use comm:: send;
29
+ use cmp:: Eq ;
30
+ use to_bytes:: IterBytes ;
28
31
29
32
macro_rules! move_out (
30
33
{ $x: expr } => { unsafe { let y <- * ptr:: addr_of( $x) ; y } }
@@ -145,7 +148,7 @@ mod map_reduce {
145
148
146
149
enum reduce_proto < V : Copy Send > { emit_val( V ) , done, addref, release }
147
150
148
- fn start_mappers < K1 : Copy Send , K2 : Const Copy Send hash_key ,
151
+ fn start_mappers < K1 : Copy Send , K2 : Hash IterBytes Eq Const Copy Send hash_key ,
149
152
V : Copy Send > (
150
153
map : mapper < K1 , K2 , V > ,
151
154
& ctrls: ~[ ctrl_proto:: server:: open < K2 , V > ] ,
@@ -162,7 +165,7 @@ mod map_reduce {
162
165
return tasks;
163
166
}
164
167
165
- fn map_task < K1 : Copy Send , K2 : Const Copy Send hash_key , V : Copy Send > (
168
+ fn map_task < K1 : Copy Send , K2 : Hash IterBytes Eq Const Copy Send hash_key , V : Copy Send > (
166
169
map : mapper < K1 , K2 , V > ,
167
170
ctrl : box < ctrl_proto:: client:: open < K2 , V > > ,
168
171
input : K1 )
@@ -235,7 +238,7 @@ mod map_reduce {
235
238
reduce( key, || get( p, ref_count, is_done) ) ;
236
239
}
237
240
238
- fn map_reduce < K1 : Copy Send , K2 : Const Copy Send hash_key , V : Copy Send > (
241
+ fn map_reduce < K1 : Copy Send , K2 : Hash IterBytes Eq Const Copy Send hash_key , V : Copy Send > (
239
242
map: mapper < K1 , K2 , V > ,
240
243
reduce: reducer < K2 , V > ,
241
244
inputs: ~[ K1 ] )
0 commit comments