long rowidScanStart = getTimeMilSec("2009111912", dateFormat);
long rowidScanLast = getTimeMilSec( "2011110112", dateFormat);
HTable hTable = new HTable("LogTraffic");
//데이터를 읽어올 범위를 지정
Scan scan = new Scan(Bytes.toBytes(rowidScanStart), Bytes.toBytes(rowidScanLast));
ResultScanner scanner = hTable.getScanner(scan);
for (Result result : scanner) {
//삭제할 RowKey값을 가져온다
byte [] row = result.getRow();
deleteRow(row) ;
deleteRow(row) ;
}
//데이터를 삭제하는 Method
deleteRow(byte[] row){
}
scanner.close();
hTable.close(); //데이터를 삭제하는 Method
deleteRow(byte[] row){
HTable hTable = new HTable("LogTraffic");
Delete del = new Delete(row);
hTable.delete(del);
hTable.close();
}
'Hadoop' 카테고리의 다른 글
Zookeeper Warning 메세지 (0) | 2012.10.11 |
---|---|
Hive Error (0) | 2011.12.26 |
Hadoop 인스톨 ② (0) | 2011.07.20 |
Hadoop 인스톨 ① (0) | 2011.07.19 |
Apache Hadoop이란? (0) | 2011.07.18 |