mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-11 12:07:42 +00:00
(improvement)(headless)Opt logging messages to make it cleaner.
This commit is contained in:
@@ -75,7 +75,7 @@ public class RetrieveServiceImpl implements RetrieveService {
|
||||
dataSetService.getModelIdToDataSetIds(new ArrayList<>(dataSetIdToName.keySet()), User.getFakeUser());
|
||||
// 2.detect by segment
|
||||
List<S2Term> originals = knowledgeBaseService.getTerms(queryText, modelIdToDataSetIds);
|
||||
log.info("hanlp parse result: {}", originals);
|
||||
log.debug("hanlp parse result: {}", originals);
|
||||
Set<Long> dataSetIds = queryReq.getDataSetIds();
|
||||
|
||||
QueryContext queryContext = new QueryContext();
|
||||
@@ -100,7 +100,7 @@ public class RetrieveServiceImpl implements RetrieveService {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
Map.Entry<MatchText, List<HanlpMapResult>> searchTextEntry = mostSimilarSearchResult.get();
|
||||
log.info("searchTextEntry:{},queryReq:{}", searchTextEntry, queryReq);
|
||||
log.debug("searchTextEntry:{},queryReq:{}", searchTextEntry, queryReq);
|
||||
|
||||
Set<SearchResult> searchResults = new LinkedHashSet();
|
||||
DataSetInfoStat dataSetInfoStat = NatureHelper.getDataSetStat(originals);
|
||||
@@ -273,7 +273,7 @@ public class RetrieveServiceImpl implements RetrieveService {
|
||||
Map.Entry<MatchText, List<HanlpMapResult>> searchTextEntry,
|
||||
Set<SearchResult> searchResults) {
|
||||
boolean existMetric = false;
|
||||
log.info("searchMetricAndDimension searchTextEntry:{}", searchTextEntry);
|
||||
log.debug("searchMetricAndDimension searchTextEntry:{}", searchTextEntry);
|
||||
MatchText matchText = searchTextEntry.getKey();
|
||||
List<HanlpMapResult> hanlpMapResults = searchTextEntry.getValue();
|
||||
|
||||
@@ -301,7 +301,7 @@ public class RetrieveServiceImpl implements RetrieveService {
|
||||
//visibility to filter metrics
|
||||
searchResults.add(searchResult);
|
||||
}
|
||||
log.info("parseResult:{},dimensionMetricClassIds:{},possibleDataSets:{}", hanlpMapResult,
|
||||
log.debug("parseResult:{},dimensionMetricClassIds:{},possibleDataSets:{}", hanlpMapResult,
|
||||
dimensionMetricClassIds, possibleDataSets);
|
||||
}
|
||||
log.info("searchMetricAndDimension searchResults:{}", searchResults);
|
||||
|
||||
@@ -110,7 +110,7 @@ public class S2SemanticLayerService implements SemanticLayerService {
|
||||
//2.query from cache
|
||||
QueryCache queryCache = ComponentFactory.getQueryCache();
|
||||
String cacheKey = queryCache.getCacheKey(queryReq);
|
||||
log.info("cacheKey:{}", cacheKey);
|
||||
log.debug("cacheKey:{}", cacheKey);
|
||||
Object query = queryCache.query(queryReq, cacheKey);
|
||||
if (Objects.nonNull(query)) {
|
||||
SemanticQueryResp queryResp = (SemanticQueryResp) query;
|
||||
|
||||
@@ -45,11 +45,12 @@ public class MetaEmbeddingTask implements CommandLineRunner {
|
||||
|
||||
private void embeddingStorePersistFile() {
|
||||
if (embeddingStoreFactory instanceof InMemoryEmbeddingStoreFactory) {
|
||||
log.info("start persistFile");
|
||||
long startTime = System.currentTimeMillis();
|
||||
InMemoryEmbeddingStoreFactory inMemoryFactory =
|
||||
(InMemoryEmbeddingStoreFactory) embeddingStoreFactory;
|
||||
inMemoryFactory.persistFile();
|
||||
log.info("end persistFile");
|
||||
long duration = System.currentTimeMillis() - startTime;
|
||||
log.info("Embedding file has been regularly persisted in {} milliseconds", duration);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +64,7 @@ public class MetaEmbeddingTask implements CommandLineRunner {
|
||||
*/
|
||||
@Scheduled(cron = "${s2.reload.meta.embedding.corn:0 0 */2 * * ?}")
|
||||
public void reloadMetaEmbedding() {
|
||||
log.info("reload.meta.embedding start");
|
||||
long startTime = System.currentTimeMillis();
|
||||
try {
|
||||
List<DataItem> metricDataItems = metricService.getDataEvent().getDataItems();
|
||||
|
||||
@@ -74,10 +75,10 @@ public class MetaEmbeddingTask implements CommandLineRunner {
|
||||
embeddingService.addQuery(embeddingConfig.getMetaCollectionName(),
|
||||
TextSegmentConvert.convertToEmbedding(dimensionDataItems));
|
||||
} catch (Exception e) {
|
||||
log.error("reload.meta.embedding error", e);
|
||||
log.error("Failed to reload meta embedding.", e);
|
||||
}
|
||||
|
||||
log.info("reload.meta.embedding end");
|
||||
long duration = System.currentTimeMillis() - startTime;
|
||||
log.info("Embedding has been regularly reloaded in {} milliseconds", duration);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -37,15 +37,17 @@ public class DictWordService {
|
||||
}
|
||||
|
||||
public void reloadDictWord() {
|
||||
long startTime = System.currentTimeMillis();
|
||||
List<DictWord> dictWords = getAllDictWords();
|
||||
List<DictWord> preDictWords = getPreDictWords();
|
||||
if (org.apache.commons.collections.CollectionUtils.isEqualCollection(dictWords, preDictWords)) {
|
||||
log.debug("Dictionary hasn't been reloaded.");
|
||||
return;
|
||||
}
|
||||
log.info("Dictionary has been reloaded.");
|
||||
setPreDictWords(dictWords);
|
||||
knowledgeBaseService.updateOnlineKnowledge(getAllDictWords());
|
||||
long duration = System.currentTimeMillis() - startTime;
|
||||
log.info("Dictionary has been regularly reloaded in {} milliseconds", duration);
|
||||
}
|
||||
|
||||
public List<DictWord> getAllDictWords() {
|
||||
|
||||
Reference in New Issue
Block a user