@Override public String toString() { return String.format("%s(id=%s, from=%s): %s", getClass().getSimpleName(), requestMessageId, requestNodeId, LogRedactionUtil.userData(statementsText)); } }
private void printRuleApplication(IAlgebraicRewriteRule rule, String beforePlan, String afterPlan) { if (AlgebricksConfig.ALGEBRICKS_LOGGER.isTraceEnabled()) { AlgebricksConfig.ALGEBRICKS_LOGGER.trace(">> Rule " + rule.getClass() + " fired.\n"); AlgebricksConfig.ALGEBRICKS_LOGGER.trace(">> Before plan\n" + LogRedactionUtil.userData(beforePlan) + "\n"); AlgebricksConfig.ALGEBRICKS_LOGGER.trace(">> After plan\n" + LogRedactionUtil.userData(afterPlan) + "\n"); } }
public synchronized void logRecord(String record, String errorMessage) throws IOException { stringBuilder.setLength(0); stringBuilder.append(LogRedactionUtil.userData(record)); stringBuilder.append(ExternalDataConstants.LF); stringBuilder.append(df.format((new Date()))); stringBuilder.append(' '); stringBuilder.append(errorMessage); stringBuilder.append(ExternalDataConstants.LF); recordLogger.write(stringBuilder.toString()); recordLogger.flush(); }
private void logExpression(String p0, String p1) throws CompilationException { if (isLogEnabled) { LOGGER.trace("{} {}\n{}", p0, p1, LogRedactionUtil.userData(SqlppAstPrintUtil.toString(topExpr))); } }
private SqlppParseException createUnexpectedTokenError() { return new SqlppParseException(getSourceLocation(token), "Unexpected token: " + LogRedactionUtil.userData(token.image)); }
|| t instanceof AlgebricksException) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("handleException: {}: {}", t.getMessage(), LogRedactionUtil.userData(param.toString()), t); } else { LOGGER.info(() -> "handleException: " + t.getMessage() + ": " + LogRedactionUtil.userData(param.toString())); case ASTERIX + REQUEST_TIMEOUT: LOGGER.info(() -> "handleException: request execution timed out: " + LogRedactionUtil.userData(param.toString())); state.setStatus(ResultStatus.TIMEOUT, HttpResponseStatus.OK); break; case ASTERIX + REJECT_NODE_UNREGISTERED: LOGGER.warn(() -> "handleException: " + he.getMessage() + ": " + LogRedactionUtil.userData(param.toString())); state.setStatus(ResultStatus.FATAL, HttpResponseStatus.SERVICE_UNAVAILABLE); break; default: LOGGER.warn(() -> "handleException: unexpected exception " + he.getMessage() + ": " + LogRedactionUtil.userData(param.toString()), he); state.setStatus(ResultStatus.FATAL, HttpResponseStatus.INTERNAL_SERVER_ERROR); break; LOGGER.warn(() -> "handleException: unexpected exception: " + LogRedactionUtil.userData(param.toString()), t); state.setStatus(ResultStatus.FATAL, HttpResponseStatus.INTERNAL_SERVER_ERROR);
private void printOp(AbstractLogicalOperator op) throws AlgebricksException { LogicalOperatorPrettyPrintVisitor pvisitor = new LogicalOperatorPrettyPrintVisitor(); PlanPrettyPrinter.printOperator(op, pvisitor, 0); if (AlgebricksConfig.ALGEBRICKS_LOGGER.isTraceEnabled()) { AlgebricksConfig.ALGEBRICKS_LOGGER.trace(LogRedactionUtil.userData(pvisitor.get().toString())); } }
funcExpr.getSourceLocation(), LogRedactionUtil.userData(funcExpr.toString()));
/** * @param str * The input string * @param vs * The storage buffer * @param writeTag * Specifying whether a tag for the string should also be written */ public void serializeString(String str, IMutableValueStorage vs, boolean writeTag) throws HyracksDataException { vs.reset(); try { DataOutput output = vs.getDataOutput(); if (writeTag) { output.write(ATypeTag.STRING.serialize()); } utf8Writer.writeUTF8(str, output); } catch (IOException e) { throw new HyracksDataException("Could not serialize " + LogRedactionUtil.userData(str)); } }
public Object[] deserializeRecord() throws HyracksDataException { int start = frameTupleAccessor.getTupleStartOffset(tIndex) + frameTupleAccessor.getFieldSlotsLength(); bbis.setByteBuffer(buffer, start); Object[] record = new Object[recordDescriptor.getFieldCount()]; for (int i = 0; i < record.length; ++i) { Object instance = recordDescriptor.getFields()[i].deserialize(di); if (LOGGER.isTraceEnabled()) { LOGGER.trace(i + " " + LogRedactionUtil.userData(instance.toString())); } record[i] = instance; if (FrameConstants.DEBUG_FRAME_IO) { try { if (di.readInt() != FrameConstants.FRAME_FIELD_MAGIC) { throw new HyracksDataException("Field magic mismatch"); } } catch (IOException e) { e.printStackTrace(); } } } if (LOGGER.isTraceEnabled()) { LOGGER.trace("Read Record tIndex = " + tIndex + ", tupleCount = " + tupleCount); } ++tIndex; return record; }
@SuppressWarnings("unchecked") @Override public void writeData(Object[] data) throws HyracksDataException { if (!open) { throw new HyracksDataException("Writing to SerializingDataWriter that has not been opened"); } tb.reset(); for (int i = 0; i < data.length; ++i) { Object instance = data[i]; if (LOGGER.isTraceEnabled()) { LOGGER.trace(i + " " + LogRedactionUtil.userData(instance.toString())); } tb.addField(recordDescriptor.getFields()[i], instance); } FrameUtils.appendToWriter(frameWriter, tupleAppender, tb.getFieldEndOffsets(), tb.getByteArray(), 0, tb.getSize()); }
private void logPlanAt(String name, Level lvl) throws AlgebricksException { if (AlgebricksConfig.ALGEBRICKS_LOGGER.isEnabled(lvl)) { final LogicalOperatorPrettyPrintVisitor pvisitor = context.getPrettyPrintVisitor(); pvisitor.reset(new AlgebricksAppendable()); PlanPrettyPrinter.printPlan(plan, pvisitor, 0); AlgebricksConfig.ALGEBRICKS_LOGGER.log(lvl, name + ":\n" + LogRedactionUtil.userData(pvisitor.get().toString())); } }
@Override public boolean rewritePost(Mutable<ILogicalOperator> opRef, IOptimizationContext context) throws AlgebricksException { AbstractLogicalOperator op = (AbstractLogicalOperator) opRef.getValue(); if (op.getOperatorTag() != LogicalOperatorTag.SELECT) { return false; } SelectOperator select = (SelectOperator) op; ILogicalExpression condition = select.getCondition().getValue(); IVariableTypeEnvironment env = select.computeOutputTypeEnvironment(context); IAType condType = (IAType) env.getType(condition); if (condType.getTypeTag() != ATypeTag.BOOLEAN && condType.getTypeTag() != ATypeTag.ANY && !isPossibleBoolean(condType)) { throw new CompilationException(ErrorCode.COMPILATION_ERROR, condition.getSourceLocation(), "The select condition " + LogRedactionUtil.userData(condition.toString()) + " should be of the " + "boolean type."); } return false; }
lit.setValue(new LongIntegerLiteral(Long.valueOf(token.image))); } catch (NumberFormatException e) { {if (true) throw new SqlppParseException(getSourceLocation(token), "Could not parse numeric literal \u005c"" + LogRedactionUtil.userData(token.image) +'"');} lit.setValue(new FloatLiteral(Float.valueOf(token.image))); } catch (NumberFormatException e) { {if (true) throw new SqlppParseException(getSourceLocation(token), "Could not parse numeric literal \u005c"" + LogRedactionUtil.userData(token.image) +'"');} lit.setValue(new DoubleLiteral(Double.valueOf(token.image))); } catch (NumberFormatException e) { {if (true) throw new SqlppParseException(getSourceLocation(token), "Could not parse numeric literal \u005c"" + LogRedactionUtil.userData(token.image) +'"');}
private static String getGeneratedIdentifier(Expression expr) throws ParseException { if (expr.getKind() == Kind.VARIABLE_EXPRESSION) { VariableExpr bindingVarExpr = (VariableExpr) expr; VarIdentifier var = bindingVarExpr.getVar(); return SqlppVariableUtil.isExternalVariableIdentifier(var) ? null : var.getValue(); } else if (expr.getKind() == Kind.FIELD_ACCESSOR_EXPRESSION) { FieldAccessor fa = (FieldAccessor) expr; return SqlppVariableUtil.toInternalVariableName(fa.getIdent().getValue()); } else { String exprText; try { exprText = SqlppFormatPrintUtil.toString(expr); } catch (CompilationException e) { LOGGER.error(e.getLocalizedMessage(), e); throw new SqlppParseException(expr.getSourceLocation(), e.getLocalizedMessage()); } throw new SqlppParseException(expr.getSourceLocation(), "Need an alias for the enclosed expression:\n" + LogRedactionUtil.userData(exprText)); } }
throw new CompilationException(ErrorCode.COMPILATION_ERROR, expr.getSourceLocation(), "Record constructor expected to have an even number of arguments: " + LogRedactionUtil.userData(expr.toString())); expr.setFunctionInfo(FunctionUtil.getFunctionInfo(BuiltinFunctions.CLOSED_RECORD_CONSTRUCTOR)); ASTERIX_LOGGER.trace(() -> "Switching to CLOSED record constructor in " + LogRedactionUtil.userData(expr.toString()) + ".\n"); changed = true;
throw new AlgebricksException("Unnest expression " + LogRedactionUtil.userData(unnestExpr.toString()) + " is not an unnesting function call.");
LOGGER.info(() -> "handleRequest: " + LogRedactionUtil.userData(param.toString())); ResultDelivery delivery = parseResultDelivery(param.getMode()); setSessionConfig(sessionOutput, param, delivery);