2017-11-01 3 views
0

nifi 1.3.0을 사용하고 하나의 속성 설명자 디렉토리와 2 개의 관계 (실패 및 성공)를 추가했지만이 프로그램을 빌드하고 nifi lib 디렉토리에서 실패 할 경우 몇 가지 이유가 있습니다. nifi를 처리하고 MyProcessor를 배치 한 후에 속성 및 관계가없는 프로세서가 있습니다. 여기에 내 코드와 상대 프로세서 사진은 다음과 같습니다Nifi : nifi 사용자 정의 프로세서에서 초기화

protected void init(final ProcessorInitializationContext context) { 
final List<PropertyDescriptor> properties = new ArrayList<>(); 
properties.add(DIRECTORY); 

this.properties = Collections.unmodifiableList(properties); 

final Set<Relationship> relationships = new HashSet<>(); 
relationships.add(REL_SUCCESS); 
relationships.add(REL_FAILURE); 
this.relationships = Collections.unmodifiableSet(relationships); 
} 
  1. 당신은 내가 그것을 개선 할 수있는 방법 더 나은 아이디어가 있습니까? 여기 사진입니다 : enter image description here
당신은 속성과 관계 반환 방법을 재정의해야

답변

3

:

@Override 
public Set<Relationship> getRelationships() { 
    return this.relationships; 
} 

@Override 
protected List<PropertyDescriptor> getSupportedPropertyDescriptors() { 
    return this.properties; 
} 
관련 문제