replace stdout with logger
This commit is contained in:
@@ -40,6 +40,8 @@ public class DataStore implements AutoCloseable {
|
||||
// area
|
||||
private static final Logger EXECUTE_QUERY_LOGGER = LoggerFactory
|
||||
.getLogger("org.lucares.metrics.dataStore.executeQuery");
|
||||
private static final Logger MAP_DOCS_TO_DOCID = LoggerFactory
|
||||
.getLogger("org.lucares.metrics.dataStore.mapDocsToDocID");
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(DataStore.class);
|
||||
|
||||
public static final char LISTING_FILE_SEPARATOR = ',';
|
||||
@@ -322,8 +324,8 @@ public class DataStore implements AutoCloseable {
|
||||
|
||||
result.add(doc);
|
||||
}
|
||||
System.out.println(
|
||||
"mapDocIdsToDocs(" + docIdsList.size() + "): " + (System.nanoTime() - start) / 1_000_000.0 + "ms");
|
||||
MAP_DOCS_TO_DOCID.debug("mapDocIdsToDocs({}): {}ms", docIdsList.size(),
|
||||
(System.nanoTime() - start) / 1_000_000.0);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,8 @@ public class NewProposerParser {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(NewProposerParser.class);
|
||||
|
||||
private final static Logger METRICS_LOGGER_PROPOSE = LoggerFactory.getLogger("org.lucares.metrics.propose");
|
||||
|
||||
public final static String CARET_MARKER = "\ue001"; // character in the private use area
|
||||
|
||||
/*
|
||||
@@ -35,6 +37,7 @@ public class NewProposerParser {
|
||||
}
|
||||
|
||||
public List<Proposal> propose(final String query, final int caretIndex) {
|
||||
final long start = System.nanoTime();
|
||||
List<Proposal> proposals;
|
||||
if (StringUtils.isBlank(query)) {
|
||||
proposals = proposeForAllKeys();
|
||||
@@ -47,6 +50,8 @@ public class NewProposerParser {
|
||||
proposals = foundProposals;
|
||||
}
|
||||
}
|
||||
METRICS_LOGGER_PROPOSE.debug("compute proposals took {}ms for query '{}' ",
|
||||
(System.nanoTime() - start) / 1_000_000.0, query);
|
||||
|
||||
return proposals;
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@ import org.lucares.pdb.datastore.lang.Expression.Not;
|
||||
import org.lucares.pdb.datastore.lang.Expression.Or;
|
||||
import org.lucares.pdb.datastore.lang.Expression.Property;
|
||||
import org.lucares.pdb.datastore.lang.Expression.Terminal;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Query completion utilizes an index that contains all mappings of
|
||||
@@ -43,6 +45,8 @@ import org.lucares.pdb.datastore.lang.Expression.Terminal;
|
||||
*/
|
||||
public class QueryCompletionExpressionOptimizer {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(QueryCompletionExpressionOptimizer.class);
|
||||
|
||||
private static final class ReplaceINExpressionsWithPropertyExpressionsVisitor extends IdentityExpressionVisitor {
|
||||
|
||||
@Override
|
||||
@@ -256,9 +260,9 @@ public class QueryCompletionExpressionOptimizer {
|
||||
previousExpression = result;
|
||||
result = previousExpression.visit(visitor);
|
||||
if (!previousExpression.equals(result)) {
|
||||
System.out.println(" translate: " + visitor.getClass().getSimpleName());
|
||||
System.out.println(" in: " + previousExpression);
|
||||
System.out.println(" out: " + result);
|
||||
LOGGER.debug(" translate: {}", visitor.getClass().getSimpleName());
|
||||
LOGGER.debug(" in: {}", previousExpression);
|
||||
LOGGER.debug(" out: {}", result);
|
||||
}
|
||||
} while (!previousExpression.equals(result));
|
||||
|
||||
|
||||
@@ -48,8 +48,6 @@ public class QueryLanguage {
|
||||
|
||||
@Override
|
||||
public void exitIdentifierExpression(final IdentifierExpressionContext ctx) {
|
||||
// System.out.println("push identifier " + ctx.getText());
|
||||
|
||||
if (ctx.getText().length() > 255) {
|
||||
throw new SyntaxException(ctx, "token too long");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user