com.hurence.logisland.component.PropertyValue.getRawValue()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(4.6k)|赞(0)|评价(0)|浏览(82)

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

PropertyValue.getRawValue介绍

暂无

代码示例

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

@Override
protected Collection<ValidationResult> customValidate(ValidationContext context) {
  final List<ValidationResult> validationResults = new ArrayList<>(super.customValidate(context));
  if (context.getPropertyValue(STRATEGY).isSet()) {
    if (context.getPropertyValue(STRATEGY).getRawValue().equals(JAVA_FORMAT_STRING_WITH_FIELDS_STRATEGY.getValue())) {
      if (!context.getPropertyValue(JAVA_FORMAT_STRING).isSet()) {
        validationResults.add(
            new ValidationResult.Builder()
                .input(JAVA_FORMAT_STRING.getName())
                .explanation(String.format("%s must be set when strategy is %s",
                    JAVA_FORMAT_STRING.getName(),
                    context.getPropertyValue(STRATEGY).getRawValue()))
                .valid(false)
                .build());
      }
    }
  }
  return validationResults;
}

代码示例来源:origin: com.hurence.logisland/logisland-elasticsearch_5_4_0-client-service

/**
 * set up BackoffPolicy
 */
private BackoffPolicy getBackOffPolicy(ControllerServiceInitializationContext context)
{
  BackoffPolicy backoffPolicy = BackoffPolicy.exponentialBackoff();
  if (context.getPropertyValue(BULK_BACK_OFF_POLICY).getRawValue().equals(DEFAULT_EXPONENTIAL_BACKOFF_POLICY.getValue())) {
    backoffPolicy = BackoffPolicy.exponentialBackoff();
  } else if (context.getPropertyValue(BULK_BACK_OFF_POLICY).getRawValue().equals(EXPONENTIAL_BACKOFF_POLICY.getValue())) {
    backoffPolicy = BackoffPolicy.exponentialBackoff(
        TimeValue.timeValueMillis(context.getPropertyValue(BULK_THROTTLING_DELAY).asLong()),
        context.getPropertyValue(BULK_RETRY_NUMBER).asInteger()
    );
  } else if (context.getPropertyValue(BULK_BACK_OFF_POLICY).getRawValue().equals(CONSTANT_BACKOFF_POLICY.getValue())) {
    backoffPolicy = BackoffPolicy.constantBackoff(
        TimeValue.timeValueMillis(context.getPropertyValue(BULK_THROTTLING_DELAY).asLong()),
        context.getPropertyValue(BULK_RETRY_NUMBER).asInteger()
    );
  } else if (context.getPropertyValue(BULK_BACK_OFF_POLICY).getRawValue().equals(NO_BACKOFF_POLICY.getValue())) {
    backoffPolicy = BackoffPolicy.noBackoff();
  }
  return backoffPolicy;
}

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

if (context.getPropertyValue(TIMEBASED_INDEX).isSet()) {
  final SimpleDateFormat sdf = new SimpleDateFormat(context.getPropertyValue(DATE_FORMAT).asString());
  if (context.getPropertyValue(TIMEBASED_INDEX).getRawValue().equals(TODAY_DATE_SUFFIX.getValue())) {
    defaultCollection += "." + sdf.format(new Date());
  } else if (context.getPropertyValue(TIMEBASED_INDEX).getRawValue().equals(YESTERDAY_DATE_SUFFIX.getValue())) {
    DateTime dt = new DateTime(new Date()).minusDays(1);
    defaultCollection += "." + sdf.format(dt.toDate());

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

@Override
public void init(ProcessContext context) {
  if (context.getPropertyValue(STRATEGY).isSet()) {
    if (context.getPropertyValue(STRATEGY).getRawValue().equals(RANDOM_UUID_STRATEGY.getValue())) {
      idBuilder = new IdBuilder() {
        @Override
    } else if (context.getPropertyValue(STRATEGY).getRawValue().equals(HASH_FIELDS_STRATEGY.getValue())) {
      final List<String> fieldsForHash = Lists.newArrayList(
          context.getPropertyValue(FIELDS_TO_USE).asString().split(","));
        throw new Error("This error should not happen because the validator should ensure the algorythme exist", e);
    } else if (context.getPropertyValue(STRATEGY).getRawValue().equals(JAVA_FORMAT_STRING_WITH_FIELDS_STRATEGY.getValue())) {
      final String[] fieldsForFormat = context.getPropertyValue(FIELDS_TO_USE).asString().split(",");
      final String format = context.getPropertyValue(JAVA_FORMAT_STRING).asString();
    } else if (context.getPropertyValue(STRATEGY).getRawValue().equals(TYPE_TIME_HASH_STRATEGY.getValue())) {
      final List<String> fieldsForHash = Lists.newArrayList(
          context.getPropertyValue(FIELDS_TO_USE).asString().split(","));

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

if (context.getPropertyValue(TIMEBASED_INDEX).isSet()) {
  final SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd");
  if (context.getPropertyValue(TIMEBASED_INDEX).getRawValue().equals(TODAY_DATE_SUFFIX.getValue())) {
    defaultIndex += "." + sdf.format(new Date());
  } else if (context.getPropertyValue(TIMEBASED_INDEX).getRawValue().equals(YESTERDAY_DATE_SUFFIX.getValue())) {
    DateTime dt = new DateTime(new Date()).minusDays(1);
    defaultIndex += "." + sdf.format(dt.toDate());

相关文章