[ASTERIXDB-1989] Move to com.rometools version of Rome
Change-Id: Ia8dd896f6abe34532f2cce70a4fc7632d7a21910
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1886
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Ian Maxon <imaxon@apache.org>
BAD: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
diff --git a/asterixdb/asterix-common/pom.xml b/asterixdb/asterix-common/pom.xml
index 951ad7d..6e79f40 100644
--- a/asterixdb/asterix-common/pom.xml
+++ b/asterixdb/asterix-common/pom.xml
@@ -250,7 +250,6 @@
<dependency>
<groupId>com.rometools</groupId>
<artifactId>rome</artifactId>
- <version>1.5.1</version>
<scope>test</scope>
</dependency>
<dependency>
diff --git a/asterixdb/asterix-common/src/test/java/org/apache/asterix/test/server/RSSFeedServlet.java b/asterixdb/asterix-common/src/test/java/org/apache/asterix/test/server/RSSFeedServlet.java
index f79f5e9..2ebed83 100644
--- a/asterixdb/asterix-common/src/test/java/org/apache/asterix/test/server/RSSFeedServlet.java
+++ b/asterixdb/asterix-common/src/test/java/org/apache/asterix/test/server/RSSFeedServlet.java
@@ -42,7 +42,6 @@
import com.rometools.rome.io.FeedException;
import com.rometools.rome.io.SyndFeedOutput;
-import io.netty.handler.codec.http.HttpMethod;
import io.netty.handler.codec.http.HttpResponseStatus;
public class RSSFeedServlet extends AbstractServlet {
diff --git a/asterixdb/asterix-external-data/pom.xml b/asterixdb/asterix-external-data/pom.xml
index 460f57d..f770889 100644
--- a/asterixdb/asterix-external-data/pom.xml
+++ b/asterixdb/asterix-external-data/pom.xml
@@ -270,28 +270,12 @@
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>net.java.dev.rome</groupId>
+ <groupId>com.rometools</groupId>
<artifactId>rome-fetcher</artifactId>
- <version>1.0.0</version>
- <exclusions>
- <exclusion>
- <artifactId>rome</artifactId>
- <groupId>net.java.dev.rome</groupId>
- </exclusion>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
- <groupId>rome</groupId>
+ <groupId>com.rometools</groupId>
<artifactId>rome</artifactId>
- <version>1.0.1-modified-01</version>
</dependency>
<dependency>
<groupId>org.apache.hive</groupId>
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/rss/RSSRecordReader.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/rss/RSSRecordReader.java
index 5760a7a..44da608 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/rss/RSSRecordReader.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/rss/RSSRecordReader.java
@@ -32,27 +32,27 @@
import org.apache.asterix.external.util.FeedLogManager;
import org.apache.log4j.Logger;
-import com.sun.syndication.feed.synd.SyndEntryImpl;
-import com.sun.syndication.feed.synd.SyndFeed;
-import com.sun.syndication.fetcher.FeedFetcher;
-import com.sun.syndication.fetcher.FetcherEvent;
-import com.sun.syndication.fetcher.FetcherException;
-import com.sun.syndication.fetcher.FetcherListener;
-import com.sun.syndication.fetcher.impl.FeedFetcherCache;
-import com.sun.syndication.fetcher.impl.HashMapFeedInfoCache;
-import com.sun.syndication.fetcher.impl.HttpURLFeedFetcher;
-import com.sun.syndication.io.FeedException;
+import com.rometools.fetcher.FeedFetcher;
+import com.rometools.fetcher.FetcherEvent;
+import com.rometools.fetcher.FetcherException;
+import com.rometools.fetcher.FetcherListener;
+import com.rometools.fetcher.impl.FeedFetcherCache;
+import com.rometools.fetcher.impl.HashMapFeedInfoCache;
+import com.rometools.fetcher.impl.HttpURLFeedFetcher;
+import com.rometools.rome.feed.synd.SyndEntry;
+import com.rometools.rome.feed.synd.SyndFeed;
+import com.rometools.rome.io.FeedException;
-public class RSSRecordReader implements IRecordReader<SyndEntryImpl> {
+public class RSSRecordReader implements IRecordReader<SyndEntry> {
private static final Logger LOGGER = Logger.getLogger(RSSRecordReader.class.getName());
private boolean modified = false;
- private Queue<SyndEntryImpl> rssFeedBuffer = new LinkedList<SyndEntryImpl>();
+ private Queue<SyndEntry> rssFeedBuffer = new LinkedList<>();
private FeedFetcherCache feedInfoCache;
private FeedFetcher fetcher;
private FetcherEventListenerImpl listener;
private URL feedUrl;
- private GenericRecord<SyndEntryImpl> record = new GenericRecord<SyndEntryImpl>();
+ private GenericRecord<SyndEntry> record = new GenericRecord<>();
private boolean done = false;
public RSSRecordReader(String url) throws MalformedURLException {
@@ -78,12 +78,12 @@
}
@Override
- public IRawRecord<SyndEntryImpl> next() throws IOException {
+ public IRawRecord<SyndEntry> next() throws IOException {
if (done) {
return null;
}
try {
- SyndEntryImpl feedEntry;
+ SyndEntry feedEntry;
feedEntry = getNextRSSFeed();
if (feedEntry == null) {
return null;
@@ -105,7 +105,7 @@
this.modified = modified;
}
- private SyndEntryImpl getNextRSSFeed() throws Exception {
+ private SyndEntry getNextRSSFeed() throws IOException, FeedException, FetcherException {
if (rssFeedBuffer.isEmpty()) {
fetchFeed();
}
@@ -117,7 +117,7 @@
}
@SuppressWarnings("unchecked")
- private void fetchFeed() throws IllegalArgumentException, IOException, FeedException, FetcherException {
+ private void fetchFeed() throws IOException, FeedException, FetcherException {
// Retrieve the feed.
// We will get a Feed Polled Event and then a
// Feed Retrieved event (assuming the feed is valid)
@@ -128,7 +128,7 @@
LOGGER.info(feedUrl + " has a title: " + feed.getTitle() + " and contains " + feed.getEntries().size()
+ " entries.");
}
- List<? extends SyndEntryImpl> fetchedFeeds = feed.getEntries();
+ List<SyndEntry> fetchedFeeds = feed.getEntries();
rssFeedBuffer.addAll(fetchedFeeds);
}
}
@@ -158,7 +158,7 @@
}
/**
- * @see com.sun.syndication.fetcher.FetcherListener#fetcherEvent(com.sun.syndication.fetcher.FetcherEvent)
+ * @see com.rometools.fetcher.FetcherListener#fetcherEvent(com.rometools.fetcher.FetcherEvent)
*/
@Override
public void fetcherEvent(FetcherEvent event) {
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/rss/RSSRecordReaderFactory.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/rss/RSSRecordReaderFactory.java
index 831dbc3..af4be91 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/rss/RSSRecordReaderFactory.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/rss/RSSRecordReaderFactory.java
@@ -36,9 +36,9 @@
import org.apache.hyracks.api.context.IHyracksTaskContext;
import org.apache.hyracks.api.exceptions.HyracksDataException;
-import com.sun.syndication.feed.synd.SyndEntryImpl;
+import com.rometools.rome.feed.synd.SyndEntry;
-public class RSSRecordReaderFactory implements IRecordReaderFactory<SyndEntryImpl> {
+public class RSSRecordReaderFactory implements IRecordReaderFactory<SyndEntry> {
private static final long serialVersionUID = 1L;
private final List<String> urls = new ArrayList<>();
@@ -88,7 +88,7 @@
}
@Override
- public IRecordReader<? extends SyndEntryImpl> createRecordReader(IHyracksTaskContext ctx, int partition)
+ public IRecordReader<? extends SyndEntry> createRecordReader(IHyracksTaskContext ctx, int partition)
throws HyracksDataException {
try {
return new RSSRecordReader(urls.get(partition));
@@ -98,8 +98,8 @@
}
@Override
- public Class<? extends SyndEntryImpl> getRecordClass() {
- return SyndEntryImpl.class;
+ public Class<? extends SyndEntry> getRecordClass() {
+ return SyndEntry.class;
}
}
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/parser/RSSParser.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/parser/RSSParser.java
index c2d6be8..b6c2221 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/parser/RSSParser.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/parser/RSSParser.java
@@ -19,7 +19,6 @@
package org.apache.asterix.external.parser;
import java.io.DataOutput;
-import java.io.IOException;
import org.apache.asterix.builders.RecordBuilder;
import org.apache.asterix.external.api.IDataParser;
@@ -28,11 +27,11 @@
import org.apache.asterix.om.base.AMutableRecord;
import org.apache.asterix.om.base.AMutableString;
import org.apache.asterix.om.types.ARecordType;
-
-import com.sun.syndication.feed.synd.SyndEntryImpl;
import org.apache.hyracks.api.exceptions.HyracksDataException;
-public class RSSParser implements IRecordDataParser<SyndEntryImpl> {
+import com.rometools.rome.feed.synd.SyndEntry;
+
+public class RSSParser implements IRecordDataParser<SyndEntry> {
private long id = 0;
private String idPrefix;
private AMutableString[] mutableFields;
@@ -50,8 +49,8 @@
}
@Override
- public void parse(IRawRecord<? extends SyndEntryImpl> record, DataOutput out) throws HyracksDataException {
- SyndEntryImpl entry = record.get();
+ public void parse(IRawRecord<? extends SyndEntry> record, DataOutput out) throws HyracksDataException {
+ SyndEntry entry = record.get();
tupleFieldValues[0] = idPrefix + ":" + id;
tupleFieldValues[1] = entry.getTitle();
tupleFieldValues[2] = entry.getDescription().getValue();
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/parser/factory/RSSParserFactory.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/parser/factory/RSSParserFactory.java
index 7f0d006..a1d2298 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/parser/factory/RSSParserFactory.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/parser/factory/RSSParserFactory.java
@@ -29,9 +29,9 @@
import org.apache.asterix.om.types.ARecordType;
import org.apache.hyracks.api.context.IHyracksTaskContext;
-import com.sun.syndication.feed.synd.SyndEntryImpl;
+import com.rometools.rome.feed.synd.SyndEntry;
-public class RSSParserFactory implements IRecordDataParserFactory<SyndEntryImpl> {
+public class RSSParserFactory implements IRecordDataParserFactory<SyndEntry> {
private static final long serialVersionUID = 1L;
private static final List<String> parserFormats = Collections.unmodifiableList(Arrays.asList("rss"));
@@ -48,14 +48,14 @@
}
@Override
- public IRecordDataParser<SyndEntryImpl> createRecordParser(IHyracksTaskContext ctx) {
+ public IRecordDataParser<SyndEntry> createRecordParser(IHyracksTaskContext ctx) {
RSSParser dataParser = new RSSParser(recordType);
return dataParser;
}
@Override
- public Class<? extends SyndEntryImpl> getRecordClass() {
- return SyndEntryImpl.class;
+ public Class<? extends SyndEntry> getRecordClass() {
+ return SyndEntry.class;
}
@Override
diff --git a/asterixdb/pom.xml b/asterixdb/pom.xml
index dd86bea..0e8617e 100644
--- a/asterixdb/pom.xml
+++ b/asterixdb/pom.xml
@@ -1052,6 +1052,16 @@
<version>18.0</version>
</dependency>
<dependency>
+ <groupId>com.rometools</groupId>
+ <artifactId>rome-fetcher</artifactId>
+ <version>1.7.4</version>
+ </dependency>
+ <dependency>
+ <groupId>com.rometools</groupId>
+ <artifactId>rome</artifactId>
+ <version>1.7.4</version>
+ </dependency>
+ <dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>