org.apache.nifi.components.PropertyValue.asLong()方法的使用及代码示例

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

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

PropertyValue.asLong介绍

暂无

代码示例

代码示例来源:origin: apache/nifi

@Override
public Long asLong() {
  ensureExpressionsEvaluated();
  return stdPropValue.asLong();
}

代码示例来源:origin: apache/nifi

@OnScheduled
public void onScheduled(final ProcessContext context) {
  super.onScheduled(context);
  qos = context.getProperty(PROP_QOS).asInteger();
  maxQueueSize = context.getProperty(PROP_MAX_QUEUE_SIZE).asLong();
  topicFilter = context.getProperty(PROP_TOPIC_FILTER).getValue();
  scheduled.set(true);
}

代码示例来源:origin: apache/nifi

maxConnections = 1;
} else {
  maxConnections = context.getProperty(MAX_CONNECTIONS).asLong().intValue();

代码示例来源:origin: apache/nifi

String host = context.getProperty(RIEMANN_HOST).getValue().trim();
int port = context.getProperty(RIEMANN_PORT).asInteger();
writeTimeout = context.getProperty(TIMEOUT).asLong();
RiemannClient client = null;
try {

代码示例来源:origin: apache/nifi

@OnScheduled
public void onScheduled(final ProcessContext context) throws ProcessException, URISyntaxException {
  final BlockingQueue<String> partitionNames = new LinkedBlockingQueue<>();
  for (int i = 0; i < context.getProperty(NUM_PARTITIONS).asInteger(); i++) {
    partitionNames.add(String.valueOf(i));
  }
  this.partitionNames = partitionNames;
  final String policyName = context.getProperty(ACCESS_POLICY).getValue();
  final String policyKey = context.getProperty(POLICY_PRIMARY_KEY).getValue();
  final String namespace = context.getProperty(NAMESPACE).getValue();
  final String eventHubName = context.getProperty(EVENT_HUB_NAME).getValue();
  final String serviceBusEndpoint = context.getProperty(SERVICE_BUS_ENDPOINT).getValue();
  if(context.getProperty(ENQUEUE_TIME).isSet()) {
    configuredEnqueueTime = Instant.parse(context.getProperty(ENQUEUE_TIME).toString());
  } else {
    configuredEnqueueTime = null;
  }
  if(context.getProperty(RECEIVER_FETCH_SIZE).isSet()) {
    receiverFetchSize = context.getProperty(RECEIVER_FETCH_SIZE).asInteger();
  } else {
    receiverFetchSize = 100;
  }
  if(context.getProperty(RECEIVER_FETCH_TIMEOUT).isSet()) {
    receiverFetchTimeout = Duration.ofMillis(context.getProperty(RECEIVER_FETCH_TIMEOUT).asLong());
  } else {
    receiverFetchTimeout = null;
  }
  final String connectionString = new ConnectionStringBuilder(new URI("amqps://"+namespace+serviceBusEndpoint), eventHubName, policyName, policyKey).toString();
  setupReceiver(connectionString);
}

代码示例来源:origin: apache/nifi

final Long commitWithin = context.getProperty(COMMIT_WITHIN).evaluateAttributeExpressions(flowFile).asLong();
final String contentStreamPath = context.getProperty(UPDATE_PATH).evaluateAttributeExpressions(flowFile).getValue();
final MultiMapSolrParams requestParams = new MultiMapSolrParams(SolrUtils.getRequestParams(context, flowFile));
final RecordReaderFactory readerFactory = context.getProperty(RECORD_READER).asControllerService(RecordReaderFactory.class);
final String fieldsToIndex = context.getProperty(FIELDS_TO_INDEX).evaluateAttributeExpressions(flowFile).getValue();
final Long batchSize = context.getProperty(BATCH_SIZE).evaluateAttributeExpressions(flowFile).asLong();

代码示例来源:origin: apache/nifi

final Long min = context.getProperty(MIN_ENTRIES).asLong();
final Long max = context.getProperty(MAX_ENTRIES).asLong();

代码示例来源:origin: apache/nifi

Long generation = context.getProperty(GENERATION)
              .evaluateAttributeExpressions(flowFile)
              .asLong();
String encryptionKey = context.getProperty(ENCRYPTION_KEY)
              .evaluateAttributeExpressions(flowFile)

代码示例来源:origin: apache/nifi

.asLong();

代码示例来源:origin: apache/nifi

private Publisher.Builder getPublisherBuilder(ProcessContext context) {
    final Long batchSize = context.getProperty(BATCH_SIZE).asLong();

    return Publisher.newBuilder(getTopicName(context))
        .setCredentialsProvider(FixedCredentialsProvider.create(getGoogleCredentials(context)))
        .setBatchingSettings(BatchingSettings.newBuilder()
        .setElementCountThreshold(batchSize)
        .setIsEnabled(true)
        .build());
  }
}

代码示例来源:origin: apache/nifi

final Long commitWithin = context.getProperty(COMMIT_WITHIN).evaluateAttributeExpressions(flowFile).asLong();
final String contentStreamPath = context.getProperty(CONTENT_STREAM_PATH).evaluateAttributeExpressions(flowFile).getValue();
final MultiMapSolrParams requestParams = new MultiMapSolrParams(SolrUtils.getRequestParams(context, flowFile));

代码示例来源:origin: apache/nifi

builder.setTime(time.asLong());

代码示例来源:origin: apache/nifi

} else if (!getAllRecords) {
  if (context.getProperty(INIT_BINLOG_POSITION).isSet()) {
    currentBinlogPosition = context.getProperty(INIT_BINLOG_POSITION).evaluateAttributeExpressions().asLong();
  } else {
    currentBinlogPosition = DO_NOT_SET;
  String driverName = context.getProperty(DRIVER_NAME).evaluateAttributeExpressions().getValue();
  Long serverId = context.getProperty(SERVER_ID).evaluateAttributeExpressions().asLong();

代码示例来源:origin: apache/nifi

timerangeMin = context.getProperty(TIME_RANGE_MIN).evaluateAttributeExpressions(flowFile).asLong();
}catch(Exception e){
  getLogger().error("Time range min value is not a number ({}) for {}, transferring to failure",
  timerangeMax = context.getProperty(TIME_RANGE_MAX).evaluateAttributeExpressions(flowFile).asLong();
}catch(Exception e){
  getLogger().error("Time range max value is not a number ({}) for {}, transferring to failure",

代码示例来源:origin: org.apache.nifi/nifi-mock

@Override
public Long asLong() {
  ensureExpressionsEvaluated();
  return stdPropValue.asLong();
}

代码示例来源:origin: org.apache.nifi/nifi-standard-processors

maxConnections = 1;
} else {
  maxConnections = context.getProperty(MAX_CONNECTIONS).asLong().intValue();

代码示例来源:origin: jdye64/nifi-addons

@Override
  public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException {
    FlowFile ff = session.get();
    if (ff == null) {
      return;
    }

    String delay = ff.getAttribute(TIME_ATTRIBUTE);
    if (delay == null) {
      // This is the first time that the file has entered this processor so we need to create and place
      // the initial timestamp in the flowfile's attributes.
      ff = session.putAttribute(ff, TIME_ATTRIBUTE, String.valueOf(System.currentTimeMillis()));
      ff = session.penalize(ff);
      session.transfer(ff, REL_DELAY);
    } else {
      Long delayTimestamp = new Long(delay);
      if ((System.currentTimeMillis() - delayTimestamp)
          > context.getProperty(DELAY_TIME_MS).evaluateAttributeExpressions().asLong()) {
        session.transfer(ff, REL_READY);
      } else {
        ff = session.penalize(ff);
        session.transfer(ff, REL_DELAY);
      }
    }
  }
}

代码示例来源:origin: org.apache.nifi/nifi-riemann-processors

String host = context.getProperty(RIEMANN_HOST).getValue().trim();
int port = context.getProperty(RIEMANN_PORT).asInteger();
writeTimeout = context.getProperty(TIMEOUT).asLong();
RiemannClient client = null;
try {

代码示例来源:origin: org.apache.nifi/nifi-solr-processors

final Long commitWithin = context.getProperty(COMMIT_WITHIN).evaluateAttributeExpressions(flowFile).asLong();
final String contentStreamPath = context.getProperty(UPDATE_PATH).evaluateAttributeExpressions(flowFile).getValue();
final MultiMapSolrParams requestParams = new MultiMapSolrParams(SolrUtils.getRequestParams(context, flowFile));
final RecordReaderFactory readerFactory = context.getProperty(RECORD_READER).asControllerService(RecordReaderFactory.class);
final String fieldsToIndex = context.getProperty(FIELDS_TO_INDEX).evaluateAttributeExpressions(flowFile).getValue();
final Long batchSize = context.getProperty(BATCH_SIZE).evaluateAttributeExpressions(flowFile).asLong();

代码示例来源:origin: org.apache.nifi/nifi-riemann-processors

builder.setTime(time.asLong());

相关文章