Skip to content

Commit 4a61208

Browse files
Merge pull request #828 from sebastian-nagel/NUTCH-3073
NUTCH-3073 Address Java compiler warning
2 parents d6f55b8 + e678777 commit 4a61208

33 files changed

Lines changed: 50 additions & 95 deletions

File tree

src/java/org/apache/nutch/crawl/AbstractFetchSchedule.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
import org.apache.hadoop.conf.Configuration;
2020
import org.apache.hadoop.conf.Configured;
2121
import org.apache.hadoop.io.Text;
22-
import org.apache.nutch.crawl.CrawlDatum;
23-
2422
import org.slf4j.Logger;
2523
import org.slf4j.LoggerFactory;
2624

src/java/org/apache/nutch/crawl/AdaptiveFetchSchedule.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import org.apache.hadoop.conf.Configuration;
2020
import org.apache.hadoop.io.Text;
2121
import org.apache.hadoop.io.FloatWritable;
22-
import org.apache.nutch.crawl.CrawlDatum;
2322
import org.apache.nutch.metadata.Nutch;
2423
import org.apache.nutch.util.NutchConfiguration;
2524
import org.apache.commons.lang.StringUtils;

src/java/org/apache/nutch/crawl/Generator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
* fetchlists for several segments in one go. Unlike in the initial version
8686
* (OldGenerator), the IP resolution is done ONLY on the entries which have been
8787
* selected for fetching. The URLs are partitioned by IP, domain or host within
88-
* a segment. We can chose separately how to count the URLS i.e. by domain or
88+
* a segment. We can choose separately how to count the URLs i.e. by domain or
8989
* host to limit the entries.
9090
**/
9191
public class Generator extends NutchTool implements Tool {

src/java/org/apache/nutch/crawl/MimeAdaptiveFetchSchedule.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import org.apache.commons.lang.StringUtils;
2626
import org.apache.hadoop.conf.Configuration;
2727
import org.apache.hadoop.io.Text;
28-
import org.apache.nutch.crawl.CrawlDatum;
2928
import org.apache.nutch.metadata.HttpHeaders;
3029
import org.apache.nutch.util.MimeUtil;
3130
import org.apache.nutch.util.NutchConfiguration;

src/java/org/apache/nutch/fetcher/FetcherThread.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -404,11 +404,6 @@ public void run() {
404404

405405
switch (status.getCode()) {
406406

407-
case ProtocolStatus.WOULDBLOCK:
408-
// retry ?
409-
fetchQueues.addFetchItem(fit);
410-
break;
411-
412407
case ProtocolStatus.SUCCESS: // got a page
413408
pstatus = output(fit.url, fit.datum, content, status,
414409
CrawlDatum.STATUS_FETCH_SUCCESS, fit.outlinkDepth);
@@ -457,8 +452,8 @@ public void run() {
457452
context.getCounter("FetcherStatus",
458453
"AboveExceptionThresholdInQueue").increment(killedURLs);
459454
/* FALLTHROUGH */
455+
460456
case ProtocolStatus.RETRY: // retry
461-
case ProtocolStatus.BLOCKED:
462457
output(fit.url, fit.datum, null, status,
463458
CrawlDatum.STATUS_FETCH_RETRY);
464459
break;

src/java/org/apache/nutch/indexer/NutchIndexAction.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222

2323
import org.apache.hadoop.io.Writable;
2424

25-
import org.apache.nutch.indexer.NutchDocument;
26-
2725
/**
2826
* A {@link NutchIndexAction} is the new unit of indexing holding the document
2927
* and action information.

src/java/org/apache/nutch/service/NutchReader.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525
import org.slf4j.Logger;
2626
import org.slf4j.LoggerFactory;
2727

28-
public interface NutchReader {
28+
public interface NutchReader {
2929

3030
static final Logger LOG = LoggerFactory
3131
.getLogger(MethodHandles.lookup().lookupClass());
3232
public static final Configuration conf = NutchConfiguration.create();
3333

34-
public List read(String path) throws FileNotFoundException;
35-
public List head(String path, int nrows) throws FileNotFoundException;
36-
public List slice(String path, int start, int end) throws FileNotFoundException;
34+
public List<?> read(String path) throws FileNotFoundException;
35+
public List<?> head(String path, int nrows) throws FileNotFoundException;
36+
public List<?> slice(String path, int start, int end) throws FileNotFoundException;
3737
public int count(String path) throws FileNotFoundException;
3838
}

src/java/org/apache/nutch/service/impl/LinkReader.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@
3333
import org.apache.nutch.scoring.webgraph.LinkDatum;
3434
import org.apache.nutch.service.NutchReader;
3535

36-
public class LinkReader implements NutchReader{
36+
public class LinkReader implements NutchReader {
3737

3838
@Override
39-
public List read(String path) throws FileNotFoundException {
40-
List<HashMap> rows= new ArrayList<>();
39+
public List<HashMap<String, String>> read(String path) throws FileNotFoundException {
40+
List<HashMap<String, String>> rows= new ArrayList<>();
4141
Path file = new Path(path);
4242
SequenceFile.Reader reader;
4343
try{
@@ -69,8 +69,8 @@ public List read(String path) throws FileNotFoundException {
6969
}
7070

7171
@Override
72-
public List head(String path, int nrows) throws FileNotFoundException {
73-
List<HashMap> rows= new ArrayList<>();
72+
public List<HashMap<String, String>> head(String path, int nrows) throws FileNotFoundException {
73+
List<HashMap<String, String>> rows= new ArrayList<>();
7474
Path file = new Path(path);
7575
SequenceFile.Reader reader;
7676
try{
@@ -101,9 +101,9 @@ public List head(String path, int nrows) throws FileNotFoundException {
101101
}
102102

103103
@Override
104-
public List slice(String path, int start, int end)
104+
public List<HashMap<String, String>> slice(String path, int start, int end)
105105
throws FileNotFoundException {
106-
List<HashMap> rows= new ArrayList<>();
106+
List<HashMap<String, String>> rows= new ArrayList<>();
107107
Path file = new Path(path);
108108
SequenceFile.Reader reader;
109109
try{

src/java/org/apache/nutch/service/impl/NodeReader.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
public class NodeReader implements NutchReader {
3737

3838
@Override
39-
public List read(String path) throws FileNotFoundException {
40-
List<HashMap> rows= new ArrayList<>();
39+
public List<HashMap<String, String>> read(String path) throws FileNotFoundException {
40+
List<HashMap<String, String>> rows= new ArrayList<>();
4141
Path file = new Path(path);
4242
SequenceFile.Reader reader;
4343
try{
@@ -70,8 +70,8 @@ public List read(String path) throws FileNotFoundException {
7070
}
7171

7272
@Override
73-
public List head(String path, int nrows) throws FileNotFoundException {
74-
List<HashMap> rows= new ArrayList<>();
73+
public List<HashMap<String, String>> head(String path, int nrows) throws FileNotFoundException {
74+
List<HashMap<String, String>> rows= new ArrayList<>();
7575
Path file = new Path(path);
7676
SequenceFile.Reader reader;
7777
try{
@@ -102,9 +102,9 @@ public List head(String path, int nrows) throws FileNotFoundException {
102102
}
103103

104104
@Override
105-
public List slice(String path, int start, int end)
105+
public List<HashMap<String, String>> slice(String path, int start, int end)
106106
throws FileNotFoundException {
107-
List<HashMap> rows= new ArrayList<>();
107+
List<HashMap<String, String>> rows= new ArrayList<>();
108108
Path file = new Path(path);
109109
SequenceFile.Reader reader;
110110
try{

src/java/org/apache/nutch/util/EncodingDetector.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import org.apache.nutch.metadata.Metadata;
3434
import org.apache.nutch.net.protocols.Response;
3535
import org.apache.nutch.protocol.Content;
36-
import org.apache.nutch.util.NutchConfiguration;
3736

3837
import com.ibm.icu.text.CharsetDetector;
3938
import com.ibm.icu.text.CharsetMatch;

0 commit comments

Comments
 (0)