- 博客(13)
- 收藏
- 关注
原创 MapReduce运行报错NoSuchMethodException: org.apache.hadoop.io.ArrayWritable.<init>
在Mapper类中以Text作为key,ArrayWritable作为valuecontext.write(new Text(xxx), new ArrayWriteable(xxx));报错NoSuchMethodException: org.apache.hadoop.io.ArrayWritable.因为ArrayWritable没有无参构造方法,需要我们自定义一个类继承它import org.apache.hadoop.io.ArrayWritable;import org.apache
2021-04-14 16:00:38
385
1
原创 centos7安装 anaconda3
查看资源镜像站,查找合适的安装镜像https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-4.3.0-Linux-x86_64.sh运行 wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-4.3.0-Linux-x86_64.sh 完成下载.运行 bash Anaconda3-5.3.1-Linux-x86_64.sh安装过程.
2020-08-30 14:50:51
442
原创 python3连接mysql与mongo
Mysql#以java来理解python连接mysql#JDBC = DB-API规范#驱动 = python对应数据库的模块#流程'''引入API模块获取连接执行语句和存储过程关闭数据库连接'''import pymysql#一些参数 pymysql.apilevelpymysql.__file__pymysql.threadsafety #线程安全等级pymysql.paramstyle='qmark' #默认pyformat #获取连接db=pymysql.co
2020-08-23 15:17:54
234
原创 python学习 知识点记录
mapc=[1,2,3,4,5]m=map(str,c) #这种map对象是一个惰性求值的对象 只能使用一次r=list(m)print(r)for i in m: print(i) #无法再次使用 for i in map(str,c): print(i)#可以输出import mathlist( map(math.sin,c) ) #c是什么类型 result就是什么类型 并没有真正返回结果 而是yield ...
2020-08-07 17:02:32
242
原创 hive执行了set hive.enforce.bucketing=true;进行分桶失败(未解决)
hive建表,根据remoteIp进行分桶 根据requestmethod进行分区hive> create table partition_cluster_accsslog > ( remoteIp string, > loginRemoteName string, > authrizedName string, > responseCode int, > conten
2020-07-14 10:20:21
2939
3
原创 flume自定义 interceptor 报错没有init方法(已解决)
在Intellij IDEA用java自定flume source,interceptor 打包放在linux上 测试把接收到的数据包装后输出到kafka自定义的JsonInterceptorpackage com.yc.flume.interceptors;import com.alibaba.fastjson.JSONObject;import org.apache.flume.Context;import org.apache.flume.Event;import org.apache.
2020-07-12 19:31:58
773
原创 mongo集群查询 报错 ‘use geoNear command rather than $near query‘ on server xxxx
springboot整合mongo集群对mongo中ibike下的bike进行地理位置查询已添加索引 db.bike.ensureIndex({loc:"2d",status:1})测试报错 ‘use geoNear command rather than $near query’ on server xxxx’…配置代码: @Bean // MongoTemplate由spring 托管 @Primary public MongoTemplate template()
2020-07-09 12:15:56
316
原创 如何理解Java主函数 public static void main(String []args)
首先 main是java程序的入口,java程序通过java虚拟机JVM调用,属于外部调用,所以需要使用public修饰,否则虚拟机无法调用。在java中,没有static的变量或函数,如果想被调用的话,是要先新建一个对象才可以。而main函数作为程序的入口,需要在其它函数实例化之前就启动,这也就是为什么要加一个static。main函数好比一个门,要探索其它函数要先从门进入程序。static提供了这样一个特性,无需建立对象,就可以启动。使用void的原因是当main方法出现返回值时JVM无法进行上抛
2020-07-06 19:30:43
556
原创 redis创建集群 结点连接失败原因
错误:Could not connect to Redis at 192.148.x.x:6379: Connection refused配置文件中:1.bind 127.0.0.1 是否注释2.protected-mode 是否设置为no3.防火墙是否关闭4.命令或ip地址是否写错
2020-07-06 19:18:47
1477
1
原创 windows运行spark word count报错
win10环境运行spark报错(本机Hadoop版本hadoop2.7.1)报错信息:java.lang.UnsatisfiedLinkError: org.apache.hadoop.util.NativeCrc32.nativeComputeChunkedSumsByteArray(II[BI[BIILjava/lang/String;JZ)V at org.apache.hadoop.util.NativeCrc32.nativeComputeChunkedSumsByteArray(Nati
2020-05-20 14:50:29
272
转载 理解迭代器
**Java集合框架的集合类,我们有时候称之为容器。容器的种类有很多种,比如ArrayList、LinkedList、HashSet...,每种容器都有自己的特点,ArrayList底层维护的是一个数组;LinkedList是链表结构的;HashSet依赖的是哈希表,每种容器都有自己特有的数据结构。 因为容器的内部结构不同,很多时候可能不知道该怎样去遍历一个容器中的元素。所以为了使对容器内元素的操...
2019-11-10 14:40:55
150
原创 用数组模拟栈
public class Do { private int arr[]; //存储栈中的元素 private int length=5;//整型数组的长度 private int size;//栈中实际元素的个数 public Do(){ //默认的构造函数 arr=new int[length]; } public Do(int...
2018-12-19 20:28:20
226
原创 井字棋小游戏
/*生成两个数组每个数组默认值为0如果在某个位置画过即赋值为1 * 判断输赢即可通过行列对角线反对角线之后为3来判定*/import java.util.Scanner;public class JingZiQi { static int [][]x=new int [3][3]; static int [][]o=new int [3][3]; static int row;...
2018-12-19 20:26:06
248
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人