Github user justinleet commented on a diff in the pull request:

    https://github.com/apache/metron/pull/1050#discussion_r193207117
  
    --- Diff: 
metron-platform/metron-solr/src/main/java/org/apache/metron/solr/dao/SolrRetrieveLatestDao.java
 ---
    @@ -38,16 +40,23 @@
     public class SolrRetrieveLatestDao implements RetrieveLatestDao {
     
       private transient SolrClient client;
    +  private AccessConfig config;
     
    -  public SolrRetrieveLatestDao(SolrClient client) {
    +  public SolrRetrieveLatestDao(SolrClient client, AccessConfig config) {
         this.client = client;
    +    this.config = config;
       }
     
       @Override
    -  public Document getLatest(String guid, String collection) throws 
IOException {
    -
    +  public Document getLatest(String guid, String sensorType) throws 
IOException {
         try {
    -      SolrDocument solrDocument = client.getById(collection, guid);
    +      Optional<String> index = SolrUtilities
    +          .getIndex(config.getIndexSupplier(), sensorType, 
Optional.empty());
    +      if (!index.isPresent()) {
    +        return null;
    --- End diff --
    
    Probably a good idea to log, I'll add it.


---

Reply via email to