@Override public Long asLong() { ensureExpressionsEvaluated(); return stdPropValue.asLong(); }
@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); }
maxConnections = 1; } else { maxConnections = context.getProperty(MAX_CONNECTIONS).asLong().intValue();
String host = context.getProperty(RIEMANN_HOST).getValue().trim(); int port = context.getProperty(RIEMANN_PORT).asInteger(); writeTimeout = context.getProperty(TIMEOUT).asLong(); RiemannClient client = null; try {
@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); }
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();
Long generation = context.getProperty(GENERATION) .evaluateAttributeExpressions(flowFile) .asLong(); String encryptionKey = context.getProperty(ENCRYPTION_KEY) .evaluateAttributeExpressions(flowFile)
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()); } }
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));
builder.setTime(time.asLong());
} 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();
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",
@Override public Long asLong() { ensureExpressionsEvaluated(); return stdPropValue.asLong(); }
maxConnections = 1; } else { maxConnections = context.getProperty(MAX_CONNECTIONS).asLong().intValue();
@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); } } } }
String host = context.getProperty(RIEMANN_HOST).getValue().trim(); int port = context.getProperty(RIEMANN_PORT).asInteger(); writeTimeout = context.getProperty(TIMEOUT).asLong(); RiemannClient client = null; try {
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();
builder.setTime(time.asLong());