일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
Tags
- Google Map
- 가우스
- PHP
- JSON
- sencha touch
- oracle
- phonegap
- Spring
- swingx
- iBATIS
- Android
- rowspan
- Struts
- Ajax
- WebLogic
- 선택적조인
- MFC
- GPS
- Eclipse
- JDOM
- PLSQL
- tomcat
- jQuery
- ibsheet
- 전자정부프레임워크
- jsr 296
- node.js
- dock
- MySQL
- appspresso
Archives
- Today
- Total
Where The Streets Have No Name
GridGain을 이용한 MapReduce 본문
import org.gridgain.grid.*;
import org.gridgain.grid.typedef.*;
import static org.gridgain.grid.GridClosureCallMode.*;
public class JavaMapReduce {
public static void main(String[] args) throws GridException{
G.start();
X.println("Count is : "+mapReduceCount("Java GridGain MapReduce"));
G.stop(true);
}
public static int mapReduceCount(String msg) throws GridException {
return G.grid().reduce(
SPREAD,
F.yield(
msg.split(" "),
new C1<String, Integer>(){
@Override
public Integer apply(String s) {
X.println("Calculating for : "+s);
return s.length();
}
}
),
F.sumIntReducer()
);
}
}