Skip to content

armgit / nutch

Public Imported from GitHub
0

Apache Nutch is an extensible and scalable web crawler

fixes for hadoop split

Sami Sirenfe94449ae527
diff --git a/src/web/jsp/anchors.jsp b/src/web/jsp/anchors.jsp
index b13b500c1..3a094f7ff 100644
--- a/src/web/jsp/anchors.jsp
+++ b/src/web/jsp/anchors.jsp
@@ -8,12 +8,13 @@
import="org.apache.nutch.html.Entities"
import="org.apache.nutch.searcher.*"
- import="org.apache.nutch.util.NutchConf"
+ import="org.apache.hadoop.conf.Configuration"
+ import="org.apache.nutch.util.NutchConfiguration"
%><%
- NutchConf nutchConf = (NutchConf) application.getAttribute(NutchConf.class.getName());
+ Configuration nutchConf = (Configuration) application.getAttribute(Configuration.class.getName());
if (nutchConf == null) {
- nutchConf = new NutchConf();
- application.setAttribute(NutchConf.class.getName(), nutchConf);
+ nutchConf = NutchConfiguration.create();
+ application.setAttribute(Configuration.class.getName(), nutchConf);
}
NutchBean bean = NutchBean.get(application, nutchConf);
// set the character encoding to use when interpreting request values
diff --git a/src/web/jsp/cached.jsp b/src/web/jsp/cached.jsp
index 193af8682..07a7ba9d5 100644
--- a/src/web/jsp/cached.jsp
+++ b/src/web/jsp/cached.jsp
@@ -7,12 +7,13 @@
import="org.apache.nutch.searcher.*"
import="org.apache.nutch.parse.ParseData"
import="org.apache.nutch.protocol.ContentProperties"
- import="org.apache.nutch.util.NutchConf"
+ import="org.apache.hadoop.conf.Configuration"
+ import="org.apache.nutch.util.NutchConfiguration"
%><%
- NutchConf nutchConf = (NutchConf) application.getAttribute(NutchConf.class.getName());
+ Configuration nutchConf = (Configuration) application.getAttribute(Configuration.class.getName());
if (nutchConf == null) {
- nutchConf = new NutchConf();
- application.setAttribute(NutchConf.class.getName(), nutchConf);
+ nutchConf = NutchConfiguration.create();
+ application.setAttribute(Configuration.class.getName(), nutchConf);
}
NutchBean bean = NutchBean.get(application, nutchConf);
bean.LOG.info("cache request from " + request.getRemoteAddr());
diff --git a/src/web/jsp/explain.jsp b/src/web/jsp/explain.jsp
index 6f14ac537..3802b27fc 100644
--- a/src/web/jsp/explain.jsp
+++ b/src/web/jsp/explain.jsp
@@ -6,12 +6,13 @@
import="java.io.*"
import="java.util.*"
import="org.apache.nutch.searcher.*"
- import="org.apache.nutch.util.NutchConf"
+ import="org.apache.hadoop.conf.Configuration"
+ import="org.apache.nutch.util.NutchConfiguration"
%><%
- NutchConf nutchConf = (NutchConf) application.getAttribute(NutchConf.class.getName());
+ Configuration nutchConf = (Configuration) application.getAttribute(Configuration.class.getName());
if (nutchConf == null) {
- nutchConf = new NutchConf();
- application.setAttribute(NutchConf.class.getName(), nutchConf);
+ nutchConf = NutchConfiguration.create();
+ application.setAttribute(Configuration.class.getName(), nutchConf);
}
NutchBean bean = NutchBean.get(application, nutchConf);
// set the character encoding to use when interpreting request values
diff --git a/src/web/jsp/refine-query-init.jsp b/src/web/jsp/refine-query-init.jsp
index ac8b2c8a2..e701707b9 100644
--- a/src/web/jsp/refine-query-init.jsp
+++ b/src/web/jsp/refine-query-init.jsp
@@ -13,11 +13,11 @@ org.apache.nutch.ontology.Ontology ontology = null;
// being loaded into the JVM. Need improvement in future.
try {
- org.apache.nutch.util.NutchConf nutchConf = (org.apache.nutch.util.NutchConf) application.getAttribute(org.apache.nutch.util.NutchConf.class.getName());
- if (nutchConf == null) {
- nutchConf = new org.apache.nutch.util.NutchConf();
- application.setAttribute(org.apache.nutch.util.NutchConf.class.getName(), nutchConf);
- }
+ Configuration nutchConf = (Configuration) application.getAttribute(Configuration.class.getName());
+ if (nutchConf == null) {
+ nutchConf = NutchConfiguration.create();
+ application.setAttribute(Configuration.class.getName(), nutchConf);
+ }
String urls = nutchConf.get("extension.ontology.urls");
ontology = new org.apache.nutch.ontology.OntologyFactory(nutchConf).getOntology();
if (urls==null || urls.trim().equals("")) {
diff --git a/src/web/jsp/search.jsp b/src/web/jsp/search.jsp
index f7ab057fe..b3f551e80 100644
--- a/src/web/jsp/search.jsp
+++ b/src/web/jsp/search.jsp
@@ -3,7 +3,6 @@
contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"
- import="javax.servlet.http.*"
import="java.io.*"
import="java.util.*"
import="java.net.*"
@@ -12,15 +11,15 @@
import="org.apache.nutch.searcher.*"
import="org.apache.nutch.plugin.*"
import="org.apache.nutch.clustering.*"
- import="org.apache.nutch.util.NutchConf"
+ import="org.apache.hadoop.conf.*"
+ import="org.apache.nutch.util.NutchConfiguration"
%><%
- NutchConf nutchConf = (NutchConf) application.getAttribute(NutchConf.class.getName());
+ Configuration nutchConf = (Configuration) application.getAttribute(Configuration.class.getName());
if (nutchConf == null) {
- nutchConf = new NutchConf();
- application.setAttribute(NutchConf.class.getName(), nutchConf);
- }
-
+ nutchConf = NutchConfiguration.create();
+ application.setAttribute(Configuration.class.getName(), nutchConf);
+ }
/**
* Number of hits to retrieve and cluster if clustering extension is available
* and clustering is on. By default, 100. Configurable via nutch-conf.xml.
diff --git a/src/web/jsp/text.jsp b/src/web/jsp/text.jsp
index fe37fdf7f..630f4d096 100644
--- a/src/web/jsp/text.jsp
+++ b/src/web/jsp/text.jsp
@@ -6,15 +6,16 @@
import="org.apache.nutch.searcher.*"
import="org.apache.nutch.parse.ParseText"
- import="org.apache.nutch.util.NutchConf"
+ import="org.apache.hadoop.conf.Configuration"
+ import="org.apache.nutch.util.NutchConfiguration"
%><%
// show the content of a hit as plain text
- NutchConf nutchConf = (NutchConf) application.getAttribute(NutchConf.class.getName());
+ Configuration nutchConf = (Configuration) application.getAttribute(Configuration.class.getName());
if (nutchConf == null) {
- nutchConf = new NutchConf();
- application.setAttribute(NutchConf.class.getName(), nutchConf);
+ nutchConf = NutchConfiguration.create();
+ application.setAttribute(Configuration.class.getName(), nutchConf);
}
NutchBean bean = NutchBean.get(application, nutchConf);