Skip to content

Commit

Permalink
Code comments
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Kwok <[email protected]>
  • Loading branch information
andy-k-improving committed Dec 2, 2024
1 parent 700ec1b commit 9e0145a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ See the [CONTRIBUTING guide](./CONTRIBUTING.md#Changelog) for instructions on ho

## [Unreleased 2.x](https://github.com/opensearch-project/geospatial/compare/2.17...2.x)
### Features
- Introduce new Java artifact geospatial-client to facilitate cross plugin communication.
- Introduce new Java artifact geospatial-client to facilitate cross plugin communication. ([#700](https://github.com/opensearch-project/geospatial/pull/700))
### Enhancements
### Bug Fixes
### Infrastructure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,10 @@ public IpEnrichmentTransportAction(TransportService transportService, ActionFilt
protected void doExecute(Task task, ActionRequest request, ActionListener<ActionResponse> listener) {
IpEnrichmentRequest enrichmentRequest = IpEnrichmentRequest.fromActionRequest(request);
String ipString = enrichmentRequest.getIpString();
if (enrichmentRequest.getDatasourceName() == null) {
log.error("No data source available, IpEnrichmentTransportAction aborted.");
listener.onFailure(new IllegalArgumentException());
} else {
String dataSourceName = enrichmentRequest.getDatasourceName();
String indexName = ip2GeoCachedDao.getIndexName(dataSourceName);
Map<String, Object> geoLocationData = ip2GeoCachedDao.getGeoData(indexName, ipString);
log.debug("GeoSpatial IP lookup on IP: [{}], and result [{}]", ipString, geoLocationData);
listener.onResponse(new IpEnrichmentResponse(geoLocationData));
}
String dataSourceName = enrichmentRequest.getDatasourceName();
String indexName = ip2GeoCachedDao.getIndexName(dataSourceName);
Map<String, Object> geoLocationData = ip2GeoCachedDao.getGeoData(indexName, ipString);
log.debug("GeoSpatial IP lookup on IP: [{}], and result [{}]", ipString, geoLocationData);
listener.onResponse(new IpEnrichmentResponse(geoLocationData));
}
}

0 comments on commit 9e0145a

Please sign in to comment.