This is an automated email from the ASF dual-hosted git repository.
lewismc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-sdap-mudrod.git
The following commit(s) were added to refs/heads/master by this push:
new fa6cfd9 SDAP-198 InterruptedExceptions are handled. (#46)
fa6cfd9 is described below
commit fa6cfd9ad477f9ccd33607ae3998acfdd89cef34
Author: Furkan KAMACI <[email protected]>
AuthorDate: Wed Aug 7 02:06:28 2019 +0300
SDAP-198 InterruptedExceptions are handled. (#46)
---
core/src/main/java/org/apache/sdap/mudrod/driver/ESDriver.java | 3 +++
.../java/org/apache/sdap/mudrod/integration/LinkageIntegration.java | 3 +++
core/src/main/java/org/apache/sdap/mudrod/tools/EONETIngester.java | 3 +++
.../java/org/apache/sdap/mudrod/weblog/pre/CrawlerDetection.java | 3 +++
.../apache/sdap/mudrod/weblog/structure/session/SessionTree.java | 6 ++++++
.../sdap/mudrod/services/search/SearchDatasetDetailResource.java | 3 +++
6 files changed, 21 insertions(+)
diff --git a/core/src/main/java/org/apache/sdap/mudrod/driver/ESDriver.java
b/core/src/main/java/org/apache/sdap/mudrod/driver/ESDriver.java
index 0009d18..9a075c3 100644
--- a/core/src/main/java/org/apache/sdap/mudrod/driver/ESDriver.java
+++ b/core/src/main/java/org/apache/sdap/mudrod/driver/ESDriver.java
@@ -244,6 +244,9 @@ public class ESDriver implements Serializable {
}
} catch (InterruptedException | ExecutionException e) {
LOG.error("Error whilst obtaining type list from Elasticsearch
mappings.", e);
+ if (e instanceof InterruptedException) {
+ Thread.currentThread().interrupt();
+ }
}
return typeList;
}
diff --git
a/core/src/main/java/org/apache/sdap/mudrod/integration/LinkageIntegration.java
b/core/src/main/java/org/apache/sdap/mudrod/integration/LinkageIntegration.java
index a20184e..3edc450 100644
---
a/core/src/main/java/org/apache/sdap/mudrod/integration/LinkageIntegration.java
+++
b/core/src/main/java/org/apache/sdap/mudrod/integration/LinkageIntegration.java
@@ -106,6 +106,9 @@ public class LinkageIntegration extends
DiscoveryStepAbstract {
map =
aggregateRelatedTermsFromAllmodel(es.customAnalyzing(props.getProperty(INDEX_NAME),
input));
} catch (InterruptedException | ExecutionException e) {
LOG.error("Error applying majority rule", e);
+ if (e instanceof InterruptedException) {
+ Thread.currentThread().interrupt();
+ }
}
for (Entry<String, List<LinkedTerm>> entry : map.entrySet()) {
diff --git a/core/src/main/java/org/apache/sdap/mudrod/tools/EONETIngester.java
b/core/src/main/java/org/apache/sdap/mudrod/tools/EONETIngester.java
index 4ec5698..796cefa 100644
--- a/core/src/main/java/org/apache/sdap/mudrod/tools/EONETIngester.java
+++ b/core/src/main/java/org/apache/sdap/mudrod/tools/EONETIngester.java
@@ -134,6 +134,9 @@ public class EONETIngester extends MudrodAbstract {
updateResponse = esDriver.getClient().update(updateRequest).get();
} catch (InterruptedException | ExecutionException e) {
LOG.error("Failed to execute bulk Index request : ", e);
+ if (e instanceof InterruptedException) {
+ Thread.currentThread().interrupt();
+ }
}
if (updateResponse != null) {
result = updateResponse.getGetResult();
diff --git
a/core/src/main/java/org/apache/sdap/mudrod/weblog/pre/CrawlerDetection.java
b/core/src/main/java/org/apache/sdap/mudrod/weblog/pre/CrawlerDetection.java
index 1c4c289..968aefa 100644
--- a/core/src/main/java/org/apache/sdap/mudrod/weblog/pre/CrawlerDetection.java
+++ b/core/src/main/java/org/apache/sdap/mudrod/weblog/pre/CrawlerDetection.java
@@ -86,6 +86,9 @@ public class CrawlerDetection extends LogAbstract {
checkByRateInParallel();
} catch (InterruptedException | IOException e) {
LOG.error("Encountered an error whilst detecting Web crawlers.", e);
+ if (e instanceof InterruptedException) {
+ Thread.currentThread().interrupt();
+ }
}
endTime = System.currentTimeMillis();
es.refreshIndex();
diff --git
a/core/src/main/java/org/apache/sdap/mudrod/weblog/structure/session/SessionTree.java
b/core/src/main/java/org/apache/sdap/mudrod/weblog/structure/session/SessionTree.java
index f06f476..863d27e 100644
---
a/core/src/main/java/org/apache/sdap/mudrod/weblog/structure/session/SessionTree.java
+++
b/core/src/main/java/org/apache/sdap/mudrod/weblog/structure/session/SessionTree.java
@@ -210,6 +210,9 @@ public class SessionTree extends MudrodAbstract {
viewquery =
es.customAnalyzing(props.getProperty(MudrodConstants.ES_INDEX_NAME), infoStr);
} catch (UnsupportedEncodingException | InterruptedException |
ExecutionException e) {
LOG.warn("Exception getting search info. Ignoring...", e);
+ if (e instanceof InterruptedException) {
+ Thread.currentThread().interrupt();
+ }
}
String dataset = viewnode.getDatasetId();
@@ -492,6 +495,9 @@ public class SessionTree extends MudrodAbstract {
try {
query =
es.customAnalyzing(props.getProperty(MudrodConstants.ES_INDEX_NAME), infoStr);
} catch (InterruptedException | ExecutionException e) {
+ if (e instanceof InterruptedException) {
+ Thread.currentThread().interrupt();
+ }
throw new RuntimeException("Error performing custom analyzing", e);
}
Map<String, String> filter = RequestUrl.getFilterInfo(queryUrl);
diff --git
a/service/src/main/java/org/apache/sdap/mudrod/services/search/SearchDatasetDetailResource.java
b/service/src/main/java/org/apache/sdap/mudrod/services/search/SearchDatasetDetailResource.java
index 095bceb..fb9e870 100644
---
a/service/src/main/java/org/apache/sdap/mudrod/services/search/SearchDatasetDetailResource.java
+++
b/service/src/main/java/org/apache/sdap/mudrod/services/search/SearchDatasetDetailResource.java
@@ -68,6 +68,9 @@ public class SearchDatasetDetailResource {
dataDetailJson =
mEngine.getESDriver().searchByQuery(config.getProperty(MudrodConstants.ES_INDEX_NAME),
config.getProperty(MudrodConstants.RAW_METADATA_TYPE), query, true);
} catch (InterruptedException | ExecutionException | IOException e) {
LOG.error("Error whilst searching for a Dataset-ShortName: ", e);
+ if (e instanceof InterruptedException) {
+ Thread.currentThread().interrupt();
+ }
}
LOG.info("Response received: {}", dataDetailJson);
return Response.ok(dataDetailJson, MediaType.APPLICATION_JSON).build();