com.hurence.logisland.record.Record.addError()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.7k)|赞(0)|评价(0)|浏览(146)

本文整理了Java中com.hurence.logisland.record.Record.addError方法的一些代码示例,展示了Record.addError的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Record.addError方法的具体详情如下:
包路径:com.hurence.logisland.record.Record
类名称:Record
方法名:addError

Record.addError介绍

暂无

代码示例

代码示例来源:origin: com.hurence.logisland/logisland-common-processors-plugin

@Override
  public void buildId(Record record) {
    final Object[] valuesForFormat = new Object[fieldsForFormat.length];
    for (int i = 0; i < valuesForFormat.length; i++) {
      if (!record.hasField(fieldsForFormat[i])) {
        List<String> fieldsName = Lists.newArrayList(fieldsForFormat);
        record.addError(ProcessError.CONFIG_SETTING_ERROR.getName(),
            String.format("could not build id with format : '%s' \nfields: '%s' \n because " +
                "field: '%s' does not exist", format, fieldsName, fieldsForFormat[i]));
        return;
      }
      valuesForFormat[i] = record.getField(fieldsForFormat[i]).getRawValue();
    }
    try {
      record.setId(String.format(local, format, valuesForFormat));
    } catch (IllegalFormatException e) {
      // If a format string contains an illegal syntax, a format specifier that is incompatible with the given arguments,
      // insufficient arguments given the format string, or other illegal conditions.
      // For specification of all possible formatting errors, see the Details section of the formatter class specification.
      record.addError(ProcessError.STRING_FORMAT_ERROR.getName(), e.getMessage());
    } catch (NullPointerException e) {//should not happen
      record.addError(ProcessError.CONFIG_SETTING_ERROR.getName(), e.getMessage());
    }
  }
};

代码示例来源:origin: com.hurence.logisland/logisland-common-processors-plugin

record.addError(ProcessError.UNKNOWN_ERROR.getName(), "Could not find expected HTML template parameter <"
    + parameter + "> as field in the record.");
return null;

代码示例来源:origin: com.hurence.logisland/logisland-common-processors-plugin

@Override
  public Collection<Record> process(ProcessContext context, Collection<Record> records) {

    // check if we need initialization
    if (datastoreClientService == null) {
      init(context);
    }

    List<Record> outputRecords = new ArrayList<>(records);
    for (final Map.Entry<String, String> entry : dynamicTagValuesMap.entrySet()) {

      try {
        sandbox.eval(entry.getValue());
        Record cached = (Record) sandbox.get("record_" + entry.getKey());
        if (cached.hasField(FieldDictionary.RECORD_VALUE))
          outputRecords.add(cached);
      } catch (ScriptException e) {
        Record errorRecord = new StandardRecord(RecordDictionary.ERROR)
            .setId(entry.getKey())
            .addError("ScriptException", e.getMessage());
        //  outputRecords.add(errorRecord);
        logger.error(e.toString());
      }
    }

    return outputRecords;
  }
}

代码示例来源:origin: com.hurence.logisland/logisland-enrichment-plugin

record.addError(ProcessError.RUNTIME_ERROR.toString(), msg);

代码示例来源:origin: com.hurence.logisland/logisland-hbase-plugin

record.addError(ProcessError.RECORD_CONVERSION_ERROR.toString(),
      logger,
      "Failed to produce a put for Record from {}" + record.toString());
} else if (!putRecord.isValid()) {
  if (StringUtils.isBlank(putRecord.getTableName())) {
    record.addError(ProcessError.BAD_RECORD.toString(),
        logger,
        "Missing table name for Record " + record.toString()                            );
  } else if (null == putRecord.getRow()) {
    record.addError(ProcessError.BAD_RECORD.toString(),
        logger,
        "Missing row id for Record " + record.toString());
  } else if (putRecord.getColumns() == null || putRecord.getColumns().isEmpty()) {
    record.addError(ProcessError.BAD_RECORD.toString(),
        logger,
        "No columns provided for Record " + record.toString());
  } else {
    record.addError(ProcessError.RECORD_CONVERSION_ERROR.toString(),
        logger,
        "Failed to produce a put for Record from " + record.toString()
    putRecord.getRecord().addError("HBASE_PUT_RECORD_FAILURE", logger, msg);

代码示例来源:origin: com.hurence.logisland/logisland-common-processors-plugin

Record errorRecord = new StandardRecord(RecordDictionary.ERROR)
    .setId(entry.getKey())
    .addError("ScriptException", e.getMessage());

代码示例来源:origin: com.hurence.logisland/logisland-common-processors-plugin

} catch (InvalidJsonException e) {
  logger.error("Record {} did not have valid JSON content.", record);
  record.addError(ERROR_INVALID_JSON_FIELD, "unable to parse content of field : " + jsonInputField);
      record.addError(ERROR_INVALID_JSON_FIELD, error);
          record.getId(), jsonPathExp.getPath(), jsonPathAttrKey);
      logger.error(error);
      record.addError(ERROR_INVALID_JSON_FIELD, error);
String error = String.format("Record %s has no field %s.", record.getId(), jsonInputField);
logger.error(error);
record.addError(ERROR_INVALID_JSON_FIELD, error);

代码示例来源:origin: com.hurence.logisland/logisland-scripting-plugin

errorRecord.addError(ProcessError.UNKNOWN_ERROR.getName(), errorMsg);
List<Record> errorRecords = new ArrayList<Record>();
errorRecords.add(errorRecord);

代码示例来源:origin: com.hurence.logisland/logisland-common-processors-plugin

Record errorRecord = new StandardRecord(RecordDictionary.ERROR)
    .setId(entry.getKey())
    .addError("ScriptException", e.getMessage());

代码示例来源:origin: com.hurence.logisland/logisland-hbase-plugin

record.addError(
      ProcessError.BAD_RECORD.toString(),
      getLogger(),
  record.addError(
      ProcessError.BAD_RECORD.toString(),
      getLogger(),
  clientService.scan(tableName, rowIdBytes, rowIdBytes, columns, handler);
} catch (Exception e) {
  record.addError(
      ProcessError.BAD_RECORD.toString(),
      getLogger(),
  record.addError(
      ProcessError.BAD_RECORD.toString(),
      getLogger(),
record.addError(ProcessError.RUNTIME_ERROR.toString(),
    getLogger(),
    "Unable to fetch row {}",

代码示例来源:origin: com.hurence.logisland/logisland-common-processors-plugin

record.addError(ProcessError.UNKNOWN_ERROR.getName(), "No From address defined");
failedRecords.add(record);
continue;
record.addError(ProcessError.UNKNOWN_ERROR.getName(), "No Bounce address defined");
failedRecords.add(record);
continue;
  record.addError(ProcessError.UNKNOWN_ERROR.getName(), "Record has both " + FIELD_MAIL_USE_TEMPLATE 
      + " and " + FIELD_MAIL_HTML + " fields. Only one of them is expected.");
  failedRecords.add(record);
    record.addError(ProcessError.UNKNOWN_ERROR.getName(), "No mail recipient.");
    failedRecords.add(record);
    continue;
  record.addError(ProcessError.UNKNOWN_ERROR.getName(), "Unable to send email: " + ex.getMessage());
  failedRecords.add(record);
    record.addError(ProcessError.UNKNOWN_ERROR.getName(), "No mail recipient.");
    failedRecords.add(record);
    continue;
  record.addError(ProcessError.UNKNOWN_ERROR.getName(), "Unable to send email: " + ex.getMessage());
  failedRecords.add(record);

代码示例来源:origin: com.hurence.logisland/logisland-enrichment-plugin

logger.error("Error for ip {}, for record {}.", new Object[]{ip, record}, ex);
String msg = "Could not translate ip: '" + ip + "' into InetAddress, for record: '" + record.toString() + "'.\n Cause: " + ex.getMessage();
record.addError(ProcessError.RUNTIME_ERROR.toString(), msg);
return;

相关文章