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