NIFI-1818 Adjusting exceptions to reflect the appropriate repository instantiation that caused the issue.

This closes #385.

Signed-off-by: Andy LoPresto <alopresto@apache.org>
This commit is contained in:
Aldrin Piri 2016-04-27 17:09:18 -04:00 committed by Andy LoPresto
parent 6938c3db54
commit 11cff0dd39
No known key found for this signature in database
GPG Key ID: 3C6EF65B2F7DEF69
1 changed files with 7 additions and 3 deletions

View File

@ -418,12 +418,16 @@ public class FlowController implements EventAccess, ControllerServiceProvider, R
try { try {
this.provenanceEventRepository = createProvenanceRepository(properties); this.provenanceEventRepository = createProvenanceRepository(properties);
this.provenanceEventRepository.initialize(createEventReporter(bulletinRepository)); this.provenanceEventRepository.initialize(createEventReporter(bulletinRepository));
this.contentRepository = createContentRepository(properties);
} catch (final Exception e) { } catch (final Exception e) {
throw new RuntimeException("Unable to create Provenance Repository", e); throw new RuntimeException("Unable to create Provenance Repository", e);
} }
try {
this.contentRepository = createContentRepository(properties);
} catch (final Exception e) {
throw new RuntimeException("Unable to create Content Repository", e);
}
try { try {
this.stateManagerProvider = StandardStateManagerProvider.create(properties); this.stateManagerProvider = StandardStateManagerProvider.create(properties);
} catch (final IOException e) { } catch (final IOException e) {
@ -735,7 +739,7 @@ public class FlowController implements EventAccess, ControllerServiceProvider, R
private ContentRepository createContentRepository(final NiFiProperties properties) throws InstantiationException, IllegalAccessException, ClassNotFoundException { private ContentRepository createContentRepository(final NiFiProperties properties) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
final String implementationClassName = properties.getProperty(NiFiProperties.CONTENT_REPOSITORY_IMPLEMENTATION, DEFAULT_CONTENT_REPO_IMPLEMENTATION); final String implementationClassName = properties.getProperty(NiFiProperties.CONTENT_REPOSITORY_IMPLEMENTATION, DEFAULT_CONTENT_REPO_IMPLEMENTATION);
if (implementationClassName == null) { if (implementationClassName == null) {
throw new RuntimeException("Cannot create Provenance Repository because the NiFi Properties is missing the following property: " throw new RuntimeException("Cannot create Content Repository because the NiFi Properties is missing the following property: "
+ NiFiProperties.CONTENT_REPOSITORY_IMPLEMENTATION); + NiFiProperties.CONTENT_REPOSITORY_IMPLEMENTATION);
} }