Member since
04-17-2017
14
Posts
0
Kudos Received
0
Solutions
05-04-2017
08:38 PM
so, it seems that ZooKeeper Migrator could be used? Migrating from an embedded ZooKeeper in NiFi 0.x or 1.x to an external ZooKeeper
... View more
05-04-2017
08:38 PM
so, it seems that ZooKeeper Migrator could be used?
Migrating from an embedded ZooKeeper in NiFi 0.x or 1.x to an external ZooKeeper
... View more
04-28-2017
03:39 PM
I can't find where to add regexp patterns here.
... View more
04-28-2017
09:17 AM
Hello, I want to create data flow to execute external command, get result from it, put it to file, parse it and save result to new file. Can it be done using build-in processors? Or I should write my own? For example I see that I can use: PutFile, ExecuteProcess, but for parsing file using regexp expressions for example, I don't know how to do it. Thank you very much for your help.
... View more
Labels:
- Labels:
-
Apache NiFi
04-27-2017
07:40 PM
Hello, I created custom processor, added loging for onTrigger, init, onScheduled methods. But onTrigger never called. When I press Run in Nifi GUI, I see onScheduled method called, but not onTrigger. Thank you for your help. My code example: @TriggerSerially
@InputRequirement(Requirement.INPUT_FORBIDDEN)
public static final PropertyDescriptor SCAN_PORT = new PropertyDescriptor.Builder().name("Port")
.description("Scan port").defaultValue("8080").required(true)
.addValidator(StandardValidators.NON_EMPTY_VALIDATOR).build();
public static final Relationship REL_FOUND = new Relationship.Builder().name("found")
.description("Found host with given port").build();
private List<PropertyDescriptor> descriptors;
private Set<Relationship> relationships;
private static HostScanner hostScanner;
@Override
protected void init(final ProcessorInitializationContext context) {
final List<PropertyDescriptor> descriptors = new ArrayList<PropertyDescriptor>();
descriptors.add(SCAN_PORT);
this.descriptors = Collections.unmodifiableList(descriptors);
final Set<Relationship> relationships = new HashSet<Relationship>();
relationships.add(REL_FOUND);
this.relationships = Collections.unmodifiableSet(relationships);
this.getLogger().info("[INFO] HostDiscoveryProcessor init");
hostScanner = new HostScanner();
hostScanner.setLogger(getLogger());
}
@Override
public Set<Relationship> getRelationships() {
return this.relationships;
}
@Override
public final List<PropertyDescriptor> getSupportedPropertyDescriptors() {
return descriptors;
}
@OnScheduled
public void onScheduled(final ProcessContext context) {
this.getLogger().info("[INFO] HostDiscoveryProcessor onScheduled");
final String scanPort = context.getProperty(SCAN_PORT).getValue();
hostScanner.setPort(Integer.parseInt(scanPort));
}
@Override
public void onTrigger(final ProcessContext context, final ProcessSession aSession) throws ProcessException {
FlowFile flowFile = aSession.get();
if (flowFile == null) {
return;
}
// Logger logger = Logger.getLogger(MyClass.class.getName());
this.getLogger().info("[INFO] HostDiscoveryProcessor onTrigger - start scan");
List<String> ips = hostScanner.scan();
this.getLogger().info("[INFO] Scan completed");
flowFile = aSession.write(flowFile, new OutputStreamCallback() {
@Override
public void process(OutputStream aStream) throws IOException {
aStream.write(listToBytes(ips));
}
});
aSession.transfer(flowFile, REL_FOUND);
aSession.commit();
}
... View more
Labels:
- Labels:
-
Apache NiFi
04-20-2017
04:38 PM
Yes, I follow you )
But it's just example 2 more new nodes. It could be 10-15 and so on... So in this case it would be cool to automate this process somehow.
... View more
04-20-2017
03:34 PM
I try to implement this thing: https://zookeeper.apache.org/doc/trunk/zookeeperReconfig.html But it available starting from Zookeeper 3.5.0 Is there a way to replace zookeeper with newer version in Apache NiFi ? Thank you.
... View more
Labels:
- Labels:
-
Apache NiFi
04-18-2017
02:35 PM
Hi, Thank you very much for answer.
So can I implement it using ExecuteScript processor ? Could you please give some tips where to look at.
... View more
04-17-2017
01:46 PM
1.0.1 but how will they find master node? it means that I need to reconfigure all 5 nifi nodes in order to work?
... View more