把Flume的Source设置为 Spooling directory source,在设定的目录下放置需要读取的文件,一些文件在读取过程中会报错。

文件格式和报错如下:

实验一

读取汉子和“;"符号的TXT文档

会报一下错误

  1. 2015-11-06 22:16:02,386 (pool-3-thread-1) [ERROR - org.apache.flume.source.SpoolDirectorySource$SpoolDirectoryRunnable.run(SpoolDirectorySource.java:256)] FATAL: Spool Directory source r1: { spoolDir: /home/hadoop/flumeSpool-2 }: Uncaught exception in SpoolDirectorySource thread. Restart or reconfigure Flume to continue processing.
  2. java.nio.charset.MalformedInputException: Input length = 1
  3. at java.nio.charset.CoderResult.throwException(CoderResult.java:281)
  4. at org.apache.flume.serialization.ResettableFileInputStream.readChar(ResettableFileInputStream.java:195)

实验二

读取数字和”;“符号的TXT文档

报错

  1. 2015-11-06 22:22:49,012 (pool-3-thread-1) [ERROR - org.apache.flume.source.SpoolDirectorySource$SpoolDirectoryRunnable.run(SpoolDirectorySource.java:256)] FATAL: Spool Directory source r1: { spoolDir: /home/hadoop/flumeSpool-3 }: Uncaught exception in SpoolDirectorySource thread. Restart or reconfigure Flume to continue processing.
  2. java.nio.charset.MalformedInputException: Input length = 1
  3. at java.nio.charset.CoderResult.throwException(CoderResult.java:281)
  4. at org.apache.flume.serialization.ResettableFileInputStream.readChar(ResettableFileInputStream.java:195)

此报错与前面的报错相同。

实验三

读取数字和”回车符“的TXT文档

报错:

  1. 2015-11-06 22:28:06,889 (pool-3-thread-1) [ERROR - org.apache.flume.source.SpoolDirectorySource$SpoolDirectoryRunnable.run(SpoolDirectorySource.java:256)] FATAL: Spool Directory source r1: { spoolDir: /home/hadoop/flumeSpool-7 }: Uncaught exception in SpoolDirectorySource thread. Restart or reconfigure Flume to continue processing.
  2. java.nio.charset.MalformedInputException: Input length = 1
  3. at java.nio.charset.CoderResult.throwException(CoderResult.java:281)
  4. at org.apache.flume.serialization.ResettableFileInputStream.readChar(ResettableFileInputStream.java:195)

实验四

读取数字,字母,汉字组成的csv文件

报错:

  1. 2015-11-06 22:40:34,781 (pool-3-thread-1) [ERROR - org.apache.flume.source.SpoolDirectorySource$SpoolDirectoryRunnable.run(SpoolDirectorySource.java:256)] FATAL: Spool Directory source r1: { spoolDir: /home/hadoop/flumeSpool-6 }: Uncaught exception in SpoolDirectorySource thread. Restart or reconfigure Flume to continue processing.
  2. java.nio.charset.MalformedInputException: Input length = 1
  3. at java.nio.charset.CoderResult.throwException(CoderResult.java:281)
  4. at org.apache.flume.serialization.ResettableFileInputStream.readChar(ResettableFileInputStream.java:195)
  5. at org.apache.flume.serialization.LineDeserializer.readLine(LineDeserializer.java:133)
  6. at org.apache.flume.serialization.LineDeserializer.readEvent(LineDeserializer.java:71)

实验五

读取数字和汉字组成的TXT文件

报错:

  1. 2015-11-06 23:34:29,455 (pool-3-thread-1) [ERROR - org.apache.flume.source.SpoolDirectorySource$SpoolDirectoryRunnable.run(SpoolDirectorySource.java:256)] FATAL: Spool Directory source r1: { spoolDir: /home/hadoop/flumeSpool-10 }: Uncaught exception in SpoolDirectorySource thread. Restart or reconfigure Flume to continue processing.
  2. java.nio.charset.MalformedInputException: Input length = 1
  3. <span style="white-space:pre">    </span>at java.nio.charset.CoderResult.throwException(CoderResult.java:281)
  4. <span style="white-space:pre">    </span>at org.apache.flume.serialization.ResettableFileInputStream.readChar(ResettableFileInputStream.java:195)
  5. <span style="white-space:pre">    </span>at org.apache.flume.serialization.LineDeserializer.readLine(LineDeserializer.java:133)
  6. <span style="white-space:pre">    </span>at org.apache.flume.serialization.LineDeserializer.readEvent(LineDeserializer.java:71)
  7. <span style="white-space:pre">    </span>at org.apache.flume.serialization.LineDeserializer.readEvents(LineDeserializer.java:90)
  8. <span style="white-space:pre">    </span>at org.apache.flume.client.avro.ReliableSpoolingFileEventReader.readEvents(ReliableSpoolingFileEventReader.java:252)
  9. <span style="white-space:pre">    </span>at org.apache.flume.source.SpoolDirectorySource$SpoolDirectoryRunnable.run(SpoolDirectorySource.java:228)
  10. <span style="white-space:pre">    </span>at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
  11. <span style="white-space:pre">    </span>at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
  12. <span style="white-space:pre">    </span>at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)

成功的实验一

一排数字,什么符号都没有

成功的实验二

如上所示,不缺定是否使用了”回车符“。

把Flume的Source设置为 Spooling directory source的更多相关文章

  1. Spooling Directory Source使用技巧

    1.使用文件原来的名字 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 a1.sources=r1   a1.sinks=k1   a1.sources.r1.ty ...

  2. Flume-Spooling Directory Source 监控目录下多个新文件

    使用 Flume 监听整个目录的文件,并上传至 HDFS. 一.创建配置文件 flume-dir-hdfs.conf https://flume.apache.org/FlumeUserGuide.h ...

  3. gen already exists but is not a source folder. Convert to a source folder or rename it.

    异常提示: gen already exists but is not a source folder. Convert to a source folder or rename it.   错误原因 ...

  4. 将Samba设置为Active Directory域控制器

    一 简介 从版本4.0开始,samba可以作为Active Directory(AD)域控制器(DC)运行,如果在生产环境中安装samba,建议运行两个或者多个DC用于故障转移 本文介绍如何让将一个S ...

  5. Flume的Avro Sink和Avro Source研究之一: Avro Source

    问题 : Avro Source提供了怎么样RPC服务,是怎么提供的? 问题 1.1 Flume Source是如何启动一个Netty Server来提供RPC服务. 由GitHub上avro-rpc ...

  6. flume 1.4 设置FLUME_CONF_DIR没用

    今天安装Apache Flume 1.4的时候,发现设置了FLUME_CONF_DIR环境变量和flume-env.sh后,运行flume-ng时flume-env.sh中的JAVA_HOME没有生效 ...

  7. Configuration must specify a spooling directory

    启动spooling源时报错: 原因:spooling配置文件有误 a1.sources.r1.type = spooldir a1.sources.r1.spooldir = /usr/local/ ...

  8. WPF Image Source 设置相对路径图片

    BitmapImage bt = new BitmapImage(new Uri("Images\\3_u10484.png", UriKind.Relative));this.I ...

  9. eclipse调试(debug)的时候,出现Source not found,Edit Source Lookup Path,一闪而过

    问题描述 使用Eclipse调试代码的时候,打了断点,经常出现Source not found,网上找了半天,大部分提示点击Edit Source Lookup Path,添加被调试的工程,然而往往没 ...

随机推荐

  1. Java读取Properties文件的六种方法

    使用J2SE API读取Properties文件的六种方法 1.使用java.util.Properties类的load()方法示例: InputStream in = lnew BufferedIn ...

  2. Codeforces Round #340 (Div. 2) E. XOR and Favorite Number 莫队算法

    E. XOR and Favorite Number 题目连接: http://www.codeforces.com/contest/617/problem/E Descriptionww.co Bo ...

  3. ubuntu完美卸载JDK

    要删除 OpenJDK (如果已安装的话).首先,检查是安装的哪个 OpenJDK包. # dpkg --list | grep -i jdk 移除 openjdk包: # apt-get purge ...

  4. C# 如何编辑文件的摘要信息

    我的以前的测试报告程序需要在倒完测试数据报告后,在文件摘要中加上一些类似版权说明的文字等等. 因此需要对文件摘要信息进行编辑. 我的记忆中以前好像只有office文档才可以又摘要信息, 现在看来基本上 ...

  5. Java读取Properties配置文件

    1.Properties类与Properties配置文件 Properties类继承自Hashtable类并且实现了Map接口,使用键值对的形式来保存属性集.不过Properties的键和值都是字符串 ...

  6. [Angular 2] Share a Service Across Angular 2 Components and Modules

    Services are used to share data between components. They follow a module pattern that allows you to ...

  7. iOS开发——实用技术OC篇&简单抽屉效果的实现

    简单抽屉效果的实现 就目前大部分App来说基本上都有关于抽屉效果的实现,比如QQ/微信等.所以,今天我们就来简单的实现一下.当然如果你想你的效果更好或者是封装成一个到哪里都能用的工具类,那就还需要下一 ...

  8. oc-30-堆栈

    /** 操作引用计数器的方式:每个对象内部(对象的堆内存里面)都有一个引用计数器变量,表示对象被引用的次数. 1:retainCount:获得对象的引用计数器的值 2:retain:能够让对象的计数器 ...

  9. 《linux性能及调优指南》

    http://blog.chinaunix.net/uid-26000296-id-4065871.html

  10. 主流手持设备GPU性能比较

    设备 GPU CPU 每秒像素填充率 每秒三角形生成 内存 iPhone4 PowerVR SGX 535 ARM Cortex-A8 800M     512M iPod touch 4 Power ...