Skip to content

Commit

Permalink
cleanup logging around UpdateMatchingStatsSqlJob.java
Browse files Browse the repository at this point in the history
  • Loading branch information
awildturtok committed Nov 11, 2024
1 parent bc7539b commit 25dbe80
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
23 changes: 6 additions & 17 deletions backend/src/main/java/com/bakdata/conquery/apiv1/LabelMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,19 @@
import com.bakdata.conquery.models.query.FilterSearch;
import com.bakdata.conquery.util.search.TrieSearch;
import com.google.common.collect.BiMap;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Data;
import lombok.ToString;
import lombok.experimental.Delegate;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.time.StopWatch;

@Getter
@RequiredArgsConstructor
@Slf4j
@EqualsAndHashCode
@Data
@ToString(onlyExplicitlyIncluded = true)
public class LabelMap implements Searchable {

@ToString.Include
private final FilterId id;

@Delegate
private final BiMap<String, String> delegate;
private final int minSuffixLength;
Expand All @@ -42,20 +41,10 @@ public TrieSearch<FrontendValue> createTrieSearch(IndexConfig config) {
log.trace("Labels for {}: `{}`", getId(), collected.stream().map(FrontendValue::toString).collect(Collectors.toList()));
}

StopWatch timer = StopWatch.createStarted();
log.trace("START-SELECT ADDING_ITEMS for {}", getId());

collected.forEach(feValue -> search.addItem(feValue, FilterSearch.extractKeywords(feValue)));

log.trace("DONE-SELECT ADDING_ITEMS for {} in {}", getId(), timer);

timer.reset();
log.trace("START-SELECT SHRINKING for {}", getId());

search.shrinkToFit();

log.trace("DONE-SELECT SHRINKING for {} in {}", getId(), timer);

return search;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,11 @@ public void calculateMatchingStats(final TreeConcept treeConcept) {
executionService.fetchStream(finalQuery)
.forEach(record -> mapRecordToConceptElements(treeConcept, record, treeCache));

log.debug("DONE fetching results for {}", treeConcept.getId());
}
catch (RuntimeException exception) {
log.error("FAILED collecting results for {}", treeConcept.getId(), exception);
}

log.debug("DONE fetching results for {}", treeConcept.getId());
}

/**
Expand Down

0 comments on commit 25dbe80

Please sign in to comment.