2015年4月21日

Hadoop could not find or load main class

摘要: Error: Could not find or load main class 我在尝试使用hadoop definitive guide的代码做练习时,遇到一个问题, hadoop URLCat hdfs://namenode/data/input/test.txt 报找不到URLCat的错误 这种类型的错误造成的原因是要找到的类不在hadoop的 classpath中。 你可以使... 阅读全文

posted @ 2015-04-21 22:05 tneduts 阅读(959) 评论(0) 推荐(0) 编辑

Hive get table rows count batch

摘要: 项目中需要比对两种方法计算生成的数据情况,需要做两件事情,比对生成的中间表的行数是否相同,比对最后一张表的数据是否一致。在获取表的数据量是一条一条地使用select count(*) from table来获取等待结果比较烦人,所以就写了一个bash shell来做这件事。但一开始是这样的:for ... 阅读全文

posted @ 2015-04-21 07:18 tneduts 阅读(668) 评论(0) 推荐(0) 编辑

Hadoop blocks

摘要: 一In cases where the last record in a block is incomplete, the input split includes location information for the next block and the byte offset of the data needed to complete the record. 假如我们有一个12... 阅读全文

posted @ 2015-04-21 06:46 tneduts 阅读(159) 评论(2) 推荐(0) 编辑

2015年4月19日

Learning C Struct

摘要: 为什么需要结构体类型? 一种语言本身往往会提供一些最基本的数据类型,比如数字型(int,bigint,float,double等),字符型,日期型,布尔型等。但现实世界中,我们面对的对象总是非常复常,不仅仅是一个数字或一个字符串就能够表达的,所以在现代的语言中,如java,C#等OO的语言,有一个class对象,来封装这些。 举一个简单的场景,如果我们有一个函数,处理的对象是学生对象,则每一次... 阅读全文

posted @ 2015-04-19 21:30 tneduts 阅读(254) 评论(0) 推荐(0) 编辑

2015年4月18日

Linux shell get random number

摘要: the Shell Profile: When a new interactive shell is started, /etc/profile, followed by /etc/bash.bashrc(if a bash shell), ~/.profile, and finally ~... 阅读全文

posted @ 2015-04-18 21:38 tneduts 阅读(1060) 评论(0) 推荐(0) 编辑

Linux Bash shell one practice : array if else

摘要: shell practice 1 1.require A B C D 1 2 3 4 5 6 7 8 3 5 8 0 1 2 4 3 after handling: T A B C D A 1 2 3 4 B 5 6 7 8 C 3 5 8 0 D 1 2 4 3 1.first need read the firs... 阅读全文

posted @ 2015-04-18 12:29 tneduts 阅读(421) 评论(1) 推荐(0) 编辑

2015年4月14日

Linux shell misc

摘要: sometimes you will write shell in windows platform, be careful for this, adjust the notepad plus plus information. /etc/profile A global configuration script that applies to all users. ~/.bas... 阅读全文

posted @ 2015-04-14 20:31 tneduts 阅读(325) 评论(2) 推荐(0) 编辑

2015年4月13日

Bash Shell read file line by line and substring

摘要: #read one file line by linefor line in $(cat test1.txt); do echo $line ;done;#while read split line by spacewhile read line do for word in $lin... 阅读全文

posted @ 2015-04-13 08:05 tneduts 阅读(1525) 评论(3) 推荐(0) 编辑

2015年4月12日

storm的并发和消息保障性

摘要: Storm并发配置的优先级: defaults.yaml < storm.yaml < topology-specific configuration < internal component-specific configuration < external component-specific configuration 通过下图来理解并行度的一些配置: 消息的可靠处理机制... 阅读全文

posted @ 2015-04-12 13:42 tneduts 阅读(270) 评论(0) 推荐(0) 编辑

Storm之spout,bolt编写

摘要: Storm,核心代码使用clojure书写,实用程序使用python开发,使用java开发拓扑。 Nimbus节点接收到请求,对提交的拓扑进行分片,分成一个个的task,并将task和supervisor相关的信息提交到zookeeper集群上,supervisor会去zookeeper集群上领自己的task,通知自己的worker进程进行Task的处理。 Spout的主要方法: op... 阅读全文

posted @ 2015-04-12 13:23 tneduts 阅读(2070) 评论(0) 推荐(0) 编辑

Storm 基础知识

摘要: 分布式的实时计算框架,storm对于实时计算的意义类似于hadoop对于批处理的意义。 Storm的适用场景: 1.流数据处理:storm可以用来处理流式数据,处理之后将结果写到某个存入中去。 2.持续计算:连续发送数据到客户端,使它们能够实时更新并显示结果,如网站指标 3.分布式RPC:由于storm的处理组件是分布式的,而且处理延迟极低,所以可以作为一个通用的分布式rpc框架来使用。... 阅读全文

posted @ 2015-04-12 09:42 tneduts 阅读(393) 评论(0) 推荐(0) 编辑

2015年4月11日

WDK编程的一些特殊点

摘要: 函数的多线程安全性在内核编程中比用户态应用程序的编程更常见。 调用源 运行环境 原因 driverEntry,DriverUnload 单线程 这两个函数由系统进程的单一线程调用,不会出现多线程同时调用 的情况 各种分发函数 多线程 ... 阅读全文

posted @ 2015-04-11 09:58 tneduts 阅读(645) 评论(0) 推荐(0) 编辑

windows内核编程之常用数据结构

摘要: 1.返回状态 绝大部分的内核api返回值都是一个返回状态,也就是一个错误代码。这个类型为NTSTATUS.我们自己写的函数也大部分这样做。 NTSTATUS MyFunction() { NTSTATUS status; …. return status; } 如果碰到一个函数返回了奇特的NTSTATUS值,正确的方法是在WDK的头文件比如(NTSTATUS.h)中... 阅读全文

posted @ 2015-04-11 09:17 tneduts 阅读(1590) 评论(0) 推荐(0) 编辑

2015年4月10日

hadoop debug script

摘要: A Hadoop job may consist of many map tasks and reduce tasks. Therefore, debugging a Hadoop job is often a complicated process. It is a good practice to first test a Hadoop job using unit tests ... 阅读全文

posted @ 2015-04-10 07:46 tneduts 阅读(285) 评论(0) 推荐(0) 编辑

Hadoop with tool interface

摘要: Often Hadoop jobsare executed through a command line. Therefore, each Hadoop job has to support reading, parsing, and processing command-line arguments. To avoid each developer having to rewrit... 阅读全文

posted @ 2015-04-10 06:55 tneduts 阅读(293) 评论(0) 推荐(0) 编辑

2015年4月6日

six month dormancy test

摘要: source data:accountleg year_month amount acc1A 2010-01 100 acc1A 2010-02 100 acc1A 2010-03 100 acc1A 2010-04 100 acc1A 2010-06 100 ... 阅读全文

posted @ 2015-04-06 08:21 tneduts 阅读(281) 评论(1) 推荐(0) 编辑

2015年4月5日

虚拟地址空间

摘要: 当处理器读或写入内存位置时,它会使用虚拟地址。作为读或写操作的一部分,处理器将虚拟地址转换为物理地址。通过虚拟地址访问内存有以下优势: 程序可以使用一系列相邻的虚拟地址来访问物理内存中不相邻的大内存缓冲区。 程序可以使用一系列虚拟地址来访问大于可用物理内存的内存缓冲区。当物理内存的供应量变小时,内存管理器会将物理内存页(通常大小为 4 KB)保存到磁盘文件。... 阅读全文

posted @ 2015-04-05 10:02 tneduts 阅读(448) 评论(0) 推荐(0) 编辑

用户模式和内核模式

摘要: https://msdn.microsoft.com/zh-cn/library/windows/hardware/ff554836 运行 Windows 的计算机中的处理器有两个不同模式:“用户模式”和“内核模式”。根据处理器上运行的代码的类型,处理器在两个模式之间切换。应用程序在用户模式下运行,核心操作系统组件在内核模式下运行。多个驱动程序在内核模式下运行,但某些驱动程序在用户模式下运行。 ... 阅读全文

posted @ 2015-04-05 09:10 tneduts 阅读(5861) 评论(0) 推荐(0) 编辑

什么是驱动程序

摘要: http://www.microsoft.com/en-us/download/details.aspx?id=11800 可以下载此驱动开发包,《寒江独钓WINDOWS内核安全编程》这本书的代码就可以 使用这个版本的WDK进行编译。 驱动程序是一个软件组件,可让操作系统和设备彼此通信。 扩大定义: 并非所有驱动程序都必须由设计该设备的公司编写。在多种情形下,设备根据已发布的硬件标... 阅读全文

posted @ 2015-04-05 08:58 tneduts 阅读(954) 评论(0) 推荐(0) 编辑

2015年3月31日

寄存器(内存访问)

摘要: 节选自王爽《汇编语言》第三章内容 CPU中用16位寄存器来存储一个字,但内存单元是字节单元,一个单元存储一个字节,需要两个地址连接的内存单元来存放。字的低位字节存放在低地址单元中,高位字节存放在高地址单元中。 CPU要读写一个内存单元的时候,必须先给出这个内存单元的地址,在8086PC中,内存地址由段地址和偏移地址组成。 Mov 寄存器名称 [内存地址偏移量] 默认段地址存放在DS中。 ... 阅读全文

posted @ 2015-03-31 08:18 tneduts 阅读(1084) 评论(0) 推荐(0) 编辑

汇编学习第一节

摘要: 汇编指令和机器指令的差别在于指令的表示方法上。汇编指令是机器指令便于记忆的书写格式。 汇编指令是机器指令的助记符。 寄存器: CPU中可以存储数据的器件,一个CPU中有多个寄存器。 AX BX都是寄存器的代号。 汇编语言由以下三部分组成: 1.汇编指令(机器码的助记符) 2.伪指令(由编译器执行) 3.其他符号(由编译器识别) CPU 我们需要向CPU提供指令和数据,它才能工作。 ... 阅读全文

posted @ 2015-03-31 07:22 tneduts 阅读(256) 评论(1) 推荐(0) 编辑

Hive Experiment 2(表动态分区和IDE)

摘要: 1.使用oracle sql developer 4.0.3作为hive query的IDE。下载hive-jdbc driverhttp://www.cloudera.com/content/cloudera/en/downloads/connectors/hive/jdbc/hive-jdbc-... 阅读全文

posted @ 2015-03-31 07:03 tneduts 阅读(488) 评论(0) 推荐(0) 编辑

2015年3月29日

Learning c section 1

摘要: #include void main() { puts("hello world"); int x=4; //the %p format will print out the location in hex(base lb) format printf("x lives at %p\n",&x); int * addr_of_x = &x; printf("x lives at %p... 阅读全文

posted @ 2015-03-29 13:10 tneduts 阅读(181) 评论(0) 推荐(0) 编辑

2015年3月27日

Hive history date mapping

摘要: Hive history table mappingcreate table fdl_family asselect * from (select 'acc1' as account,'family1' as family,'2010-01-01' as effect_date from nums ... 阅读全文

posted @ 2015-03-27 07:47 tneduts 阅读(331) 评论(1) 推荐(0) 编辑

2015年3月26日

java poi read write xlsx

摘要: package myjava; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.sql.Date; import ja... 阅读全文

posted @ 2015-03-26 07:40 tneduts 阅读(469) 评论(0) 推荐(0) 编辑

2015年3月25日

Hive variable demo

摘要: create table ori_trans (account string, maker string, tdate string) partitioned by (country string);hive -f test1.hql --hiveconf country='china'hive ... 阅读全文

posted @ 2015-03-25 22:22 tneduts 阅读(349) 评论(0) 推荐(0) 编辑

Hive tuning tips

摘要: 1. limit Hive has a configuration property to enable sampling of source data for use with LIMIT: hive.limit.optimize.enable, set this parameter to ... 阅读全文

posted @ 2015-03-25 07:09 tneduts 阅读(228) 评论(1) 推荐(0) 编辑

2015年3月24日

Hive UDF’S addMonths

摘要: our project use hive 0.10 , and in the hiveql , we need use addMonths function builtin in hive-0.11.so I write this udf and test.java code:package myu... 阅读全文

posted @ 2015-03-24 21:59 tneduts 阅读(731) 评论(0) 推荐(0) 编辑

hiveql basic

摘要: set hive.cli.print.current.db=true; set hive.mapred.mode=strict; set hive.mapred.mode=nonstrict; SHOW PARTITIONS tablename; --Dynamic Par... 阅读全文

posted @ 2015-03-24 07:38 tneduts 阅读(232) 评论(0) 推荐(0) 编辑

2015年3月23日

2015 checklist

该文被密码保护。 阅读全文

posted @ 2015-03-23 07:33 tneduts 阅读(5) 评论(1) 推荐(0) 编辑

2015年3月18日

Hive Word count

摘要: --https://github.com/slimandslam/pig-hive-wordcount/blob/master/wordcount.hqlDROP TABLE myinput;DROP TABLE wordcount;CREATE TABLE myinput (line STRING... 阅读全文

posted @ 2015-03-18 14:08 tneduts 阅读(497) 评论(1) 推荐(0) 编辑

Hive drop table batched

摘要: if the hive version not support drop table tablename purge.your drop table command will move data to .Trash in hdfs.dfs .Trash;drop table tablename;df... 阅读全文

posted @ 2015-03-18 13:39 tneduts 阅读(1008) 评论(0) 推荐(0) 编辑

2015年3月17日

BendFord's law's Chi square test

摘要: http://www.siam.org/students/siuro/vol1issue1/S01009.pdfbendford'lawe=log10(1+l/n)o=freq of first digit / totalx2= N*sum(power((o-e),2)/e)1-9的乘法表中的数字算... 阅读全文

posted @ 2015-03-17 07:51 tneduts 阅读(271) 评论(1) 推荐(0) 编辑

2015年3月14日

Hive UDF 实验1

摘要: 项目中使用的hive版本低于0.11,无法使用hive在0.11中新加的开窗分析函数。在项目中需要使用到row_number()函数的地方,有人写了udf来实现这个功能。new java project, BuildPath add hadoop-core..jar and hive-exec…ja... 阅读全文

posted @ 2015-03-14 16:27 tneduts 阅读(1295) 评论(4) 推荐(1) 编辑

2015年3月5日

java charset detector

摘要: https://code.google.com/p/juniversalchardet/downloads/listjava移植mozilla的编码自动检测库(源码为c++),准确率高。通过svn签出只读版本的代码:# Non-members may check out a read-only wo... 阅读全文

posted @ 2015-03-05 08:32 tneduts 阅读(1031) 评论(0) 推荐(0) 编辑

2015年3月4日

java Annotation Demo

摘要: Java 1.5引入了annotation,这个功能非常好用,是用c#等语言借鉴过来的一个特性。首先编译器本身支持一些像overrides,supresswarning之类的注解。Spring,junit等框架也自己写并且处理自己定义的注解,让java具有了一些声明式编程的一些特点,而且减少了代码量... 阅读全文

posted @ 2015-03-04 07:02 tneduts 阅读(519) 评论(0) 推荐(0) 编辑

2015年2月28日

Reducejoin sample

摘要: 示例文件同sample join analysis 之前的示例是使用map端的join.这次使用reduce端的join. 根据源的类别写不同的mapper,处理不同的文件,输出的key都是studentno.value是其他的信息同时加上类别信息。 然后使用multipleinputs不同的路径注册不同的mapper. reduce端相同的studentno的学生信息和考试成绩分配给同... 阅读全文

posted @ 2015-02-28 17:15 tneduts 阅读(176) 评论(0) 推荐(0) 编辑

java Memorymapfile demo

摘要: String lineseperator = java.security.AccessController .doPrivileged(new sun.security.action.GetPropertyAction( "line.separator")); Access restriction: The constructor 'GetPropertyAction(String)'... 阅读全文

posted @ 2015-02-28 11:14 tneduts 阅读(678) 评论(0) 推荐(0) 编辑

java :hello world

摘要: 练习java的基本语法。 output hellow world. 需求:打包自身项目的bin目录文件为一个临时可运行的jar文件,执行完后删除。 使用process执行jar文件,返回输入流和错误流的信息。 熟悉了java –cp jarname.jar , java –jar jarname 等命令的使用。 生成可执行jar包和非可执行jar包的区别就在于是否在manifest中... 阅读全文

posted @ 2015-02-28 06:52 tneduts 阅读(260) 评论(1) 推荐(0) 编辑

Java dynamical proxy demo

摘要: 今天练习了一下动态代理的一个方面,假设使用它来完成自动设置默认不提交,启动事务,获取到异常则回滚,正常执行则提交。 如果不使用动态代理,则需要在每个方法本身里面设置Connection,写try,catch语句,重复的工作。 为什么要使用动态代理? 我们的业务层可以更加专注于业务本身,把其他相关的活抽象出来共同处理,如日志处理和异常处理等。这样的代码更干净。 代码示例如下: imp... 阅读全文

posted @ 2015-02-28 06:43 tneduts 阅读(153) 评论(0) 推荐(0) 编辑

导航