일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- oracle
- Eclipse
- Google Map
- 선택적조인
- iBATIS
- Spring
- phonegap
- PLSQL
- ibsheet
- Struts
- appspresso
- swingx
- node.js
- MFC
- tomcat
- MySQL
- Android
- jsr 296
- jQuery
- 가우스
- PHP
- JDOM
- JSON
- rowspan
- Ajax
- sencha touch
- 전자정부프레임워크
- dock
- GPS
- WebLogic
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()
);
}
}