mirror of
https://github.com/wahyd4/pinpoint.git
synced 2026-08-25 20:55:59 +10:00
[강운덕] [LUCYSUS-1744] span조회 로직 추가.
git-svn-id: http://svn.bds.nhncorp.com/pe/hippo-commons/trunk@753 84d0f5b1-2673-498c-a247-62c4ff18d310
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.profiler.common.hbase;
|
||||
|
||||
import org.apache.hadoop.hbase.client.Delete;
|
||||
import org.apache.hadoop.hbase.client.Put;
|
||||
import org.springframework.data.hadoop.hbase.HbaseOperations;
|
||||
import org.springframework.data.hadoop.hbase.RowMapper;
|
||||
@@ -52,7 +53,11 @@ public interface HbaseOperations2 extends HbaseOperations {
|
||||
|
||||
<T> void put(String tableName, final byte[] rowName, final byte[] familyName, final byte[] qualifier, final Long timestamp, final T value, final ValueMapper<T> mapper);
|
||||
|
||||
<T> void put(String tableName, final Put put);
|
||||
void put(String tableName, final Put put);
|
||||
|
||||
<T> void put(String tableName, final List<Put> puts);
|
||||
void put(String tableName, final List<Put> puts);
|
||||
|
||||
void delete(String tableName, final Delete delete);
|
||||
|
||||
void delete(String tableName, final List<Delete> deletes);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.profiler.common.hbase;
|
||||
|
||||
import org.apache.hadoop.hbase.client.*;
|
||||
import org.springframework.data.hadoop.hbase.*;
|
||||
import org.springframework.data.hadoop.hbase.HbaseTemplate;
|
||||
import org.springframework.data.hadoop.hbase.RowMapper;
|
||||
import org.springframework.data.hadoop.hbase.TableCallback;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -9,6 +11,7 @@ import java.util.List;
|
||||
*
|
||||
*/
|
||||
public class HbaseTemplate2 extends HbaseTemplate implements HbaseOperations2 {
|
||||
// private HTablePool tablePool;
|
||||
|
||||
@Override
|
||||
public <T> T get(String tableName, byte[] rowName, RowMapper<T> mapper) {
|
||||
@@ -86,24 +89,44 @@ public class HbaseTemplate2 extends HbaseTemplate implements HbaseOperations2 {
|
||||
});
|
||||
}
|
||||
|
||||
public <T> void put(String tableName, final Put put) {
|
||||
execute(tableName, new TableCallback<T>() {
|
||||
public void put(String tableName, final Put put) {
|
||||
execute(tableName, new TableCallback() {
|
||||
@Override
|
||||
public T doInTable(HTable htable) throws Throwable {
|
||||
public Object doInTable(HTable htable) throws Throwable {
|
||||
htable.put(put);
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public <T> void put(String tableName, final List<Put> puts) {
|
||||
execute(tableName, new TableCallback<T>() {
|
||||
public void put(String tableName, final List<Put> puts) {
|
||||
execute(tableName, new TableCallback() {
|
||||
@Override
|
||||
public T doInTable(HTable htable) throws Throwable {
|
||||
public Object doInTable(HTable htable) throws Throwable {
|
||||
htable.put(puts);
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void delete(String tableName, final Delete delete) {
|
||||
execute(tableName, new TableCallback() {
|
||||
@Override
|
||||
public Object doInTable(HTable htable) throws Throwable {
|
||||
htable.delete(delete);
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void delete(String tableName, final List<Delete> deletes) {
|
||||
execute(tableName, new TableCallback() {
|
||||
@Override
|
||||
public Object doInTable(HTable htable) throws Throwable {
|
||||
htable.delete(deletes);
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user