通过nutch1.8解析页面时使用hbase保存数据
我正在使用Nutch1.8抓取页面,并希望在解析时将parseText保存到hbase中。因此,我编写了一个筛选器,但在保存parseText时,出现以下错误: 线程在尝试连接到主线程时被中断 此代码在unitTest上运行良好,但与nutch集成时会出现错误。有人能帮忙吗通过nutch1.8解析页面时使用hbase保存数据,hbase,nutch,Hbase,Nutch,我正在使用Nutch1.8抓取页面,并希望在解析时将parseText保存到hbase中。因此,我编写了一个筛选器,但在保存parseText时,出现以下错误: 线程在尝试连接到主线程时被中断 此代码在unitTest上运行良好,但与nutch集成时会出现错误。有人能帮忙吗 static { conf = HBaseConfiguration.create(); } public static void creatTable(String tableName, Stri
static {
conf = HBaseConfiguration.create();
}
public static void creatTable(String tableName, String[] familys) throws Exception {
HBaseAdmin admin = new HBaseAdmin(conf);
if (admin.tableExists(tableName)) {
System.out.println("table already exists!");
} else {
HTableDescriptor tableDesc = new HTableDescriptor(tableName);
for (int i = 0; i < familys.length; i++) {
tableDesc.addFamily(new HColumnDescriptor(familys[i]));
}
admin.createTable(tableDesc);
System.out.println("create table " + tableName + " ok.");
}
}