Caused by: java.io.IOException: Added a key not lexically larger than previous.
为了重复这个实验,遇到不少坑
https://www.iteblog.com/archives/1889.html
/**
* Created by Administrator on 2017/8/18.
*/
public class IteblogBulkLoadDriver {
public static class IteblogBulkLoadMapper extends Mapper<LongWritable, Text, StringWriter, Put> {
protected void map(LongWritable key, Text value, Context context) throws InterruptedException, IOException {
if(value==null) {
return;
} String line = value.toString(); String[] items = line.split("\\^");
if(items.length<){
items = line.split("\\^");
}
if(items.length<){
System.out.println("================less 3");
return;
}
System.out.println(line);
String rowKey = items[]+items[];
Put put = new Put(Bytes.toBytes(items[])); //ROWKEY
put.addColumn("cf".getBytes(), "url".getBytes(), items[].getBytes());
put.addColumn("cf".getBytes(), "name".getBytes(), items[].getBytes());
context.write(new StringWriter().append(rowKey), put);
}
} public static class HBaseHFileReducer extends
Reducer<StringWriter, Put, ImmutableBytesWritable, Put> {
protected void reduce(StringWriter key, Iterable<Put> values,
Context context) throws IOException, InterruptedException {
String value = "";
ImmutableBytesWritable k = new ImmutableBytesWritable(key.toString().getBytes()); Put val = values.iterator().next();
context.write(k, val);
} } public static void main(String[] args) throws IOException, ClassNotFoundException, InterruptedException {
// String SRC_PATH= "hdfs:/slave1:8020/maats5/pay/logdate=20170906";
// String DESC_PATH= "hdfs:/slave1:8020/maats5_test/pay/logdate=20170906";
String SRC_PATH= args[];
String DESC_PATH=args[];
Configuration conf = HBaseConnectionFactory.config;
conf.set("fs.hdfs.impl", "org.apache.hadoop.hdfs.DistributedFileSystem");
Job job=Job.getInstance(conf);
job.setJarByClass(IteblogBulkLoadDriver.class);
job.setMapperClass(IteblogBulkLoadMapper.class);
job.setMapOutputKeyClass(StringWriter.class);
job.setMapOutputValueClass(Put.class);
job.setReducerClass(HBaseHFileReducer.class);
job.setOutputFormatClass(HFileOutputFormat2.class);
HTable table = new HTable(conf,"maatstest");
HFileOutputFormat2.configureIncrementalLoad(job,table,table.getRegionLocator());
FileInputFormat.addInputPath(job,new Path(SRC_PATH));
FileOutputFormat.setOutputPath(job,new Path(DESC_PATH)); System.exit(job.waitForCompletion(true)?:);
}
}
When using the bulkloader (LoadIncrementalHFiles, doBulkLoad) you can only add items that are "lexically ordered", ie. you need to make sure that the items you add are sorted by the row-id.
https://stackoverflow.com/questions/25860114/hfile-creation-added-a-key-not-lexically-larger-than-previous-key
http://ganliang13.iteye.com/blog/1884921
Caused by: java.io.IOException: Added a key not lexically larger than previous.的更多相关文章
- spark bulkload 报错异常:Caused by: java.io.IOException: Added a key not lexically larger than previous
------------恢复内容开始------------ Caused by: java.io.IOException: Added a key not lexically larger than ...
- eclipse连接远程Hadoop报错,Caused by: java.io.IOException: 远程主机强迫关闭了一个现有的连接。
eclipse连接远程Hadoop报错,Caused by: java.io.IOException: 远程主机强迫关闭了一个现有的连接.全部报错信息如下: Exception in thread & ...
- hive对于lzo文件处理异常Caused by: java.io.IOException: Compressed length 842086665 exceeds max block size 67108864 (probably corrupt file)
hive查询lzo数据格式文件的表时,抛 Caused by: java.io.IOException: Compressed length 842086665 exceeds max block s ...
- Caused by: java.io.IOException: Filesystem closed的处理
org.apache.hadoop.hive.ql.metadata.HiveException: Unable to rename output from: hdfs://nameservice/u ...
- Caused by: java.io.IOException: 你的主机中的软件中止了一个已建立的连接。
org.apache.catalina.connector.ClientAbortException: java.io.IOException: 你的主机中的软件中止了一个已建立的连接. at org ...
- Caused by: java.io.IOException: 您的主机中的软件中止了一个已建立的连接。
异常详情 2017-07-16 10:55:26,218 ERROR [500.jsp] - java.io.IOException: 你的主机中的软件中止了一个已建立的连接. org.apache. ...
- Caused by : java.io.IOException: Cleartext HTTP traffic to 《“url”》 not permitted
一.问题原因: 根本原因是从Android9.0开始,出于完全因素考虑,默认不再支持http网络请求,需要使用 https. 二.解决方案: 解决的基本思路是:对指定的网址进行过滤,强制允许指定网址继 ...
- Push notification - Caused by java.io.IOException toDerInputStream rejects tag
苹果推送 : 文件不是P12文件当生成一个P12,需要选择两个,在钥匙串访问的私钥和证书.
- Caused by: java.io.IOException: Type mismath in vlaue from map: excepted org.apache.hadoop.io.InaWritable,received SC
解决办法: 看map和reduce的输入是不是对应,看看map和reduce设置的参数和下面的是否一致
随机推荐
- 恢复oracle中用PLSQL误删除drop掉的表
一.查看回收站中表 select object_name,original_name,partition_name,type,ts_name,createtime,droptime from recy ...
- MySQL子查询的优化
本文基于MySQL5.7.19测试 创建四张表,pt1.pt2表加上主键 mysql> create table t1 (a1 int, b1 int); mysql> create ta ...
- mysqld Can’t start server : Bind on unix socket: Permission denied
启动mysql报错: mysqld Can’t start server : Bind on unix socket: Permission denied 原因: mysql.sock无法建立,权限问 ...
- Linux信号机制
Linux信号(signal) 机制分析 [摘要]本文分析了Linux内核对于信号的实现机制和应用层的相关处理.首先介绍了软中断信号的本质及信号的两种不同分类方法尤其是不可靠信号的原理.接着分析了内核 ...
- python pandas replace函数
在处理数据的时候,很多时候会遇到批量替换的情况,如果一个一个去修改效率过低,也容易出错.replace()是很好的方法. 1.基本结构: df.replace(to_replace, value) 前 ...
- JAVA日期查询:季度、月份、星期等时间信息
package com.stt.dateChange; import java.text.SimpleDateFormat; import java.util.Calendar; import jav ...
- laravel用redis保存session遇到的坑,没报错,但redis-cli就是查不到
laravel用redis保存session遇到的坑, 配置redis存储session流程是这样的 在.evn文件中把session驱动和连接改为了redis的 如下: SESSION_DRIVER ...
- 模态推出 全屏 隐藏tabbar
SearchVC * vc = [[SearchVC alloc] init]; /* 底部向上 UIModalTransitionStyleCoverVertical // 淡入 UIMo ...
- Install OpenCV3.0 on Eclipse
Neste artigo veremos como usar o OpenCV com Eclipse. Usaremos as versões mais recentes:OpenCV 3.0 ...
- 译:1. 初识 Apache Axis2
欢迎使用Apache Axis2 / Java Apache Axis2 是一个Web Service SOAP / WSDL 引擎,它被广泛用于Apache Axis SOAP 栈. Apache ...