Skip to content

Commit

Permalink
fix checkstyle style checks
Browse files Browse the repository at this point in the history
  • Loading branch information
alecgrieser committed May 19, 2022
1 parent fb8d0db commit e3eb142
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ public RecordCursor<RecordCursorResult<IndexEntry>> lookup() throws IOException
final boolean phraseQueryNeeded = query.startsWith("\"") && query.endsWith("\"");
final String searchKey = phraseQueryNeeded ? query.substring(1, query.length() - 1) : query;
List<String> tokens = new ArrayList<>();
String prefixToken = getQueryTokens(searchKey, tokens);
final String prefixToken = getQueryTokens(searchKey, tokens);

IndexReader indexReader = getIndexReader();
Set<String> fieldNames = new HashSet<>();
Expand Down Expand Up @@ -426,14 +426,14 @@ protected RecordCursor<RecordCursorResult<IndexEntry>> createResults(IndexSearch
throws IOException {
return RecordCursor.fromIterator(Arrays.stream(topDocs.scoreDocs).iterator())
.mapPipelined(scoreDoc -> {
try {
IndexableField primaryKey = searcher.doc(scoreDoc.doc).getField(LuceneIndexMaintainer.PRIMARY_KEY_FIELD_NAME);
BytesRef pk = primaryKey.binaryValue();
return state.store.loadRecordAsync(Tuple.fromBytes(pk.bytes));
} catch (IOException e) {
throw new RuntimeException(e);
}
}, state.store.getPipelineSize(PipelineOperation.KEY_TO_RECORD))
try {
IndexableField primaryKey = searcher.doc(scoreDoc.doc).getField(LuceneIndexMaintainer.PRIMARY_KEY_FIELD_NAME);
BytesRef pk = primaryKey.binaryValue();
return state.store.loadRecordAsync(Tuple.fromBytes(pk.bytes));
} catch (IOException e) {
throw new RuntimeException(e);
}
}, state.store.getPipelineSize(PipelineOperation.KEY_TO_RECORD))
.filter(Objects::nonNull)
.map(state.store::queriedRecord)
.map(result -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,16 +166,14 @@ public RecordCursor<IndexEntry> scan(@Nonnull final IndexScanBounds scanBounds,

/**
* Insert a field into the document and add a suggestion into the suggester if needed.
* @return whether a suggestion has been added to the suggester
*/
@SuppressWarnings("java:S3776")
private boolean insertField(LuceneDocumentFromRecord.DocumentField field, final Document document) {
private void insertField(LuceneDocumentFromRecord.DocumentField field, final Document document) {
final String fieldName = field.getFieldName();
final Object value = field.getValue();
final Field luceneField;
final Field sortedField;
final StoredField storedField;
boolean suggestionAdded = false;
switch (field.getType()) {
case TEXT:
luceneField = new Field(fieldName, (String) value, getTextFieldType(field));
Expand Down Expand Up @@ -217,7 +215,6 @@ private boolean insertField(LuceneDocumentFromRecord.DocumentField field, final
if (storedField != null) {
document.add(storedField);
}
return suggestionAdded;
}

private void writeDocument(@Nonnull List<LuceneDocumentFromRecord.DocumentField> fields, Tuple groupingKey,
Expand Down

0 comments on commit e3eb142

Please sign in to comment.