`
lbxhappy
  • 浏览: 305899 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

hbase 导出 excel报表 jxl

阅读更多
package sina.hive.vipfaninfo;

import java.io.File;
import java.util.Iterator;

import jxl.Workbook;
import jxl.write.Label;
import jxl.write.WritableSheet;
import jxl.write.WritableWorkbook;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.client.HTablePool;
import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.client.ResultScanner;
import org.apache.hadoop.hbase.client.Scan;
import org.apache.log4j.Logger;

import sina.hive.init.EffectInit;

public class FanExcel {
private Logger log = Logger.getLogger(FanExcel.class);
private HTablePool hTablePool;
private static final String TABLE_NAME = "temp_sina_analyzer";

private static final String PATH = "/home/hdfs/effect/liubx/tempFan.xls";
private static final String TEMPLATE_PATH = "/home/hdfs/effect/liubx/template.xls";
private static FanExcel fanExcel = new FanExcel();
private WritableWorkbook wokbook = null;
private int one_index = 0;
private int two_index = 0;
private int three_index = 0;
private int four_index = 0;
private int five_index = 0;
private int six_index = 0;
private int seven_index = 0;
private WritableSheet oneSheet;
private WritableSheet twoSheet;
private WritableSheet threeSheet;
private WritableSheet fourSheet;
private WritableSheet fiveSheet;
private WritableSheet sixSheet;
private WritableSheet sevenSheet;
private Label label = null;
private jxl.write.Number numberCell = null;
private byte[] family = "baseInfo".getBytes();

String arry1[] = null;
String arry2[] = null;
String fan_str = null;
byte tmp[] = null;

public static FanExcel getFanExcel() {
if (fanExcel == null) {
fanExcel = new FanExcel();
}
return fanExcel;
}

private FanExcel() {
init(true);
}

public HTable getHtable(String tableName) {
if (hTablePool != null) {
return (HTable) hTablePool.getTable(tableName);
} else {
Configuration configuration = HBaseConfiguration.create();
configuration.set("hbase.master", EffectInit.hbaseMaster);
configuration.set("hbase.zookeeper.quorum",
EffectInit.hbaseZkQuorum);
configuration.set("hbase.zookeeper.property.clientPort",
EffectInit.hbaseZkClientPort);
configuration.get("hbase.master");
hTablePool = new HTablePool(configuration,
EffectInit.hbasePoolMaxSize);
return (HTable) hTablePool.getTable(tableName);
}
}

private void init(boolean isFirst) {
File file = new File(FanExcel.PATH);
log.info("开始初始化EXCEL信息:");
Workbook wb = null;
try {
// Excel模板
if(isFirst){
wb = Workbook.getWorkbook(new File(FanExcel.TEMPLATE_PATH));
}else{
wb = Workbook.getWorkbook(new File(FanExcel.PATH));
}

this.wokbook = Workbook.createWorkbook(file, wb);
this.oneSheet = this.wokbook.getSheet(0);
this.twoSheet = this.wokbook.getSheet(1);
this.threeSheet = this.wokbook.getSheet(2);
this.fourSheet = this.wokbook.getSheet(3);
this.fiveSheet = this.wokbook.getSheet(4);
this.sixSheet = this.wokbook.getSheet(5);
this.sevenSheet = this.wokbook.getSheet(6);
} catch (Exception ex) {
log.error(ex.getMessage(), ex);
}
log.info("结束初始化EXCEL信息!");
}

/**
* 微博基本信息页
*/
private void oneSheet(Result rs) throws Exception {
this.one_index++;
label = new Label(0, one_index, new String(rs.getRow(), "utf-8"));
this.oneSheet.addCell(label);
this.tmp = rs.getValue(this.family, "nickName".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(1, one_index, new String(this.tmp, "utf-8"));
this.oneSheet.addCell(label);
this.tmp = rs.getValue(this.family, "gender".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(2, one_index, new String(this.tmp, "utf-8"));
this.oneSheet.addCell(label);
this.tmp = rs.getValue(this.family, "address".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(3, one_index, new String(this.tmp, "utf-8"));
this.oneSheet.addCell(label);
this.tmp = rs.getValue(this.family, "fansCount".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(4, one_index, new String(this.tmp, "utf-8"));
this.oneSheet.addCell(label);
this.tmp = rs.getValue(this.family, "attentCount".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(5, one_index, new String(this.tmp, "utf-8"));
this.oneSheet.addCell(label);
this.tmp = rs.getValue(this.family, "weiboCount".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(6, one_index, new String(this.tmp, "utf-8"));
this.oneSheet.addCell(label);
this.tmp = rs.getValue(this.family, "favCount".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(7, one_index, new String(this.tmp, "utf-8"));
this.oneSheet.addCell(label);
this.tmp = rs.getValue(this.family, "description".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(8, one_index, new String(this.tmp, "utf-8"));
this.oneSheet.addCell(label);
this.tmp = rs.getValue(this.family, "createdTime".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(9, one_index, new String(this.tmp, "utf-8"));
this.oneSheet.addCell(label);
this.tmp = rs.getValue(this.family, "activeDegree".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(10, one_index, new String(this.tmp, "utf-8"));
this.oneSheet.addCell(label);
this.tmp = rs.getValue(this.family, "isVip".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(11, one_index, new String(this.tmp, "utf-8"));
this.oneSheet.addCell(label);
this.tmp = rs.getValue(this.family, "isCorpseFan".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(12, one_index, new String(this.tmp, "utf-8"));
this.oneSheet.addCell(label);
this.tmp = rs.getValue(this.family, "recentFdCount200".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(13, one_index, new String(this.tmp, "utf-8"));
this.oneSheet.addCell(label);
this.tmp = rs.getValue(this.family, "recentCmCount200".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(14, one_index, new String(this.tmp, "utf-8"));
this.oneSheet.addCell(label);
this.tmp = rs.getValue(this.family, "oriRate200".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(15, one_index, new String(this.tmp, "utf-8"));
this.oneSheet.addCell(label);
this.tmp = rs.getValue(this.family, "forwardRate200".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(16, one_index, new String(this.tmp, "utf-8"));
this.oneSheet.addCell(label);
this.tmp = rs.getValue(this.family, "lWbCount90".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(17, one_index, new String(this.tmp, "utf-8"));
this.oneSheet.addCell(label);
this.tmp = rs.getValue(this.family, "lByFwdCounts90".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(18, one_index, new String(this.tmp, "utf-8"));
this.oneSheet.addCell(label);
this.tmp = rs.getValue(this.family, "lByCmtCounts90".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(19, one_index, new String(this.tmp, "utf-8"));
this.oneSheet.addCell(label);
this.tmp = rs.getValue(this.family, "l1ByFCCount90".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(20, one_index, new String(this.tmp, "utf-8"));
this.oneSheet.addCell(label);
this.tmp = rs.getValue(this.family, "lAvgByFCCount90".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(21, one_index, new String(this.tmp, "utf-8"));
this.oneSheet.addCell(label);
this.tmp = rs.getValue(this.family, "lAvgWbCount90".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(22, one_index, new String(this.tmp, "utf-8"));
this.oneSheet.addCell(label);
this.tmp = rs.getValue(this.family, "lWbCount30".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(23, one_index, new String(this.tmp, "utf-8"));
this.oneSheet.addCell(label);
this.tmp = rs.getValue(this.family, "lByFwdCounts30".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(24, one_index, new String(this.tmp, "utf-8"));
this.oneSheet.addCell(label);
this.tmp = rs.getValue(this.family, "lByCmtCounts30".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(25, one_index, new String(this.tmp, "utf-8"));
this.oneSheet.addCell(label);
this.tmp = rs.getValue(this.family, "l1ByFCCount30".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(26, one_index, new String(this.tmp, "utf-8"));
this.oneSheet.addCell(label);
this.tmp = rs.getValue(this.family, "lAvgByFCCount30".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(27, one_index, new String(this.tmp, "utf-8"));
this.oneSheet.addCell(label);
this.tmp = rs.getValue(this.family, "lAvgWbCount30".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(28, one_index, new String(this.tmp, "utf-8"));
this.oneSheet.addCell(label);

/*
* 生成一个保存数字的单元格 必须使用Number的完整包路径,否则有语法歧义 单元格位置是第二列,第一行,值为789.123
*/
// jxl.write.Number number = new jxl.write.Number(1, 0, 555.12541);
// sheet.addCell(number);
}

/**
* 近90天用户指数
*/
private void twoSheet(Result rs) throws Exception {
this.two_index++;
label = new Label(0, two_index, new String(rs.getRow(), "utf-8"));
this.twoSheet.addCell(label);
this.tmp = rs.getValue(this.family, "nickName".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(1, two_index, new String(this.tmp, "utf-8"));
this.twoSheet.addCell(label);
this.tmp = rs.getValue(this.family, "address".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(2, two_index, new String(this.tmp, "utf-8"));
this.twoSheet.addCell(label);
this.tmp = rs.getValue(this.family, "netEffectIndex".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(3, two_index, new String(this.tmp, "utf-8"));
this.twoSheet.addCell(label);
this.tmp = rs.getValue(this.family, "fanEffectIndex".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(4, two_index, new String(this.tmp, "utf-8"));
this.twoSheet.addCell(label);
this.tmp = rs.getValue(this.family, "fanCountIndex".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(5, two_index, new String(this.tmp, "utf-8"));
this.twoSheet.addCell(label);
this.tmp = rs.getValue(this.family, "fanQualityIndex".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(6, two_index, new String(this.tmp, "utf-8"));
this.twoSheet.addCell(label);
this.tmp = rs.getValue(this.family, "weiboEffectIndex".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(7, two_index, new String(this.tmp, "utf-8"));
this.twoSheet.addCell(label);
this.tmp = rs.getValue(this.family, "bowenCountIndex".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(8, two_index, new String(this.tmp, "utf-8"));
this.twoSheet.addCell(label);
this.tmp = rs.getValue(this.family, "bowenQualityIndex".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(9, two_index, new String(this.tmp, "utf-8"));
this.twoSheet.addCell(label);
this.tmp = rs.getValue(this.family, "weiboInteractIndex".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(10, two_index, new String(this.tmp, "utf-8"));
this.twoSheet.addCell(label);
this.tmp = rs.getValue(this.family, "fanJoinIndex".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(11, two_index, new String(this.tmp, "utf-8"));
this.twoSheet.addCell(label);
this.tmp = rs.getValue(this.family, "interactTrendIndex".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(12, two_index, new String(this.tmp, "utf-8"));
this.twoSheet.addCell(label);

}

/**
* 近30天用户指数
*/

public void threeSheet(Result rs) throws Exception {
this.three_index++;
label = new Label(0, this.three_index, new String(rs.getRow(), "utf-8"));
this.threeSheet.addCell(label);
this.tmp = rs.getValue(this.family, "nickName".getBytes());
if (tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(1, this.three_index, new String(this.tmp, "utf-8"));
this.threeSheet.addCell(label);
this.tmp = rs.getValue(this.family, "address".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(2, this.three_index, new String(this.tmp, "utf-8"));
this.threeSheet.addCell(label);
this.tmp = rs.getValue(this.family, "netEffectIndex30".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(3, this.three_index, new String(this.tmp, "utf-8"));
this.threeSheet.addCell(label);
this.tmp = rs.getValue(this.family, "fanEffectIndex30".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(4, this.three_index, new String(this.tmp, "utf-8"));
this.threeSheet.addCell(label);
this.tmp = rs.getValue(this.family, "fanCountIndex30".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(5, this.three_index, new String(this.tmp, "utf-8"));
this.threeSheet.addCell(label);
this.tmp = rs.getValue(this.family, "fanQualityIndex30".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(6, this.three_index, new String(this.tmp, "utf-8"));
this.threeSheet.addCell(label);
this.tmp = rs.getValue(this.family, "weiboEffectIndex30".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(7, this.three_index, new String(this.tmp, "utf-8"));
this.threeSheet.addCell(label);
this.tmp = rs.getValue(this.family, "bowenCountIndex30".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(8, this.three_index, new String(this.tmp, "utf-8"));
this.threeSheet.addCell(label);
this.tmp = rs.getValue(this.family, "bowenQualityIndex30".getBytes());
if (tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(9, this.three_index, new String(this.tmp, "utf-8"));
this.threeSheet.addCell(label);
this.tmp = rs.getValue(this.family, "weiboInteractIndex30".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(10, this.three_index, new String(this.tmp, "utf-8"));
this.threeSheet.addCell(label);
this.tmp = rs.getValue(this.family, "fanJoinIndex30".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(11, this.three_index, new String(this.tmp, "utf-8"));
this.threeSheet.addCell(label);
this.tmp = rs.getValue(this.family, "interactTrendIndex30".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(12, this.three_index, new String(this.tmp, "utf-8"));
this.threeSheet.addCell(label);

}

/**
* 粉丝性别&质量
*/

public void foursheet(Result rs) throws Exception {
this.four_index++;
label = new Label(0, this.four_index, new String(rs.getRow(), "utf-8"));
this.fourSheet.addCell(label);
this.tmp = rs.getValue(this.family, "nickName".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(1, this.four_index, new String(this.tmp, "utf-8"));
this.fourSheet.addCell(label);
this.tmp = rs.getValue(this.family, "address".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(2, this.four_index, new String(this.tmp, "utf-8"));
this.fourSheet.addCell(label);
this.tmp = rs.getValue(this.family, "lMFansCount".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(3, this.four_index, new String(this.tmp, "utf-8"));
this.fourSheet.addCell(label);
this.tmp = rs.getValue(this.family, "lWFansCount".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(4, this.four_index, new String(this.tmp, "utf-8"));
this.fourSheet.addCell(label);

this.tmp = rs.getValue(this.family, "lVFansCount".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(5, this.four_index, new String(this.tmp, "utf-8"));
this.fourSheet.addCell(label);
this.tmp = rs.getValue(this.family, "lCorpseFansCount".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(6, this.four_index, new String(this.tmp, "utf-8"));
this.fourSheet.addCell(label);
this.tmp = rs.getValue(this.family, "lGrassRootsFan".getBytes());
if (this.tmp == null) {
this.tmp = "".getBytes();
}
label = new Label(7, this.four_index, new String(this.tmp, "utf-8"));
this.fourSheet.addCell(label);

}

/**
* 二级粉丝区间分布
*/

public void fivesheet(Result rs) throws Exception {
this.tmp = rs.getValue(this.family, "fan2fenbu".getBytes());
if (this.tmp == null) {
return;
}
fan_str = new String(this.tmp, "utf-8");
if (fan_str == null || fan_str.indexOf("|") <= 0) {
return;
}

arry1 = fan_str.split(" ");

for (String str : arry1) {
this.five_index++;
arry2 = str.split("\\|");
label = new Label(0, this.five_index, new String(rs.getRow(),
"utf-8"));
this.fiveSheet.addCell(label);
label = new Label(1, this.five_index, new String(rs.getValue(
this.family, "nickName".getBytes()), "utf-8"));
this.fiveSheet.addCell(label);
label = new Label(2, this.five_index, new String(rs.getValue(
this.family, "address".getBytes()), "utf-8"));
this.fiveSheet.addCell(label);
label = new Label(5, this.five_index, arry2[1]);
this.fiveSheet.addCell(label);
arry2 = arry2[0].split("_");
label = new Label(3, this.five_index, arry2[0]);
this.fiveSheet.addCell(label);
if(arry2.length<2){
label = new Label(4, this.five_index, "-1");
}else{
label = new Label(4, this.five_index, arry2[1]);
}

this.fiveSheet.addCell(label);

}

}

/**
* 粉丝地域分布
*/

public void sixsheet(Result rs) throws Exception {
this.tmp = rs.getValue(this.family, "diyufenbu".getBytes());
if (tmp == null) {
return;
}
this.fan_str = new String(this.tmp, "utf-8");
if (this.fan_str == null || this.fan_str.indexOf("|") <= 0) {
return;
}

this.arry1 = this.fan_str.split(" ");
for (String str : arry1) {
this.six_index++;
arry2 = str.split("\\|");
label = new Label(0, this.six_index, new String(rs.getRow(),
"utf-8"));
this.sixSheet.addCell(label);
label = new Label(1, this.six_index, new String(rs.getValue(
this.family, "nickName".getBytes()), "utf-8"));
this.sixSheet.addCell(label);
label = new Label(2, this.six_index, new String(rs.getValue(
this.family, "address".getBytes()), "utf-8"));
this.sixSheet.addCell(label);

label = new Label(3, this.six_index, arry2[0]);
this.sixSheet.addCell(label);
label = new Label(4, this.six_index, arry2[1]);
this.sixSheet.addCell(label);

}
}

/**
* 粉丝活跃度分布
*/

public void sevensheet(Result rs) throws Exception {
this.tmp = rs.getValue(this.family, "daywbfenbu".getBytes());
if (this.tmp == null) {
return;
}
this.fan_str = new String(this.tmp, "utf-8");
if (this.fan_str == null || this.fan_str.indexOf("|") <= 0) {
return;
}
this.arry1 = this.fan_str.split(" ");
for (String str : arry1) {
this.seven_index++;
arry2 = str.split("\\|");
label = new Label(0, this.seven_index, new String(rs.getRow(),
"utf-8"));
this.sevenSheet.addCell(label);
label = new Label(1, this.seven_index, new String(rs.getValue(
this.family, "nickName".getBytes()), "utf-8"));

this.sevenSheet.addCell(label);
label = new Label(2, this.seven_index, new String(rs.getValue(
this.family, "address".getBytes()), "utf-8"));
this.sevenSheet.addCell(label);

label = new Label(5, this.seven_index, arry2[1]);
this.sevenSheet.addCell(label);
arry2 = arry2[0].split("_");
label = new Label(3, this.seven_index, arry2[0]);
this.sevenSheet.addCell(label);
if(arry2.length<2){
label = new Label(4, this.seven_index, "-1");
}else{
label = new Label(4, this.seven_index, arry2[1]);
}
this.sevenSheet.addCell(label);

}
}

private void closeExcel() {
try {
if (this.wokbook != null) {
this.wokbook.write();
this.wokbook.close();
}

} catch (Exception ex) {
log.error(ex.getMessage(), ex);
}
}

public void exportExcel() {
HTable htable = getHtable(FanExcel.TABLE_NAME);
Scan scan = new Scan();
Result rs = null;
int n =0;
int n2=0;
try {
ResultScanner rscan = htable.getScanner(scan);
Iterator<Result> it = rscan.iterator();

while (it.hasNext()) {
rs = it.next();
if (rs == null || rs.isEmpty()) {
continue;
}
this.oneSheet(rs);
this.twoSheet(rs);
this.threeSheet(rs);
this.foursheet(rs);
this.fivesheet(rs);
this.sixsheet(rs);
this.sevensheet(rs);
n2++;
n++;
if(n==500){
System.out.println("重新初始化操作!");
this.closeExcel();
this.init(false);
}
}
} catch (Exception ex) {
log.error(new String(rs.getRow()));
log.error(ex.getMessage(), ex);
} finally {
System.out.println("写入记录数:"+n2);
System.out.println("sheet1:"+this.one_index);
System.out.println("sheet2:"+this.two_index);
System.out.println("sheet3:"+this.three_index);
System.out.println("sheet4:"+this.four_index);
System.out.println("sheet5:"+this.five_index);
System.out.println("sheet6:"+this.six_index);
System.out.println("sheet7:"+this.seven_index);
closeExcel();
}

}

public static void main(String arg[]) {
FanExcel fanexcel = FanExcel.getFanExcel();
System.out.println("开始导出excel数据:");
fanexcel.exportExcel();
System.out.println("结束导出excel数据:");
}

}
分享到:
评论

相关推荐

    hbase导出csv,文本,html文件

    6. **终端mac查询脚本**:在Mac终端中,可以编写shell脚本来自动化这些过程,包括执行HBase查询、Hive操作、数据库导入导出等,以提高效率和减少手动错误。 这个流程体现了大数据处理中的一种典型数据流:从NoSQL...

    HDFS 通过mapreduce 进行 HBase 导入导出

    标题 "HDFS 通过 mapreduce 进行 HBase 导入导出" 涉及的是大数据处理领域中的两个重要组件——Hadoop Distributed File System (HDFS) 和 HBase,以及它们之间的数据交互。HDFS 是 Hadoop 的分布式文件系统,而 ...

    hbase-exporter:HBase Prometheus导出器

    hbase-exporterHBase Prometheus导出器收集指标并中继JMX指标以供Prometheus使用由于JMX中一些重要的指标缺失或为空,因此我们另外分析了HBase主界面,例如“过渡中的过时区域” 解析“ hbase hbck”命令的输出以...

    HBASE调优 rowkey

    HBase是Apache软件基金会的Hadoop项目中的一个子项目,它是一个开源的非关系型分布式数据库(NoSQL),是Google Bigtable的开源实现。HBase特别适合于存储大量的稀疏数据,其设计目标是提供水平可扩展的数据存储能力...

    Sqoop通过Phoenix导hbase数据到hive

    出现此问题时使用:java.lang.NullPointerException at org.json.JSONObject.(JSONObject.java:144) at org.apache.sqoop.util.SqoopJsonUtil.getJsonStringforMap(SqoopJsonUtil.java:43) at org.apache.sqoop....

    HbaseTemplate 操作hbase

    在IT行业中,尤其是在大数据处理领域,HBase是一个广泛使用的分布式、高性能、列式存储的NoSQL数据库。HBase是建立在Hadoop文件系统(HDFS)之上,为处理大规模数据提供了一个高效的数据存储解决方案。而Spring Data...

    hbase用于查询客户端工具

    通过编写MapReduce作业,可以对HBase表进行大规模的数据导入和导出,或者执行复杂的数据分析任务。 在实际使用中,选择哪个客户端工具取决于具体的需求和使用场景。例如,如果需要快速原型开发或简单的数据操作,...

    hbase存储csv数据的代码实现

    在大数据处理领域,HBase作为一个分布式、高性能的列式存储系统,被广泛应用于处理大规模结构化数据。本文将深入探讨如何使用代码实现将CSV(逗号分隔值)数据存储到HBase中,帮助你更好地理解和掌握HBase的用法。 ...

    hbase安装包

    在实际应用中,你可能还需要学习如何创建表、插入数据、查询数据、管理表的列族和版本、进行数据的批量导入导出、监控HBase性能等操作。此外,HBase的运维也是一项重要任务,包括定期备份、恢复、优化等。理解HBase...

    pinpoint的hbase初始化脚本hbase-create.hbase

    搭建pinpoint需要的hbase初始化脚本hbase-create.hbase

    hbase配置内置的zookeeper

    ### HBase 配置内置 ZooKeeper 的详细步骤与解析 #### 一、配置背景与目的 在 HBase 的部署环境中,ZooKeeper 起着非常重要的作用,它主要用于协调集群中的各个节点,并且管理 HBase 的元数据。通常情况下,HBase ...

    hbase数据可视化系统

    《HBase数据可视化系统构建详解》 在大数据领域,HBase作为一款分布式列式数据库,因其高并发、低...在实际应用中,可以根据需求进一步扩展功能,例如支持更复杂的查询条件、数据导出导入等,以满足不同场景的需求。

    HBase开启审计日志

    ### HBase开启审计日志详解 #### 一、概述 HBase是一款分布式列式存储系统,基于Google的Bigtable论文实现。它具有高可靠性、高性能、面向列、可伸缩的特点,非常适合处理海量数据。在大数据领域,HBase被广泛用于...

    HBase(hbase-2.4.9-bin.tar.gz)

    HBase(hbase-2.4.9-bin.tar.gz)是一个分布式的、面向列的开源数据库,该技术来源于 Fay Chang 所撰写的Google论文“Bigtable:一个结构化数据的分布式存储系统”。就像Bigtable利用了Google文件系统(File System...

    Hbase 可视化客户端工具(非phoenix连接)

    用户可以将CSV或Excel文件批量导入到HBase表中,也可以将数据导出为各种格式,便于数据分析或备份。这对于数据迁移和数据交换场景非常有用。 在管理层面,此工具可能还包括权限管理、监控和报警功能。例如,可以...

    Hbase权威指南(HBase: The Definitive Guide)

    ### HBase权威指南知识点概述 #### 一、引言与背景 - **大数据时代的来临**:随着互联网技术的发展,人类社会产生了前所未为的数据量。这些数据不仅数量巨大,而且种类繁多,传统的数据库系统难以应对这样的挑战。 ...

    HBase学习利器:HBase实战

    ### HBase学习利器:HBase实战 #### 一、HBase简介与背景 HBase是Apache Hadoop生态系统中的一个分布式、可扩展的列族数据库,它提供了类似Bigtable的能力,能够在大规模数据集上进行随机读写操作。HBase是基于...

    hbase安装与使用

    ### HBase 安装与使用知识点详解 #### 概述 HBase 是一款构建于 Hadoop 之上的分布式、可扩展的大规模数据存储系统。它提供了类似 Google BigTable 的功能特性,非常适合处理海量数据和高并发读写需求的应用场景。...

    基于springboot集成hbase过程解析

    "基于SpringBoot集成HBase过程解析" SpringBoot集成HBase是当前大数据处理和存储解决方案中的一种常见组合。HBase是基于Hadoop的分布式、可扩展的NoSQL数据库,能够存储大量的结构化和非结构化数据。SpringBoot则...

    hbase-2.4.17-bin 安装包

    HBase是Apache Hadoop生态系统中的一个分布式、版本化、列族式存储系统,设计用于处理大规模数据集。这个“hbase-2.4.17-bin”安装包提供了HBase的最新稳定版本2.4.17,适用于大数据处理和分析场景。下面将详细介绍...

Global site tag (gtag.js) - Google Analytics