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