【问题标题】:Apache Nutch skipping URLs & truncatingApache Nutch 跳过 URL 和截断
【发布时间】:2019-08-07 14:57:12
【问题描述】:

在我的 nutch-site.xml 中,我添加以下内容以停止截断;但是,在获取过程中,我收到以下错误。我希望它停止截断并提供我需要的结果,我假设 -1 值可以实现。我使用的是 2.2.1 版。有什么想法吗?

<property>
    <name>http.content.limit</name>
    <value>-1</value>
    <description>The length limit for downloaded content using the http
        protocol, in bytes. If this value is nonnegative (>=0), content longer
        than it will be truncated; otherwise, no truncation at all. Do not
        confuse this setting with the file.content.limit setting.
    </description>
</property>

线程“主”java.lang.RuntimeException 中的异常:作业失败: 名称=获取,jobid=job_local1185573074_0001 在 org.apache.nutch.util.NutchJob.waitForCompletion(NutchJob.java:55) 在 org.apache.nutch.fetcher.FetcherJob.run(FetcherJob.java:194) 在 org.apache.nutch.fetcher.FetcherJob.fetch(FetcherJob.java:219) 在 org.apache.nutch.fetcher.FetcherJob.run(FetcherJob.java:301) 在 org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65) 在 org.apache.nutch.fetcher.FetcherJob.main(FetcherJob.java:307)

【问题讨论】:

    标签: java nutch nutch2


    【解决方案1】:

    我通过删除 nutch-site.xml 中的 http.content.limit 部分并添加 parser.skip.truncated 并将其设置为 false 来解决此问题。

    <property>
        <name>parser.skip.truncated</name>
        <value>false</value>
        <description>Boolean value for whether we should skip parsing for truncated documents. By default this
            property is activated due to extremely high levels of CPU which parsing can sometimes take.
        </description>
    </property>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-03-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多