add init  log info to hbase sink
@@ -32,6 +32,8 @@ import org.apache.hadoop.hbase.client.Connection;
import org.apache.hadoop.hbase.client.ConnectionFactory;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.client.Table;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.text.SimpleDateFormat;
@@ -44,6 +46,8 @@ import java.util.List;
*/
public class HbaseOutputFormat extends RichOutputFormat<Tuple2> {
+ private static final Logger LOG = LoggerFactory.getLogger(HbaseOutputFormat.class);
+
private String host;
private String zkParent;
private String[] rowkey;
@@ -63,17 +67,21 @@ public class HbaseOutputFormat extends RichOutputFormat<Tuple2> {
@Override
public void configure(Configuration parameters) {
+ LOG.warn("---configure---");
conf = HBaseConfiguration.create();
conf.set("hbase.zookeeper.quorum", host);
if(zkParent != null && !"".equals(zkParent)){
conf.set("zookeeper.znode.parent", zkParent);
}
+ LOG.warn("---configure end ---");
}
@Override
public void open(int taskNumber, int numTasks) throws IOException {
+ LOG.warn("---open---");
conn = ConnectionFactory.createConnection(conf);
table = conn.getTable(TableName.valueOf(tableName));
+ LOG.warn("---open end(get table from hbase) ---");
}
@Override
