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

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

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

PropertyValue.asInteger介绍

暂无

代码示例

代码示例来源:origin: com.hurence.logisland/logisland-cache_key_value-service-api

protected Cache<K,V> createCache(final ControllerServiceInitializationContext context) throws IOException, InterruptedException {
    final int capacity = context.getPropertyValue(CACHE_SIZE).asInteger();
    return new LRUCache<K,V>(capacity);
  }
}

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

protected Cache<String, Record> createCache(final ControllerServiceInitializationContext context) throws IOException, InterruptedException {
  final int capacity = context.getPropertyValue(CACHE_SIZE).asInteger();
  return new LRUCache<String, Record>(capacity);
}

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

@Override
protected void setupDynamicProperties(ProcessContext context) {
  for (final Map.Entry<PropertyDescriptor, String> entry : context.getProperties().entrySet()) {
    if (!entry.getKey().isDynamic()) {
      continue;
    }
    String key = entry.getKey().getName();
    String value = entry.getValue()
        .replaceAll("cache\\((\\S*\\))", "cache.get(\"test\", new com.hurence.logisland.record.StandardRecord().setId($1)")
        .replaceAll("\\.value", ".getField(com.hurence.logisland.record.FieldDictionary.RECORD_VALUE).asDouble()");
    StringBuilder sb = new StringBuilder();
    sb.append("var match=false;\n")
        .append("try {\n")
        .append("if( ")
        .append(value)
        .append(" ) { match=true; }\n")
        .append("} catch(error) {}");
    dynamicTagValuesMap.put(entry.getKey().getName(), sb.toString());
    //   System.out.println(sb.toString());
    //  logger.debug(sb.toString());
  }
  defaultCollection = context.getPropertyValue(DATASTORE_CACHE_COLLECTION).asString();
  recordTTL = context.getPropertyValue(RECORD_TTL).asInteger();
}

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

protected void createChronixStorage(ControllerServiceInitializationContext context) throws ProcessException {
  if (updater != null) {
    return;
  }
  // setup a thread pool of solr updaters
  int batchSize = context.getPropertyValue(BATCH_SIZE).asInteger();
  long flushInterval = context.getPropertyValue(FLUSH_INTERVAL).asLong();
  updater = new ChronixUpdater(solr, queue, createMetricsTypeMapping(context), batchSize, flushInterval);
  executorService.execute(updater);
}

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

@Override
public Collection<Record> process(ProcessContext context, Collection<Record> records) {
  SamplingAlgorithm algorithm = SamplingAlgorithm.valueOf(
      context.getPropertyValue(SAMPLING_ALGORITHM).asString().toUpperCase());
  String valueFieldName = context.getPropertyValue(RECORD_VALUE_FIELD).asString();
  String timeFieldName = context.getPropertyValue(RECORD_TIME_FIELD).asString();
  int parameter = context.getPropertyValue(SAMPLING_PARAMETER).asInteger();
  Sampler sampler = SamplerFactory.getSampler(algorithm, valueFieldName, timeFieldName, parameter);
  return sampler.sample(new ArrayList<>(records)).stream()
      .map(r -> {
        return r.setField("is_sampled", FieldType.BOOLEAN, true);
      }).collect(Collectors.toList());
}

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

final AvroSerializer avroSerializer = new AvroSerializer(schema);
final int minEventsCount = context.getPropertyValue(MIN_EVENTS_COUNT).asInteger();
final int maxEventsCount = context.getPropertyValue(MAX_EVENTS_COUNT).asInteger();
final int eventsCount = randomData.nextInt(minEventsCount, maxEventsCount);
logger.debug("generating {} events in [{},{}]", eventsCount, minEventsCount, maxEventsCount);

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

@Override
public Collection<Record> process(final ProcessContext context, final Collection<Record> records) throws ProcessException {
  final int batchSize = context.getPropertyValue(BATCH_SIZE).asInteger();

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

final String connectionString = context.getPropertyValue(SOLR_CONNECTION_STRING).asString();
final String collection = context.getPropertyValue(SOLR_COLLECTION).asString();
setSchemaUpdateTimeout(context.getPropertyValue(SCHEMA_UPDATE_TIMEOUT).asInteger());
int batchSize = context.getPropertyValue(BATCH_SIZE).asInteger();
int numConcurrentRequests = context.getPropertyValue(CONCURRENT_REQUESTS).asInteger();
long flushInterval = context.getPropertyValue(FLUSH_INTERVAL).asLong();
updaters = new ArrayList<>(numConcurrentRequests);

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

userAgentKeep = context.getPropertyValue(USERAGENT_KEEP).asBoolean();
useCache = context.getPropertyValue(CACHE_ENABLED).asBoolean();
cacheSize = context.getPropertyValue(CACHE_SIZE).asInteger();
String tmp = context.getPropertyValue(FIELDS_TO_RETURN).asString();
selectedFields = Arrays.asList(tmp.split(",")).stream().map(String::trim).collect(Collectors.toList());

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

@Override
public void init(final ProcessContext context) {
  this.fieldsNameMapping = getFieldsNameMapping(context);
  this.nbSplitLimit = context.getPropertyValue(NB_SPLIT_LIMIT).asInteger();
  this.isEnabledSplitCounter = context.getPropertyValue(ENABLE_SPLIT_COUNTER).asBoolean();
  this.splitCounterSuffix = context.getPropertyValue(SPLIT_COUNTER_SUFFIX).asString();
}

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

.setBulkActions(context.getPropertyValue(BATCH_SIZE).asInteger())
.setBulkSize(new ByteSizeValue(context.getPropertyValue(BULK_SIZE).asInteger(), ByteSizeUnit.MB))
.setFlushInterval(TimeValue.timeValueSeconds(context.getPropertyValue(FLUSH_INTERVAL).asInteger()))
.setConcurrentRequests(context.getPropertyValue(CONCURRENT_REQUESTS).asInteger())
.setBackoffPolicy(getBackOffPolicy(context))
.build();

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

public static JedisConnectionFactory createConnectionFactory(final ControllerServiceInitializationContext context) {
  final String redisMode = context.getPropertyValue(RedisUtils.REDIS_MODE).asString();
  final String connectionString = context.getPropertyValue(RedisUtils.CONNECTION_STRING).asString();
  final Integer dbIndex = context.getPropertyValue(RedisUtils.DATABASE).asInteger();
  final String password = context.getPropertyValue(RedisUtils.PASSWORD).asString();
  final Integer timeout = context.getPropertyValue(RedisUtils.COMMUNICATION_TIMEOUT).asTimePeriod(TimeUnit.MILLISECONDS).intValue();
    final Integer maxRedirects = context.getPropertyValue(RedisUtils.CLUSTER_MAX_REDIRECTS).asInteger();

代码示例来源: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-redis_4-client-service

private static JedisPoolConfig createJedisPoolConfig(final ControllerServiceInitializationContext context) {
  final JedisPoolConfig poolConfig = new JedisPoolConfig();
  poolConfig.setMaxTotal(context.getPropertyValue(RedisUtils.POOL_MAX_TOTAL).asInteger());
  poolConfig.setMaxIdle(context.getPropertyValue(RedisUtils.POOL_MAX_IDLE).asInteger());
  poolConfig.setMinIdle(context.getPropertyValue(RedisUtils.POOL_MIN_IDLE).asInteger());
  poolConfig.setBlockWhenExhausted(context.getPropertyValue(RedisUtils.POOL_BLOCK_WHEN_EXHAUSTED).asBoolean());
  poolConfig.setMaxWaitMillis(context.getPropertyValue(RedisUtils.POOL_MAX_WAIT_TIME).asTimePeriod(TimeUnit.MILLISECONDS));
  poolConfig.setMinEvictableIdleTimeMillis(context.getPropertyValue(RedisUtils.POOL_MIN_EVICTABLE_IDLE_TIME).asTimePeriod(TimeUnit.MILLISECONDS));
  poolConfig.setTimeBetweenEvictionRunsMillis(context.getPropertyValue(RedisUtils.POOL_TIME_BETWEEN_EVICTION_RUNS).asTimePeriod(TimeUnit.MILLISECONDS));
  poolConfig.setNumTestsPerEvictionRun(context.getPropertyValue(RedisUtils.POOL_NUM_TESTS_PER_EVICTION_RUN).asInteger());
  poolConfig.setTestOnCreate(context.getPropertyValue(RedisUtils.POOL_TEST_ON_CREATE).asBoolean());
  poolConfig.setTestOnBorrow(context.getPropertyValue(RedisUtils.POOL_TEST_ON_BORROW).asBoolean());
  poolConfig.setTestOnReturn(context.getPropertyValue(RedisUtils.POOL_TEST_ON_RETURN).asBoolean());
  poolConfig.setTestWhileIdle(context.getPropertyValue(RedisUtils.POOL_TEST_WHILE_IDLE).asBoolean());
  return poolConfig;
}

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

final Integer dbIndex = validationContext.getPropertyValue(RedisUtils.DATABASE).asInteger();

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

cacheValidityPeriodSec = (long)context.getPropertyValue(CONFIG_CACHE_MAX_TIME).asInteger();
resolutionTimeoutMs = (long)context.getPropertyValue(CONFIG_RESOLUTION_TIMEOUT).asInteger();
debug = context.getPropertyValue(CONFIG_DEBUG).asBoolean();

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

Long maxMemory = context.getPropertyValue(MAX_MEMORY).asLong();
Boolean allowNoBrace = context.getPropertyValue(ALLOw_NO_BRACE).asBoolean();
Integer maxPreparedStatements = context.getPropertyValue(MAX_PREPARED_STATEMENTS).asInteger();

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

outlierConfig.getConfig().put(
    SketchyMovingMAD.RESERVOIR_SIZE,
    context.getPropertyValue(RESERVOIR_SIZE).asInteger());
outlierConfig.getConfig().put(
    RPCAOutlierAlgorithm.MIN_RECORDS_CONFIG,
    context.getPropertyValue(RPCA_MIN_RECORDS).asInteger());

相关文章