Skip to content

Commit

Permalink
adding more logs if query fails
Browse files Browse the repository at this point in the history
  • Loading branch information
mittalrishabh committed Nov 15, 2024
1 parent f874f8b commit fb105c9
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
package com.slack.astra.logstore.rocksdb.query;

import static java.util.stream.Collectors.toList;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.base.Stopwatch;
import com.slack.astra.logstore.LogMessage;
import com.slack.astra.logstore.search.LogIndexSearcher;
import com.slack.astra.logstore.search.SearchResult;
import com.slack.astra.logstore.search.SourceFieldFilter;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.file.Files;
Expand All @@ -21,7 +12,9 @@
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import static java.util.stream.Collectors.toList;
import java.util.stream.Stream;

import org.opensearch.index.query.QueryBuilder;
import org.opensearch.search.aggregations.AggregatorFactories;
import org.rocksdb.IngestExternalFileOptions;
Expand All @@ -31,6 +24,14 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.base.Stopwatch;
import com.slack.astra.logstore.LogMessage;
import com.slack.astra.logstore.search.LogIndexSearcher;
import com.slack.astra.logstore.search.SearchResult;
import com.slack.astra.logstore.search.SourceFieldFilter;

public class RocksdbIndexSearcherImpl implements LogIndexSearcher<LogMessage> {
private static final Logger LOG = LoggerFactory.getLogger(RocksdbIndexSearcherImpl.class);

Expand Down Expand Up @@ -159,6 +160,7 @@ public SearchResult<LogMessage> search(
return new SearchResult<>(
results, elapsedTime.elapsed(TimeUnit.MICROSECONDS), 0, 0, 1, 1, null);
} catch (IOException ex) {
LOG.error("Error fetching and parsing a result from rocksdb index for key: {}", dataset, ex);
throw new IllegalStateException(
"Error fetching and parsing a result from rocksdb index for key: " + dataset, ex);
}
Expand Down

0 comments on commit fb105c9

Please sign in to comment.