mirror of https://github.com/apache/nifi.git
Merge remote-tracking branch 'upstream/develop' into nifi-solr-bundle
Conflicts: nifi/nifi-assembly/pom.xml nifi/pom.xml
This commit is contained in:
commit
ba5bcba1b7
|
@ -15,142 +15,22 @@
|
|||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.apache</groupId>
|
||||
<artifactId>apache</artifactId>
|
||||
<version>16</version>
|
||||
<groupId>org.apache.nifi</groupId>
|
||||
<artifactId>nifi-parent</artifactId>
|
||||
<version>1.0.0-incubating-SNAPSHOT</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
<groupId>org.apache.nifi</groupId>
|
||||
<artifactId>nifi-nar-maven-plugin</artifactId>
|
||||
<version>1.0.1-incubating-SNAPSHOT</version>
|
||||
<packaging>maven-plugin</packaging>
|
||||
<description>Apache NiFi Nar Plugin. It is currently a part of the Apache Incubator.</description>
|
||||
<url>http://nifi.incubator.apache.org</url>
|
||||
<organization>
|
||||
<name>Apache NiFi (incubating)</name>
|
||||
<url>http://nifi.incubator.apache.org/</url>
|
||||
</organization>
|
||||
<licenses>
|
||||
<license>
|
||||
<name>Apache License, Version 2.0</name>
|
||||
<url>http://www.apache.org/licenses/LICENSE-2.0</url>
|
||||
</license>
|
||||
</licenses>
|
||||
<mailingLists>
|
||||
<mailingList>
|
||||
<name>Dev</name>
|
||||
<subscribe>dev-subscribe@nifi.incubator.apache.org</subscribe>
|
||||
<unsubscribe>dev-unsubscribe@nifi.incubator.apache.org</unsubscribe>
|
||||
<post>dev@nifi.incubator.apache.org</post>
|
||||
<archive>http://mail-archives.apache.org/mod_mbox/incubator-nifi-dev</archive>
|
||||
</mailingList>
|
||||
<mailingList>
|
||||
<name>Commits</name>
|
||||
<subscribe>commits-subscribe@nifi.incubator.apache.org</subscribe>
|
||||
<unsubscribe>commits-unsubscribe@nifi.incubator.apache.org</unsubscribe>
|
||||
<post>commits@nifi.incubator.apache.org</post>
|
||||
<archive>http://mail-archives.apache.org/mod_mbox/incubator-nifi-commits</archive>
|
||||
</mailingList>
|
||||
</mailingLists>
|
||||
<scm>
|
||||
<connection>scm:git:git://git.apache.org/incubator-nifi.git</connection>
|
||||
<developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/incubator-nifi.git</developerConnection>
|
||||
<url>https://git-wip-us.apache.org/repos/asf?p=incubator-nifi.git</url>
|
||||
<tag>HEAD</tag>
|
||||
</scm>
|
||||
<issueManagement>
|
||||
<system>JIRA</system>
|
||||
<url>https://issues.apache.org/jira/browse/NIFI</url>
|
||||
</issueManagement>
|
||||
<properties>
|
||||
<maven.compiler.source>1.7</maven.compiler.source>
|
||||
<maven.compiler.target>1.7</maven.compiler.target>
|
||||
<maven.min-version>3.0.5</maven.min-version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
</properties>
|
||||
<prerequisites>
|
||||
<maven>${maven.min-version}</maven>
|
||||
</prerequisites>
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.2</version>
|
||||
<configuration>
|
||||
<fork>true</fork>
|
||||
<optimize>true</optimize>
|
||||
<showDeprecation>true</showDeprecation>
|
||||
<showWarnings>true</showWarnings>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>2.7</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.18</version>
|
||||
<configuration>
|
||||
<argLine>-Xmx1G</argLine>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<version>2.5.2</version>
|
||||
<configuration>
|
||||
<tarLongFileMode>gnu</tarLongFileMode>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>2.4</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-site-plugin</artifactId>
|
||||
<version>3.4</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>1.3.2</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>2.10.1</version>
|
||||
<configuration>
|
||||
<failOnError>false</failOnError>
|
||||
<quiet>true</quiet>
|
||||
<show>private</show>
|
||||
<encoding>UTF-8</encoding>
|
||||
<quiet>true</quiet>
|
||||
<javadocVersion>1.7</javadocVersion>
|
||||
<additionalJOption>-J-Xmx512m</additionalJOption>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-release-plugin</artifactId>
|
||||
<version>2.5.1</version>
|
||||
<configuration>
|
||||
<useReleaseProfile>true</useReleaseProfile>
|
||||
<releaseProfiles>apache-release</releaseProfiles>
|
||||
<autoVersionSubmodules>true</autoVersionSubmodules>
|
||||
<goals>deploy</goals>
|
||||
<tagNameFormat>@{project.artifactId}-@{project.version}</tagNameFormat>
|
||||
<pushChanges>false</pushChanges>
|
||||
<localCheckout>true</localCheckout>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>default</id>
|
||||
|
@ -163,24 +43,9 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>2.5</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.sonatype.plugins</groupId>
|
||||
<artifactId>nexus-staging-maven-plugin</artifactId>
|
||||
<version>1.6.5</version>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<serverId>repository.apache.org</serverId>
|
||||
<nexusUrl>https://repository.apache.org/</nexusUrl>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
|
@ -201,20 +66,9 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.rat</groupId>
|
||||
<artifactId>apache-rat-plugin</artifactId>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>nb-configuration.xml</exclude> <!-- convenience exclude for netbeans users -->
|
||||
<exclude>nbactions.xml</exclude> <!-- convenience excludes for netbeans users -->
|
||||
<exclude>DEPENDENCIES</exclude> <!-- auto generated by maven while building sources zip and more -->
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</plugins>
|
||||
</build>
|
||||
<dependencies>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-api</artifactId>
|
||||
|
@ -240,27 +94,4 @@
|
|||
<version>3.3</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<profiles>
|
||||
<profile>
|
||||
<!-- Automatically check for licenses.
|
||||
Activate with -P check-licenses -->
|
||||
<id>check-licenses</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.rat</groupId>
|
||||
<artifactId>apache-rat-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>check</goal>
|
||||
</goals>
|
||||
<phase>verify</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
|
|
|
@ -290,8 +290,8 @@ public class NarMojo extends AbstractMojo {
|
|||
*/
|
||||
@Parameter(property = "overWriteIfNewer", required = false, defaultValue = "true")
|
||||
protected boolean overWriteIfNewer;
|
||||
|
||||
@Parameter( property = "projectBuildDirectory", required = false, defaultValue = "${project.build.directory}")
|
||||
|
||||
@Parameter(property = "projectBuildDirectory", required = false, defaultValue = "${project.build.directory}")
|
||||
protected File projectBuildDirectory;
|
||||
|
||||
/**
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
Apache NiFi is an effort undergoing incubation at the Apache Software
|
||||
Foundation (ASF), sponsored by the Apache Incubator PMC.
|
||||
|
||||
Incubation is required of all newly accepted projects until a further review
|
||||
indicates that the infrastructure, communications, and decision making process
|
||||
have stabilized in a manner consistent with other successful ASF projects.
|
||||
|
||||
While incubation status is not necessarily a reflection of the completeness
|
||||
or stability of the code, it does indicate that the project has yet to be
|
||||
fully endorsed by the ASF.
|
||||
|
||||
For more information about the incubation status of the Apache NiFi project
|
||||
you can go to the following page:
|
||||
|
||||
http://nifi.incubator.apache.org/
|
|
@ -0,0 +1,202 @@
|
|||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
|
@ -0,0 +1,5 @@
|
|||
Apache NiFi
|
||||
Copyright 2014-2015 The Apache Software Foundation
|
||||
|
||||
This product includes software developed at
|
||||
The Apache Software Foundation (http://www.apache.org/).
|
|
@ -0,0 +1,65 @@
|
|||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
(the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
# Apache NiFi Parent
|
||||
|
||||
Apache NiFi Parent provides a nice aggregation of shared concerns for all NiFi Poms to follow
|
||||
|
||||
## Table of Contents
|
||||
|
||||
- [Getting Started](#getting-started)
|
||||
- [License](#license)
|
||||
- [Disclaimer](#disclaimer)
|
||||
|
||||
## Getting Started
|
||||
|
||||
- Build the nifi-parent module. Then you can go to the 'nifi-nar-maven-plugin'
|
||||
directory and follow its instructions and finally the 'nifi' directory. Building
|
||||
the nifi-parent and nifi-nar-maven-plugin should be rarely necessary as these
|
||||
will be released infrequently by comparison to the 'nifi' tree.
|
||||
|
||||
## Documentation
|
||||
|
||||
See http://nifi.incubator.apache.org/ for the latest documentation.
|
||||
|
||||
## License
|
||||
|
||||
Except as otherwise noted this software is licensed under the
|
||||
[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html)
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
## Disclaimer
|
||||
|
||||
Apache NiFi is an effort undergoing incubation at the Apache Software
|
||||
Foundation (ASF), sponsored by the Apache Incubator PMC.
|
||||
|
||||
Incubation is required of all newly accepted projects until a further review
|
||||
indicates that the infrastructure, communications, and decision making process
|
||||
have stabilized in a manner consistent with other successful ASF projects.
|
||||
|
||||
While incubation status is not necessarily a reflection of the completeness
|
||||
or stability of the code, it does indicate that the project has yet to be
|
||||
fully endorsed by the ASF.
|
||||
|
|
@ -0,0 +1,396 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
(the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.apache</groupId>
|
||||
<artifactId>apache</artifactId>
|
||||
<version>16</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
<groupId>org.apache.nifi</groupId>
|
||||
<artifactId>nifi-parent</artifactId>
|
||||
<version>1.0.0-incubating-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
<description>The nifi-parent enables each apache nifi project to ensure consistent approaches and DRY</description>
|
||||
<url>http://nifi.incubator.apache.org</url>
|
||||
<organization>
|
||||
<name>Apache NiFi(incubating) Project</name>
|
||||
<url>http://nifi.incubator.apache.org/</url>
|
||||
</organization>
|
||||
<licenses>
|
||||
<license>
|
||||
<name>Apache License, Version 2.0</name>
|
||||
<url>http://www.apache.org/licenses/LICENSE-2.0</url>
|
||||
</license>
|
||||
</licenses>
|
||||
<mailingLists>
|
||||
<mailingList>
|
||||
<name>Dev</name>
|
||||
<subscribe>dev-subscribe@nifi.incubator.apache.org</subscribe>
|
||||
<unsubscribe>dev-unsubscribe@nifi.incubator.apache.org</unsubscribe>
|
||||
<post>dev@nifi.incubator.apache.org</post>
|
||||
<archive>http://mail-archives.apache.org/mod_mbox/incubator-nifi-dev</archive>
|
||||
</mailingList>
|
||||
<mailingList>
|
||||
<name>Commits</name>
|
||||
<subscribe>commits-subscribe@nifi.incubator.apache.org</subscribe>
|
||||
<unsubscribe>commits-unsubscribe@nifi.incubator.apache.org</unsubscribe>
|
||||
<post>commits@nifi.incubator.apache.org</post>
|
||||
<archive>http://mail-archives.apache.org/mod_mbox/incubator-nifi-commits</archive>
|
||||
</mailingList>
|
||||
</mailingLists>
|
||||
<prerequisites>
|
||||
<maven>${maven.min-version}</maven>
|
||||
</prerequisites>
|
||||
<scm>
|
||||
<connection>scm:git:git://git.apache.org/incubator-nifi.git</connection>
|
||||
<developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/incubator-nifi.git</developerConnection>
|
||||
<url>https://git-wip-us.apache.org/repos/asf?p=incubator-nifi.git</url>
|
||||
<tag>HEAD</tag>
|
||||
</scm>
|
||||
<issueManagement>
|
||||
<system>JIRA</system>
|
||||
<url>https://issues.apache.org/jira/browse/NIFI</url>
|
||||
</issueManagement>
|
||||
<properties>
|
||||
<maven.compiler.source>1.7</maven.compiler.source>
|
||||
<maven.compiler.target>1.7</maven.compiler.target>
|
||||
<maven.min-version>3.0.5</maven.min-version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<inceptionYear>2014</inceptionYear>
|
||||
</properties>
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.2</version>
|
||||
<configuration>
|
||||
<fork>true</fork>
|
||||
<optimize>true</optimize>
|
||||
<showDeprecation>true</showDeprecation>
|
||||
<showWarnings>true</showWarnings>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>2.5</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>2.9</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>2.7</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.18</version>
|
||||
<configuration>
|
||||
<redirectTestOutputToFile>true</redirectTestOutputToFile>
|
||||
<argLine>-Xmx1G</argLine>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<version>2.5.2</version>
|
||||
<configuration>
|
||||
<tarLongFileMode>gnu</tarLongFileMode>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>jaxb2-maven-plugin</artifactId>
|
||||
<version>1.6</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>2.4</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-site-plugin</artifactId>
|
||||
<version>3.4</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>1.3.2</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>2.5</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>2.10.1</version>
|
||||
<configuration>
|
||||
<failOnError>false</failOnError>
|
||||
<quiet>true</quiet>
|
||||
<show>private</show>
|
||||
<encoding>UTF-8</encoding>
|
||||
<quiet>true</quiet>
|
||||
<javadocVersion>1.7</javadocVersion>
|
||||
<additionalJOption>-J-Xmx512m</additionalJOption>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-release-plugin</artifactId>
|
||||
<version>2.5.1</version>
|
||||
<configuration>
|
||||
<useReleaseProfile>true</useReleaseProfile>
|
||||
<releaseProfiles>apache-release</releaseProfiles>
|
||||
<autoVersionSubmodules>true</autoVersionSubmodules>
|
||||
<goals>deploy</goals>
|
||||
<tagNameFormat>@{project.artifactId}-@{project.version}</tagNameFormat>
|
||||
<pushChanges>false</pushChanges>
|
||||
<localCheckout>true</localCheckout>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>default</id>
|
||||
<goals>
|
||||
<goal>perform</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<pomFileName>nifi-parent/pom.xml</pomFileName>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>rpm-maven-plugin</artifactId>
|
||||
<version>2.1.1</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.antlr</groupId>
|
||||
<artifactId>antlr3-maven-plugin</artifactId>
|
||||
<version>3.5.2</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
||||
<version>2.15</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.puppycrawl.tools</groupId>
|
||||
<artifactId>checkstyle</artifactId>
|
||||
<version>6.5</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.sonatype.plugins</groupId>
|
||||
<artifactId>nexus-staging-maven-plugin</artifactId>
|
||||
<version>1.6.5</version>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<serverId>repository.apache.org</serverId>
|
||||
<nexusUrl>https://repository.apache.org/</nexusUrl>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-enforcer-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>enforce-maven</id>
|
||||
<goals>
|
||||
<goal>enforce</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<rules>
|
||||
<requireSameVersions>
|
||||
<plugins>
|
||||
<plugin>org.apache.maven.plugins:maven-surefire-plugin</plugin>
|
||||
<plugin>org.apache.maven.plugins:maven-failsafe-plugin</plugin>
|
||||
<plugin>org.apache.maven.plugins:maven-surefire-report-plugin</plugin>
|
||||
</plugins>
|
||||
</requireSameVersions>
|
||||
<requireMavenVersion>
|
||||
<version>${maven.min-version}</version>
|
||||
</requireMavenVersion>
|
||||
</rules>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
||||
<configuration>
|
||||
<checkstyleRules>
|
||||
<module name="Checker">
|
||||
<property name="charset" value="UTF-8" />
|
||||
<property name="severity" value="warning" />
|
||||
<!-- Checks for whitespace -->
|
||||
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
|
||||
<module name="FileTabCharacter">
|
||||
<property name="eachLine" value="true" />
|
||||
</module>
|
||||
<module name="TreeWalker">
|
||||
<module name="RegexpSinglelineJava">
|
||||
<property name="format" value="\s+$" />
|
||||
<property name="message" value="Line has trailing whitespace." />
|
||||
</module>
|
||||
<module name="RegexpSinglelineJava">
|
||||
<property name="format" value="[@]see\s+[{][@]link" />
|
||||
<property name="message" value="Javadoc @see does not need @link: pick one or the other." />
|
||||
</module>
|
||||
<module name="RegexpSinglelineJava">
|
||||
<property name="format" value="jline[.]internal[.]Preconditions" />
|
||||
<property name="message" value="Please use Guava Preconditions not JLine" />
|
||||
</module>
|
||||
<module name="OuterTypeFilename" />
|
||||
<module name="LineLength">
|
||||
<!-- needs extra, because Eclipse formatter ignores the ending left brace -->
|
||||
<property name="max" value="200" />
|
||||
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://" />
|
||||
</module>
|
||||
<module name="AvoidStarImport" />
|
||||
<module name="UnusedImports">
|
||||
<property name="processJavadoc" value="true" />
|
||||
</module>
|
||||
<module name="NoLineWrap" />
|
||||
<module name="LeftCurly">
|
||||
<property name="maxLineLength" value="160" />
|
||||
</module>
|
||||
<module name="RightCurly" />
|
||||
<module name="RightCurly">
|
||||
<property name="option" value="alone" />
|
||||
<property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, LITERAL_DO, STATIC_INIT, INSTANCE_INIT" />
|
||||
</module>
|
||||
<module name="SeparatorWrap">
|
||||
<property name="tokens" value="DOT" />
|
||||
<property name="option" value="nl" />
|
||||
</module>
|
||||
<module name="SeparatorWrap">
|
||||
<property name="tokens" value="COMMA" />
|
||||
<property name="option" value="EOL" />
|
||||
</module>
|
||||
<module name="PackageName">
|
||||
<property name="format" value="^[a-z]+(\.[a-z][a-zA-Z0-9]*)*$" />
|
||||
</module>
|
||||
<module name="MethodTypeParameterName">
|
||||
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)" />
|
||||
</module>
|
||||
<module name="MethodParamPad" />
|
||||
<module name="OperatorWrap">
|
||||
<property name="option" value="NL" />
|
||||
<property name="tokens" value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD, NOT_EQUAL, QUESTION, SL, SR, STAR " />
|
||||
</module>
|
||||
<module name="AnnotationLocation">
|
||||
<property name="tokens" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF" />
|
||||
</module>
|
||||
<module name="AnnotationLocation">
|
||||
<property name="tokens" value="VARIABLE_DEF" />
|
||||
<property name="allowSamelineMultipleAnnotations" value="true" />
|
||||
</module>
|
||||
<module name="NonEmptyAtclauseDescription" />
|
||||
<module name="JavadocMethod">
|
||||
<property name="allowMissingJavadoc" value="true" />
|
||||
<property name="allowMissingParamTags" value="true" />
|
||||
<property name="allowMissingThrowsTags" value="true" />
|
||||
<property name="allowMissingReturnTag" value="true" />
|
||||
<property name="allowedAnnotations" value="Override,Test,BeforeClass,AfterClass,Before,After" />
|
||||
<property name="allowThrowsTagsForSubclasses" value="true" />
|
||||
</module>
|
||||
<module name="SingleLineJavadoc" />
|
||||
</module>
|
||||
</module>
|
||||
</checkstyleRules>
|
||||
<violationSeverity>warning</violationSeverity>
|
||||
<includeTestSourceDirectory>true</includeTestSourceDirectory>
|
||||
<excludes>**/HelpMojo.java,**/generated-sources</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.rat</groupId>
|
||||
<artifactId>apache-rat-plugin</artifactId>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>nb-configuration.xml</exclude> <!-- courtesy excludes for netbeans users -->
|
||||
<exclude>nbactions.xml</exclude> <!-- courtesy excludes for netbeans users -->
|
||||
<exclude>DEPENDENCIES</exclude> <!-- auto generated file by apache's maven config while building sources.zip -->
|
||||
</excludes>
|
||||
</configuration>
|
||||
<dependencies>
|
||||
<!-- workaround for RAT-158 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.doxia</groupId>
|
||||
<artifactId>doxia-core</artifactId>
|
||||
<version>1.6</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>xerces</groupId>
|
||||
<artifactId>xercesImpl</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>check-licenses</id>
|
||||
<goals>
|
||||
<goal>check</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<profiles>
|
||||
<profile> <!-- will move this up with the always on plugins once we get all checkstyle stuff resolved-->
|
||||
<id>checkstyle</id>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>check-style</id>
|
||||
<goals>
|
||||
<goal>check</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
22
nifi/LICENSE
22
nifi/LICENSE
|
@ -455,3 +455,25 @@ This product bundles 'json2.js' which is available in the 'public domain'.
|
|||
This product bundles 'reset.css' which is available in the 'public domain'.
|
||||
For details see http://meyerweb.com/eric/tools/css/reset/
|
||||
|
||||
This product bundles HexViewJS available under an MIT License
|
||||
|
||||
Copyright (c) 2010 Nick McVeity <nmcveity@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without restriction,
|
||||
including without limitation the rights to use, copy, modify, merge,
|
||||
publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@ -25,18 +25,13 @@ import java.lang.annotation.Target;
|
|||
|
||||
/**
|
||||
* Indicates that a component has more than one dynamic property
|
||||
*
|
||||
* @author
|
||||
*
|
||||
*/
|
||||
@Documented
|
||||
@Target({ ElementType.TYPE })
|
||||
@Target({ElementType.TYPE})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Inherited
|
||||
public @interface DynamicProperties {
|
||||
/**
|
||||
* A list of the dynamic properties supported by a component
|
||||
* @return A list of the dynamic properties supported by a component
|
||||
*/
|
||||
|
||||
public DynamicProperty[] value();
|
||||
}
|
||||
|
|
|
@ -28,40 +28,19 @@ import org.apache.nifi.components.ConfigurableComponent;
|
|||
/**
|
||||
* An annotation that may be placed on a {@link ConfigurableComponent} to
|
||||
* indicate that it supports a dynamic property.
|
||||
*
|
||||
* @author
|
||||
*
|
||||
*/
|
||||
@Documented
|
||||
@Target({ ElementType.TYPE })
|
||||
@Target({ElementType.TYPE})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Inherited
|
||||
public @interface DynamicProperty {
|
||||
/**
|
||||
* A description of what the name of the dynamic property may be
|
||||
*
|
||||
* @return A description of what the name of the dynamic property may be
|
||||
*/
|
||||
|
||||
public String name();
|
||||
|
||||
/**
|
||||
* Indicates whether or not the dynamic property supports expression
|
||||
* language
|
||||
*
|
||||
* @return whether or not the dynamic property supports expression
|
||||
* language
|
||||
*/
|
||||
public boolean supportsExpressionLanguage() default false;
|
||||
|
||||
/**
|
||||
* A description of what the value of the dynamic property may be
|
||||
* @return a description of what the value of the dynamic property may be
|
||||
*/
|
||||
|
||||
public String value();
|
||||
|
||||
/**
|
||||
* Provides a description of what the meaning of the property is, and what the expected values are
|
||||
* @return a description of what the meaning of the property is, and what the expected values are
|
||||
*/
|
||||
|
||||
public String description();
|
||||
}
|
||||
|
|
|
@ -31,26 +31,15 @@ import org.apache.nifi.processor.Relationship;
|
|||
* Annotation to indicate that a {@link Processor} supports dynamic
|
||||
* relationship. A dynamic {@link Relationship} is one where the relationship is
|
||||
* generated based on a user defined {@link PropertyDescriptor}
|
||||
*
|
||||
* @author
|
||||
*
|
||||
*/
|
||||
@Documented
|
||||
@Target({ ElementType.TYPE })
|
||||
@Target({ElementType.TYPE})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Inherited
|
||||
public @interface DynamicRelationship {
|
||||
/**
|
||||
* Describes the name(s) of the dynamic relationship(s)
|
||||
*
|
||||
* @return a description of the name(s) of the dynamic relationship(s)
|
||||
*/
|
||||
|
||||
public String name();
|
||||
|
||||
/**
|
||||
* Describes the data that should be routed to the dynamic relationship(s)
|
||||
*
|
||||
* @return a description the data that should be routed to the dynamic relationship(s)
|
||||
*/
|
||||
public String description();
|
||||
}
|
||||
|
|
|
@ -24,27 +24,18 @@ import java.lang.annotation.RetentionPolicy;
|
|||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Annotation that may be placed on a {@link org.apache.nifi.processor.Processor Processor}
|
||||
* indicating that this processor reads a specific FlowFile attribute.
|
||||
*
|
||||
* @author
|
||||
* Annotation that may be placed on a
|
||||
* {@link org.apache.nifi.processor.Processor Processor} indicating that this
|
||||
* processor reads a specific FlowFile attribute.
|
||||
*
|
||||
*/
|
||||
|
||||
@Documented
|
||||
@Target({ElementType.TYPE})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Inherited
|
||||
public @interface ReadsAttribute {
|
||||
/**
|
||||
* The FlowFile attribute that is being read
|
||||
* @return
|
||||
*/
|
||||
|
||||
public String attribute();
|
||||
|
||||
/**
|
||||
* The description of how the attribute is being used
|
||||
* @return
|
||||
*/
|
||||
|
||||
public String description() default "";
|
||||
}
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
*/
|
||||
package org.apache.nifi.annotation.behavior;
|
||||
|
||||
import org.apache.nifi.annotation.behavior.ReadsAttribute;
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Inherited;
|
||||
|
@ -25,10 +24,9 @@ import java.lang.annotation.RetentionPolicy;
|
|||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Annotation that may be placed on a {@link org.apache.nifi.processor.Processor Processor}
|
||||
* indicating that this processor reads specific FlowFile attributes.
|
||||
*
|
||||
* @author
|
||||
* Annotation that may be placed on a
|
||||
* {@link org.apache.nifi.processor.Processor Processor} indicating that this
|
||||
* processor reads specific FlowFile attributes.
|
||||
*
|
||||
*/
|
||||
@Documented
|
||||
|
@ -36,9 +34,6 @@ import java.lang.annotation.Target;
|
|||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Inherited
|
||||
public @interface ReadsAttributes {
|
||||
/**
|
||||
* A list of attributes that may be read
|
||||
* @return
|
||||
*/
|
||||
|
||||
public ReadsAttribute[] value();
|
||||
}
|
||||
|
|
|
@ -24,18 +24,17 @@ import java.lang.annotation.RetentionPolicy;
|
|||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Marker annotation a {@link org.apache.nifi.processor.Processor Processor}
|
||||
* implementation can use to indicate that its
|
||||
* operations on FlowFiles can be safely repeated across process sessions. If a
|
||||
* processor has this annotation and it allows the framework to manage session
|
||||
* commit and rollback then the framework may elect to cascade a
|
||||
* {@link org.apache.nifi.processor.ProcessSession ProcessSession} given to this
|
||||
* processor's onTrigger method to the
|
||||
* onTrigger method of another processor. It can do this knowing that if
|
||||
* something fails along a series of processors using this same session that it
|
||||
* can all be safely rolled back without any ill effects on external services
|
||||
* which could not be rolled back and thus all the processes could be safely
|
||||
* repeated (implied idempotent behavior).
|
||||
* Marker annotation a {@link org.apache.nifi.processor.Processor Processor}
|
||||
* implementation can use to indicate that its operations on FlowFiles can be
|
||||
* safely repeated across process sessions. If a processor has this annotation
|
||||
* and it allows the framework to manage session commit and rollback then the
|
||||
* framework may elect to cascade a
|
||||
* {@link org.apache.nifi.processor.ProcessSession ProcessSession} given to this
|
||||
* processor's onTrigger method to the onTrigger method of another processor. It
|
||||
* can do this knowing that if something fails along a series of processors
|
||||
* using this same session that it can all be safely rolled back without any ill
|
||||
* effects on external services which could not be rolled back and thus all the
|
||||
* processes could be safely repeated (implied idempotent behavior).
|
||||
*
|
||||
* @author none
|
||||
*/
|
||||
|
|
|
@ -24,11 +24,10 @@ import java.lang.annotation.RetentionPolicy;
|
|||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Marker annotation a {@link org.apache.nifi.processor.Processor Processor}
|
||||
* implementation can use to indicate that the
|
||||
* Processor is not safe for concurrent execution of its onTrigger()
|
||||
* method. By default, Processors are assumed to be safe for concurrent
|
||||
* execution.
|
||||
* Marker annotation a {@link org.apache.nifi.processor.Processor Processor}
|
||||
* implementation can use to indicate that the Processor is not safe for
|
||||
* concurrent execution of its onTrigger() method. By default, Processors are
|
||||
* assumed to be safe for concurrent execution.
|
||||
*
|
||||
* @author none
|
||||
*/
|
||||
|
|
|
@ -25,11 +25,10 @@ import java.lang.annotation.Target;
|
|||
|
||||
/**
|
||||
* Marker annotation a {@link org.apache.nifi.processor.Processor Processor}
|
||||
* implementation can use to indicate that the
|
||||
* Processor is to be triggered if any of its destinations has available space
|
||||
* for incoming FlowFiles. By default, Processors are triggered only when all
|
||||
* destinations report that they have available space (i.e., none of the outgoing
|
||||
* Connections is full).
|
||||
* implementation can use to indicate that the Processor is to be triggered if
|
||||
* any of its destinations has available space for incoming FlowFiles. By
|
||||
* default, Processors are triggered only when all destinations report that they
|
||||
* have available space (i.e., none of the outgoing Connections is full).
|
||||
*
|
||||
* @author none
|
||||
*/
|
||||
|
|
|
@ -24,13 +24,13 @@ import java.lang.annotation.RetentionPolicy;
|
|||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Marker annotation a {@link org.apache.nifi.processor.Processor Processor}
|
||||
* implementation can use to indicate that the
|
||||
* Processor should still be triggered even when it has no data in its work
|
||||
* queue. By default, Processors which have no non-self incoming edges will be
|
||||
* triggered even if there is no work in its queue. However, Processors that
|
||||
* have non-self incoming edges will only be triggered if they have work in
|
||||
* their queue or they present this annotation.
|
||||
* Marker annotation a {@link org.apache.nifi.processor.Processor Processor}
|
||||
* implementation can use to indicate that the Processor should still be
|
||||
* triggered even when it has no data in its work queue. By default, Processors
|
||||
* which have no non-self incoming edges will be triggered even if there is no
|
||||
* work in its queue. However, Processors that have non-self incoming edges will
|
||||
* only be triggered if they have work in their queue or they present this
|
||||
* annotation.
|
||||
*
|
||||
* @author none
|
||||
*/
|
||||
|
|
|
@ -24,28 +24,18 @@ import java.lang.annotation.RetentionPolicy;
|
|||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Annotation that may be placed on a {@link org.apache.nifi.processor.Processor Processor}
|
||||
* indicating that this processor writes/updates a specific FlowFile attribute.
|
||||
*
|
||||
* @author
|
||||
* Annotation that may be placed on a
|
||||
* {@link org.apache.nifi.processor.Processor Processor} indicating that this
|
||||
* processor writes/updates a specific FlowFile attribute.
|
||||
*
|
||||
*/
|
||||
|
||||
@Documented
|
||||
@Target({ElementType.TYPE})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Inherited
|
||||
public @interface WritesAttribute {
|
||||
|
||||
/**
|
||||
* The FlowFile attribute that is being created or updated
|
||||
* @return
|
||||
*/
|
||||
|
||||
public String attribute();
|
||||
|
||||
/**
|
||||
* A description of what is being written to the FlowFile attribute
|
||||
* @return
|
||||
*/
|
||||
|
||||
public String description() default "";
|
||||
}
|
||||
|
|
|
@ -24,21 +24,16 @@ import java.lang.annotation.RetentionPolicy;
|
|||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Annotation that may be placed on a {@link org.apache.nifi.processor.Processor Processor}
|
||||
* indicating that this processor writes/updates specific FlowFile attributes.
|
||||
*
|
||||
* @author
|
||||
* Annotation that may be placed on a
|
||||
* {@link org.apache.nifi.processor.Processor Processor} indicating that this
|
||||
* processor writes/updates specific FlowFile attributes.
|
||||
*
|
||||
*/
|
||||
|
||||
@Documented
|
||||
@Target({ElementType.TYPE})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Inherited
|
||||
public @interface WritesAttributes {
|
||||
/**
|
||||
* A list of FlowFile attributes that may be written or updated
|
||||
* @return
|
||||
*/
|
||||
|
||||
public WritesAttribute[] value();
|
||||
}
|
||||
|
|
|
@ -24,10 +24,11 @@ import java.lang.annotation.RetentionPolicy;
|
|||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Annotation that may be placed on a {@link org.apache.nifi.processor.Processor Processor},
|
||||
* Annotation that may be placed on a {@link org.apache.nifi.processor.Processor Processor},
|
||||
* {@link org.apache.nifi.controller.ControllerService ControllerService}, or
|
||||
* {@link org.apache.nifi.reporting.ReportingTask ReportingTask} allowing for a description to be
|
||||
* provided. This description can be provided to a user in logs, UI, etc.
|
||||
* {@link org.apache.nifi.reporting.ReportingTask ReportingTask} allowing for a
|
||||
* description to be provided. This description can be provided to a user in
|
||||
* logs, UI, etc.
|
||||
*
|
||||
* @author none
|
||||
*/
|
||||
|
|
|
@ -26,34 +26,19 @@ import java.lang.annotation.Target;
|
|||
import org.apache.nifi.components.ConfigurableComponent;
|
||||
|
||||
/**
|
||||
* Annotation that may be placed on a
|
||||
* {@link org.apache.nifi.processor.Processor Processor},
|
||||
* Annotation that may be placed on a null {@link org.apache.nifi.processor.Processor Processor},
|
||||
* {@link org.apache.nifi.controller.ControllerService ControllerService}, or
|
||||
* {@link org.apache.nifi.reporting.ReportingTask ReportingTask} that indicates
|
||||
* this component is related to the components listed.
|
||||
*
|
||||
* @author
|
||||
*
|
||||
*/
|
||||
|
||||
@Documented
|
||||
@Target({ ElementType.TYPE })
|
||||
@Target({ElementType.TYPE})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Inherited
|
||||
public @interface SeeAlso {
|
||||
/**
|
||||
* Classes you want to link to.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
|
||||
public Class<? extends ConfigurableComponent>[] value() default {};
|
||||
|
||||
/**
|
||||
* Fully qualified class names you want to link to. Use this when the class
|
||||
* you want to link to is not in the class path of the component you are
|
||||
* linking from.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String[] classNames() default {};
|
||||
}
|
||||
|
|
|
@ -24,14 +24,13 @@ import java.lang.annotation.RetentionPolicy;
|
|||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Annotation that can be applied to a {@link org.apache.nifi.processor.Processor Processor},
|
||||
* Annotation that can be applied to a {@link org.apache.nifi.processor.Processor Processor},
|
||||
* {@link org.apache.nifi.controller.ControllerService ControllerService}, or
|
||||
* {@link org.apache.nifi.reporting.ReportingTask ReportingTask} in order to associate
|
||||
* tags (keywords) with the component. These tags do not affect the component in
|
||||
* any way but serve as additional documentation and can be used to sort/filter
|
||||
* Processors.
|
||||
* {@link org.apache.nifi.reporting.ReportingTask ReportingTask} in order to
|
||||
* associate tags (keywords) with the component. These tags do not affect the
|
||||
* component in any way but serve as additional documentation and can be used to
|
||||
* sort/filter Processors.
|
||||
*
|
||||
* @author none
|
||||
*/
|
||||
@Documented
|
||||
@Target({ElementType.TYPE})
|
||||
|
@ -39,8 +38,5 @@ import java.lang.annotation.Target;
|
|||
@Inherited
|
||||
public @interface Tags {
|
||||
|
||||
/**
|
||||
* @return all tag values associated with the given processor
|
||||
*/
|
||||
public String[] value();
|
||||
}
|
||||
|
|
|
@ -25,24 +25,24 @@ import java.lang.annotation.Target;
|
|||
|
||||
/**
|
||||
* <p>
|
||||
* Marker annotation a {@link org.apache.nifi.processor.Processor Processor},
|
||||
* Marker annotation a {@link org.apache.nifi.processor.Processor Processor},
|
||||
* {@link org.apache.nifi.controller.ControllerService ControllerService}, or
|
||||
* {@link org.apache.nifi.reporting.ReportingTask ReportingTask}
|
||||
* implementation can use to indicate a method
|
||||
* should be called whenever the component is added to the flow. This method
|
||||
* will be called once for the entire life of a component instance.
|
||||
* {@link org.apache.nifi.reporting.ReportingTask ReportingTask} implementation
|
||||
* can use to indicate a method should be called whenever the component is added
|
||||
* to the flow. This method will be called once for the entire life of a
|
||||
* component instance.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Methods with this annotation are called without any arguments, as all settings
|
||||
* and properties can be assumed to be the defaults.
|
||||
* Methods with this annotation are called without any arguments, as all
|
||||
* settings and properties can be assumed to be the defaults.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* If any method annotated with this annotation throws a Throwable, the component
|
||||
* will not be added to the flow.
|
||||
* If any method annotated with this annotation throws a Throwable, the
|
||||
* component will not be added to the flow.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @author none
|
||||
*/
|
||||
@Documented
|
||||
|
|
|
@ -27,26 +27,29 @@ import org.apache.nifi.controller.ConfigurationContext;
|
|||
|
||||
/**
|
||||
* <p>
|
||||
* Marker annotation a {@link org.apache.nifi.controller.ControllerService ControllerService}
|
||||
* can use to indicate a method should be called whenever the service is disabled.
|
||||
*</p>
|
||||
* Marker annotation a
|
||||
* {@link org.apache.nifi.controller.ControllerService ControllerService} can
|
||||
* use to indicate a method should be called whenever the service is disabled.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* Methods using this annotation are permitted to take zero arguments or to take a single
|
||||
* argument of type {@link ConfigurationContext}. If a method with this annotation
|
||||
* throws a Throwable, a log message and bulletin will be issued for the service, and the
|
||||
* service will remain in a 'DISABLING' state. When this occurs, the method with this annotation
|
||||
* will be called again after some period of time. This will continue until the method returns
|
||||
* without throwing any Throwable. Until that time, the service will remain in a 'DISABLING' state
|
||||
* and cannot be enabled again.
|
||||
* Methods using this annotation are permitted to take zero arguments or to take
|
||||
* a single argument of type {@link ConfigurationContext}. If a method with this
|
||||
* annotation throws a Throwable, a log message and bulletin will be issued for
|
||||
* the service, and the service will remain in a 'DISABLING' state. When this
|
||||
* occurs, the method with this annotation will be called again after some
|
||||
* period of time. This will continue until the method returns without throwing
|
||||
* any Throwable. Until that time, the service will remain in a 'DISABLING'
|
||||
* state and cannot be enabled again.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Note that this annotation will be ignored if applied to a ReportingTask or Processor. For a Controller
|
||||
* Service, enabling and disabling are considered lifecycle events, as the action makes them usable or
|
||||
* unusable by other components. However, for a Processor and a Reporting
|
||||
* Task, these are not lifecycle events but rather a mechanism to allow a component to be excluded when
|
||||
* starting or stopping a group of components.
|
||||
* Note that this annotation will be ignored if applied to a ReportingTask or
|
||||
* Processor. For a Controller Service, enabling and disabling are considered
|
||||
* lifecycle events, as the action makes them usable or unusable by other
|
||||
* components. However, for a Processor and a Reporting Task, these are not
|
||||
* lifecycle events but rather a mechanism to allow a component to be excluded
|
||||
* when starting or stopping a group of components.
|
||||
* </p>
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -25,35 +25,40 @@ import java.lang.annotation.Target;
|
|||
|
||||
/**
|
||||
* <p>
|
||||
* Marker annotation a {@link org.apache.nifi.controller.ControllerService ControllerService}
|
||||
* can use to indicate a method should be called whenever the service is enabled.
|
||||
* Any method that has this annotation will be called every time a user enables the service.
|
||||
* Additionally, each time that NiFi is restarted, if NiFi is configured to "auto-resume state"
|
||||
* and the service is enabled, the method will be invoked.
|
||||
* Marker annotation a
|
||||
* {@link org.apache.nifi.controller.ControllerService ControllerService} can
|
||||
* use to indicate a method should be called whenever the service is enabled.
|
||||
* Any method that has this annotation will be called every time a user enables
|
||||
* the service. Additionally, each time that NiFi is restarted, if NiFi is
|
||||
* configured to "auto-resume state" and the service is enabled, the method will
|
||||
* be invoked.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* Methods using this annotation must take either 0 arguments or a single argument of type
|
||||
* Methods using this annotation must take either 0 arguments or a single
|
||||
* argument of type
|
||||
* {@link org.apache.nifi.controller.ConfigurationContext ConfigurationContext}.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* If a method with this annotation throws a Throwable, a log message and bulletin will be issued
|
||||
* for the component. In this event, the service will remain in an 'ENABLING' state and will not be
|
||||
* usable. All methods with this annotation will then be called again after a delay. The service will
|
||||
* not be made available for use until all methods with this annotation have returned without throwing
|
||||
* anything.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* Note that this annotation will be ignored if applied to a ReportingTask or Processor. For a Controller
|
||||
* Service, enabling and disabling are considered lifecycle events, as the action makes them usable or
|
||||
* unusable by other components. However, for a Processor and a Reporting
|
||||
* Task, these are not lifecycle events but rather a mechanism to allow a component to be excluded when
|
||||
* starting or stopping a group of components.
|
||||
* If a method with this annotation throws a Throwable, a log message and
|
||||
* bulletin will be issued for the component. In this event, the service will
|
||||
* remain in an 'ENABLING' state and will not be usable. All methods with this
|
||||
* annotation will then be called again after a delay. The service will not be
|
||||
* made available for use until all methods with this annotation have returned
|
||||
* without throwing anything.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Note that this annotation will be ignored if applied to a ReportingTask or
|
||||
* Processor. For a Controller Service, enabling and disabling are considered
|
||||
* lifecycle events, as the action makes them usable or unusable by other
|
||||
* components. However, for a Processor and a Reporting Task, these are not
|
||||
* lifecycle events but rather a mechanism to allow a component to be excluded
|
||||
* when starting or stopping a group of components.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Documented
|
||||
@Target({ElementType.METHOD})
|
||||
|
|
|
@ -28,23 +28,24 @@ import org.apache.nifi.processor.ProcessContext;
|
|||
|
||||
/**
|
||||
* <p>
|
||||
* Marker annotation a {@link org.apache.nifi.processor.Processor Processor},
|
||||
* Marker annotation a {@link org.apache.nifi.processor.Processor Processor},
|
||||
* {@link org.apache.nifi.controller.ControllerService ControllerService}, or
|
||||
* {@link org.apache.nifi.reporting.ReportingTask ReportingTask} implementation
|
||||
* can use to indicate a method should be called whenever the component is removed
|
||||
* from the flow. This method will be called once for the entire life of a
|
||||
* component instance. If the method throw any Throwable, that Throwable will be
|
||||
* caught and logged but will not prevent subsequent methods with this annotation
|
||||
* or removal of the component from the flow.
|
||||
* {@link org.apache.nifi.reporting.ReportingTask ReportingTask} implementation
|
||||
* can use to indicate a method should be called whenever the component is
|
||||
* removed from the flow. This method will be called once for the entire life of
|
||||
* a component instance. If the method throw any Throwable, that Throwable will
|
||||
* be caught and logged but will not prevent subsequent methods with this
|
||||
* annotation or removal of the component from the flow.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Methods with this annotation are permitted to take no arguments or to take a single
|
||||
* argument. If using a single argument, that argument must be of type {@link ConfigurationContext}
|
||||
* if the component is a ReportingTask or a ControllerService. If the component is a Processor,
|
||||
* then the argument must be of type {@link ProcessContext}.
|
||||
* Methods with this annotation are permitted to take no arguments or to take a
|
||||
* single argument. If using a single argument, that argument must be of type
|
||||
* {@link ConfigurationContext} if the component is a ReportingTask or a
|
||||
* ControllerService. If the component is a Processor, then the argument must be
|
||||
* of type {@link ProcessContext}.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @author none
|
||||
*/
|
||||
@Documented
|
||||
|
|
|
@ -25,32 +25,38 @@ import java.lang.annotation.Target;
|
|||
|
||||
/**
|
||||
* <p>
|
||||
* Marker annotation a {@link org.apache.nifi.processor.Processor Processor} or
|
||||
* {@link org.apache.nifi.reporting.ReportingTask ReportingTask} implementation
|
||||
* can use to indicate a method should be called whenever the component is scheduled
|
||||
* to run. This will be called before any call to 'onTrigger' and will be called once each time
|
||||
* a Processor or Reporting Task is scheduled to run. This occurs in one of two ways: either
|
||||
* a user clicks to schedule the component to run, or NiFi is restarted with the "auto-resume state"
|
||||
* configuration set to true (the default value) and the component is already running.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* Methods using this annotation must take either 0 arguments or a single argument.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* If using 1 argument and the component using the annotation is a Processor, that argument must
|
||||
* be of type {@link org.apache.nifi.processor.ProcessContext ProcessContext}.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* If using 1 argument and the component using the annotation is a Reporting Task, that argument must
|
||||
* be of type {@link org.apache.nifi.controller.ConfigurationContext ConfigurationContext}.
|
||||
* Marker annotation a {@link org.apache.nifi.processor.Processor Processor} or
|
||||
* {@link org.apache.nifi.reporting.ReportingTask ReportingTask} implementation
|
||||
* can use to indicate a method should be called whenever the component is
|
||||
* scheduled to run. This will be called before any call to 'onTrigger' and will
|
||||
* be called once each time a Processor or Reporting Task is scheduled to run.
|
||||
* This occurs in one of two ways: either a user clicks to schedule the
|
||||
* component to run, or NiFi is restarted with the "auto-resume state"
|
||||
* configuration set to true (the default value) and the component is already
|
||||
* running.
|
||||
* </p>
|
||||
*
|
||||
* If any method annotated with this annotation throws any Throwable, the framework will wait a while
|
||||
* and then attempt to invoke the method again. This will continue until the method succeeds, and the
|
||||
* component will then be scheduled to run after this method return successfully.
|
||||
* <p>
|
||||
* Methods using this annotation must take either 0 arguments or a single
|
||||
* argument.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* If using 1 argument and the component using the annotation is a Processor,
|
||||
* that argument must be of type
|
||||
* {@link org.apache.nifi.processor.ProcessContext ProcessContext}.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* If using 1 argument and the component using the annotation is a Reporting
|
||||
* Task, that argument must be of type
|
||||
* {@link org.apache.nifi.controller.ConfigurationContext ConfigurationContext}.
|
||||
* </p>
|
||||
*
|
||||
* If any method annotated with this annotation throws any Throwable, the
|
||||
* framework will wait a while and then attempt to invoke the method again. This
|
||||
* will continue until the method succeeds, and the component will then be
|
||||
* scheduled to run after this method return successfully.
|
||||
*
|
||||
* @author none
|
||||
*/
|
||||
|
|
|
@ -28,21 +28,22 @@ import org.apache.nifi.processor.ProcessContext;
|
|||
|
||||
/**
|
||||
* <p>
|
||||
* Marker annotation a {@link org.apache.nifi.processor.Processor Processor},
|
||||
* Marker annotation a {@link org.apache.nifi.processor.Processor Processor},
|
||||
* {@link org.apache.nifi.controller.ControllerService ControllerService}, or
|
||||
* {@link org.apache.nifi.reporting.ReportingTask ReportingTask} implementation
|
||||
* can use to indicate a method should be called whenever the flow is being shutdown.
|
||||
* This will be called at most once for each component in a JVM lifetime.
|
||||
* It is not, however, guaranteed that this method will be called on shutdown, as
|
||||
* the service may be killed suddenly.
|
||||
* {@link org.apache.nifi.reporting.ReportingTask ReportingTask} implementation
|
||||
* can use to indicate a method should be called whenever the flow is being
|
||||
* shutdown. This will be called at most once for each component in a JVM
|
||||
* lifetime. It is not, however, guaranteed that this method will be called on
|
||||
* shutdown, as the service may be killed suddenly.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Methods with this annotation are permitted to take either 0 or 1 argument. If an argument
|
||||
* is used, it must be of type {@link ConfigurationContext} if the component is a ReportingTask
|
||||
* or Controller Service, or of type {@link ProcessContext} if the component is a Processor.
|
||||
* Methods with this annotation are permitted to take either 0 or 1 argument. If
|
||||
* an argument is used, it must be of type {@link ConfigurationContext} if the
|
||||
* component is a ReportingTask or Controller Service, or of type
|
||||
* {@link ProcessContext} if the component is a Processor.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @author none
|
||||
*/
|
||||
@Documented
|
||||
|
|
|
@ -29,12 +29,11 @@ import org.apache.nifi.processor.ProcessContext;
|
|||
/**
|
||||
* <p>
|
||||
* Marker annotation a {@link org.apache.nifi.processor.Processor Processor} or
|
||||
* {@link org.apache.nifi.reporting.ReportingTask ReportingTask}
|
||||
* implementation can use to indicate that a method
|
||||
* should be called whenever the component is no longer scheduled to run.
|
||||
* Methods marked with this annotation will be invoked each time the component
|
||||
* is stopped and will be invoked only after the last thread has returned from
|
||||
* the <code>onTrigger</code> method.
|
||||
* {@link org.apache.nifi.reporting.ReportingTask ReportingTask} implementation
|
||||
* can use to indicate that a method should be called whenever the component is
|
||||
* no longer scheduled to run. Methods marked with this annotation will be
|
||||
* invoked each time the component is stopped and will be invoked only after the
|
||||
* last thread has returned from the <code>onTrigger</code> method.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
|
@ -47,14 +46,15 @@ import org.apache.nifi.processor.ProcessContext;
|
|||
*
|
||||
* <p>
|
||||
* To indicate that a method should be called immediately when a component is no
|
||||
* longer scheduled to run (as opposed to after all threads have returned from the
|
||||
* <code>onTrigger</code> method), see the {@link OnUnscheduled} annotation.
|
||||
* longer scheduled to run (as opposed to after all threads have returned from
|
||||
* the <code>onTrigger</code> method), see the {@link OnUnscheduled} annotation.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Methods with this annotation are permitted to take either 0 or 1 argument. If an argument
|
||||
* is used, it must be of type {@link ConfigurationContext} if the component is a ReportingTask
|
||||
* or of type {@link ProcessContext} if the component is a Processor.
|
||||
* Methods with this annotation are permitted to take either 0 or 1 argument. If
|
||||
* an argument is used, it must be of type {@link ConfigurationContext} if the
|
||||
* component is a ReportingTask or of type {@link ProcessContext} if the
|
||||
* component is a Processor.
|
||||
* </p>
|
||||
*
|
||||
* @author none
|
||||
|
|
|
@ -26,26 +26,29 @@ import java.lang.annotation.Target;
|
|||
/**
|
||||
* <p>
|
||||
* Marker annotation a {@link org.apache.nifi.processor.Processor Processor} or
|
||||
* {@link org.apache.nifi.reporting.ReportingTask ReportingTask}
|
||||
* should be called whenever the component is no longer scheduled to run.
|
||||
* Methods marked with this annotation will be invoked each time the framework
|
||||
* is notified to stop scheduling the component. This method is invoked as other
|
||||
* threads are potentially running. To invoke a method after all threads have
|
||||
* finished processing, see the {@link OnStopped} annotation.
|
||||
* {@link org.apache.nifi.reporting.ReportingTask ReportingTask} should be
|
||||
* called whenever the component is no longer scheduled to run. Methods marked
|
||||
* with this annotation will be invoked each time the framework is notified to
|
||||
* stop scheduling the component. This method is invoked as other threads are
|
||||
* potentially running. To invoke a method after all threads have finished
|
||||
* processing, see the {@link OnStopped} annotation.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Methods using this annotation must take either 0 arguments or a single argument.
|
||||
* Methods using this annotation must take either 0 arguments or a single
|
||||
* argument.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* If using 1 argument and the component using the annotation is a Processor, that argument must
|
||||
* be of type {@link org.apache.nifi.processor.ProcessContext ProcessContext}.
|
||||
* If using 1 argument and the component using the annotation is a Processor,
|
||||
* that argument must be of type
|
||||
* {@link org.apache.nifi.processor.ProcessContext ProcessContext}.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* If using 1 argument and the component using the annotation is a Reporting Task, that argument must
|
||||
* be of type {@link org.apache.nifi.controller.ConfigurationContext ConfigurationContext}.
|
||||
* If using 1 argument and the component using the annotation is a Reporting
|
||||
* Task, that argument must be of type
|
||||
* {@link org.apache.nifi.controller.ConfigurationContext ConfigurationContext}.
|
||||
* </p>
|
||||
*/
|
||||
@Documented
|
||||
|
|
|
@ -34,11 +34,9 @@ public enum Authority {
|
|||
ROLE_NIFI;
|
||||
|
||||
/**
|
||||
* Returns the matching role or null if the specified role does not match
|
||||
* any roles.
|
||||
*
|
||||
* @param rawAuthority
|
||||
* @return
|
||||
* @param rawAuthority string form of authority
|
||||
* @return the matching role or null if the specified role does not match
|
||||
* any roles
|
||||
*/
|
||||
public static Authority valueOfAuthority(String rawAuthority) {
|
||||
Authority desiredAuthority = null;
|
||||
|
@ -54,9 +52,7 @@ public enum Authority {
|
|||
}
|
||||
|
||||
/**
|
||||
* Gets the string value of each authority.
|
||||
*
|
||||
* @return
|
||||
* @return the string value of each authority
|
||||
*/
|
||||
public static Set<String> getRawAuthorities() {
|
||||
Set<String> authorities = new LinkedHashSet<>();
|
||||
|
|
|
@ -31,11 +31,9 @@ import org.apache.nifi.authorization.exception.UnknownIdentityException;
|
|||
public interface AuthorityProvider {
|
||||
|
||||
/**
|
||||
* Returns whether the user with the specified DN is known to this authority
|
||||
* provider. It is not necessary for the user to have any authorities.
|
||||
*
|
||||
* @param dn
|
||||
* @return
|
||||
* @param dn of the user
|
||||
* @return whether the user with the specified DN is known to this authority
|
||||
* provider. It is not necessary for the user to have any authorities
|
||||
*/
|
||||
boolean doesDnExist(String dn) throws AuthorityAccessException;
|
||||
|
||||
|
@ -43,29 +41,30 @@ public interface AuthorityProvider {
|
|||
* Get the authorities for the specified user. If the specified user exists
|
||||
* but does not have any authorities, an empty set should be returned.
|
||||
*
|
||||
* @param dn
|
||||
* @return
|
||||
* @throws UnknownIdentityException
|
||||
* @throws AuthorityAccessException
|
||||
* @param dn of the user to lookup
|
||||
* @return the authorities for the specified user. If the specified user
|
||||
* exists but does not have any authorities, an empty set should be returned
|
||||
* @throws UnknownIdentityException if identity is not known
|
||||
* @throws AuthorityAccessException if unable to access authorities
|
||||
*/
|
||||
Set<Authority> getAuthorities(String dn) throws UnknownIdentityException, AuthorityAccessException;
|
||||
|
||||
/**
|
||||
* Sets the specified authorities for the specified user.
|
||||
*
|
||||
* @param dn
|
||||
* @param authorities
|
||||
* @throws UnknownIdentityException
|
||||
* @throws AuthorityAccessException
|
||||
* @param dn the specified user
|
||||
* @param authorities the new authorities for the user
|
||||
* @throws UnknownIdentityException if identity is not known
|
||||
* @throws AuthorityAccessException if unable to access authorities
|
||||
*/
|
||||
void setAuthorities(String dn, Set<Authority> authorities) throws UnknownIdentityException, AuthorityAccessException;
|
||||
|
||||
/**
|
||||
* Gets the users for the specified authority.
|
||||
*
|
||||
* @param authority
|
||||
* @return
|
||||
* @throws AuthorityAccessException
|
||||
* @param authority for which to determine membership of
|
||||
* @return all users with the specified authority
|
||||
* @throws AuthorityAccessException if unable to access authorities
|
||||
*/
|
||||
Set<String> getUsers(Authority authority) throws AuthorityAccessException;
|
||||
|
||||
|
@ -73,19 +72,19 @@ public interface AuthorityProvider {
|
|||
* Revokes the specified user. Its up to the implementor to determine the
|
||||
* semantics of revocation.
|
||||
*
|
||||
* @param dn
|
||||
* @throws UnknownIdentityException
|
||||
* @throws AuthorityAccessException
|
||||
* @param dn the dn of the user
|
||||
* @throws UnknownIdentityException if the user is not known
|
||||
* @throws AuthorityAccessException if unable to access the authorities
|
||||
*/
|
||||
void revokeUser(String dn) throws UnknownIdentityException, AuthorityAccessException;
|
||||
|
||||
/**
|
||||
* Add the specified user.
|
||||
*
|
||||
* @param dn
|
||||
* @param dn of the user
|
||||
* @param group Optional
|
||||
* @throws IdentityAlreadyExistsException
|
||||
* @throws AuthorityAccessException
|
||||
* @throws UnknownIdentityException if the user is not known
|
||||
* @throws AuthorityAccessException if unable to access the authorities
|
||||
*/
|
||||
void addUser(String dn, String group) throws IdentityAlreadyExistsException, AuthorityAccessException;
|
||||
|
||||
|
@ -93,10 +92,10 @@ public interface AuthorityProvider {
|
|||
* Gets the group for the specified user. Return null if the user does not
|
||||
* belong to a group.
|
||||
*
|
||||
* @param dn
|
||||
* @return
|
||||
* @throws UnknownIdentityException
|
||||
* @throws AuthorityAccessException
|
||||
* @param dn the user
|
||||
* @return the group of the given user
|
||||
* @throws UnknownIdentityException if the user is not known
|
||||
* @throws AuthorityAccessException if unable to access the authorities
|
||||
*/
|
||||
String getGroupForUser(String dn) throws UnknownIdentityException, AuthorityAccessException;
|
||||
|
||||
|
@ -104,26 +103,28 @@ public interface AuthorityProvider {
|
|||
* Revokes all users for a specified group. Its up to the implementor to
|
||||
* determine the semantics of revocation.
|
||||
*
|
||||
* @param group
|
||||
* @throws AuthorityAccessException
|
||||
* @param group to revoke the users of
|
||||
* @throws UnknownIdentityException if the user is not known
|
||||
* @throws AuthorityAccessException if unable to access the authorities
|
||||
*/
|
||||
void revokeGroup(String group) throws UnknownIdentityException, AuthorityAccessException;
|
||||
|
||||
/**
|
||||
* Adds the specified users to the specified group.
|
||||
*
|
||||
* @param dn
|
||||
* @param group
|
||||
* @throws AuthorityAccessException
|
||||
* @param dn the set of users to add to the group
|
||||
* @param group to add users to
|
||||
* @throws UnknownIdentityException if the user is not known
|
||||
* @throws AuthorityAccessException if unable to access the authorities
|
||||
*/
|
||||
void setUsersGroup(Set<String> dn, String group) throws UnknownIdentityException, AuthorityAccessException;
|
||||
|
||||
/**
|
||||
* Ungroups the specified user.
|
||||
*
|
||||
* @param dn
|
||||
* @throws UnknownIdentityException
|
||||
* @throws AuthorityAccessException
|
||||
* @param dn of the user
|
||||
* @throws UnknownIdentityException if the user is not known
|
||||
* @throws AuthorityAccessException if unable to access the authorities
|
||||
*/
|
||||
void ungroupUser(String dn) throws UnknownIdentityException, AuthorityAccessException;
|
||||
|
||||
|
@ -133,41 +134,41 @@ public interface AuthorityProvider {
|
|||
* does not exist. If an admin revoked this group before calling ungroup, it
|
||||
* may or may not exist.
|
||||
*
|
||||
* @param group
|
||||
* @throws AuthorityAccessException
|
||||
* @param group to ungroup
|
||||
* @throws AuthorityAccessException if unable to access the authorities
|
||||
*/
|
||||
void ungroup(String group) throws AuthorityAccessException;
|
||||
|
||||
/**
|
||||
* Determines whether the user in the specified dnChain should be able to
|
||||
* Determines whether the user in the specified dnChain should be able to
|
||||
* download the content for the flowfile with the specified attributes.
|
||||
*
|
||||
* The first dn in the chain is the end user that the request was issued on
|
||||
*
|
||||
* The first dn in the chain is the end user that the request was issued on
|
||||
* behalf of. The subsequent dn's in the chain represent entities proxying
|
||||
* the user's request with the last being the proxy that sent the current
|
||||
* request.
|
||||
*
|
||||
* @param dnChain
|
||||
* @param attributes
|
||||
* @return
|
||||
* @throws UnknownIdentityException
|
||||
* @throws AuthorityAccessException
|
||||
*
|
||||
* @param dnChain of the user
|
||||
* @param attributes of the flowfile being requested
|
||||
* @return the authorization result
|
||||
* @throws UnknownIdentityException if the user is not known
|
||||
* @throws AuthorityAccessException if unable to access the authorities
|
||||
*/
|
||||
DownloadAuthorization authorizeDownload(List<String> dnChain, Map<String, String> attributes) throws UnknownIdentityException, AuthorityAccessException;
|
||||
|
||||
|
||||
/**
|
||||
* Called immediately after instance creation for implementers to perform
|
||||
* additional setup
|
||||
*
|
||||
* @param initializationContext
|
||||
* @param initializationContext in which to initialize
|
||||
*/
|
||||
void initialize(AuthorityProviderInitializationContext initializationContext) throws ProviderCreationException;
|
||||
|
||||
/**
|
||||
* Called to configure the AuthorityProvider.
|
||||
*
|
||||
* @param configurationContext
|
||||
* @throws ProviderCreationException
|
||||
* @param configurationContext at the time of configuration
|
||||
* @throws ProviderCreationException for any issues configuring the provider
|
||||
*/
|
||||
void onConfigured(AuthorityProviderConfigurationContext configurationContext) throws ProviderCreationException;
|
||||
|
||||
|
|
|
@ -24,9 +24,7 @@ import java.util.Map;
|
|||
public interface AuthorityProviderConfigurationContext {
|
||||
|
||||
/**
|
||||
* The identifier for the authority provider.
|
||||
*
|
||||
* @return
|
||||
* @return identifier for the authority provider
|
||||
*/
|
||||
String getIdentifier();
|
||||
|
||||
|
@ -41,12 +39,10 @@ public interface AuthorityProviderConfigurationContext {
|
|||
Map<String, String> getProperties();
|
||||
|
||||
/**
|
||||
* Retrieves the value the component currently understands for the given
|
||||
* @param property to lookup the descriptor and value of
|
||||
* @return the value the component currently understands for the given
|
||||
* PropertyDescriptor. This method does not substitute default
|
||||
* PropertyDescriptor values, so the value returned will be null if not set.
|
||||
*
|
||||
* @param property
|
||||
* @return
|
||||
* PropertyDescriptor values, so the value returned will be null if not set
|
||||
*/
|
||||
String getProperty(String property);
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ package org.apache.nifi.authorization;
|
|||
public class DownloadAuthorization {
|
||||
|
||||
private static enum Result {
|
||||
|
||||
Approved,
|
||||
Denied;
|
||||
};
|
||||
|
@ -32,10 +33,11 @@ public class DownloadAuthorization {
|
|||
private final String explanation;
|
||||
|
||||
/**
|
||||
* Creates a new DownloadAuthorization with the specified result and explanation.
|
||||
*
|
||||
* @param result
|
||||
* @param explanation
|
||||
* Creates a new DownloadAuthorization with the specified result and
|
||||
* explanation.
|
||||
*
|
||||
* @param result of the authorization
|
||||
* @param explanation for the authorization attempt
|
||||
*/
|
||||
private DownloadAuthorization(Result result, String explanation) {
|
||||
if (Result.Denied.equals(result) && explanation == null) {
|
||||
|
@ -47,38 +49,33 @@ public class DownloadAuthorization {
|
|||
}
|
||||
|
||||
/**
|
||||
* Whether or not the download request is approved.
|
||||
*
|
||||
* @return
|
||||
* @return Whether or not the download request is approved
|
||||
*/
|
||||
public boolean isApproved() {
|
||||
return Result.Approved.equals(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* If the download request is denied, the reason why. Null otherwise.
|
||||
*
|
||||
* @return
|
||||
* @return If the download request is denied, the reason why. Null otherwise
|
||||
*/
|
||||
public String getExplanation() {
|
||||
return explanation;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new approved DownloadAuthorization.
|
||||
*
|
||||
* @return
|
||||
* @return a new approved DownloadAuthorization
|
||||
*/
|
||||
public static DownloadAuthorization approved() {
|
||||
return APPROVED;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new denied DownloadAuthorization with the specified explanation.
|
||||
*
|
||||
* @param explanation
|
||||
* @return
|
||||
* @throws IllegalArgumentException if explanation is null
|
||||
* Creates a new denied DownloadAuthorization with the specified
|
||||
* explanation.
|
||||
*
|
||||
* @param explanation for why it was denied
|
||||
* @return a new denied DownloadAuthorization with the specified explanation
|
||||
* @throws IllegalArgumentException if explanation is null
|
||||
*/
|
||||
public static DownloadAuthorization denied(String explanation) {
|
||||
return new DownloadAuthorization(Result.Denied, explanation);
|
||||
|
|
|
@ -46,11 +46,9 @@ public abstract class AbstractConfigurableComponent implements ConfigurableCompo
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns a PropertyDescriptor for the name specified that is fully
|
||||
* @param descriptorName to lookup the descriptor
|
||||
* @return a PropertyDescriptor for the name specified that is fully
|
||||
* populated
|
||||
*
|
||||
* @param descriptorName
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public final PropertyDescriptor getPropertyDescriptor(final String descriptorName) {
|
||||
|
@ -141,11 +139,12 @@ public abstract class AbstractConfigurableComponent implements ConfigurableCompo
|
|||
* method a processor may simply get the latest value whenever it needs it
|
||||
* and if necessary lazily evaluate it.
|
||||
*
|
||||
* @param descriptor
|
||||
* @param descriptor of the modified property
|
||||
* @param oldValue non-null property value (previous)
|
||||
* @param newValue the new property value or if null indicates the property
|
||||
* was removed
|
||||
*/
|
||||
@Override
|
||||
public void onPropertyModified(final PropertyDescriptor descriptor, final String oldValue, final String newValue) {
|
||||
}
|
||||
|
||||
|
@ -168,7 +167,7 @@ public abstract class AbstractConfigurableComponent implements ConfigurableCompo
|
|||
* <p>
|
||||
* Default is null.
|
||||
*
|
||||
* @param propertyDescriptorName
|
||||
* @param propertyDescriptorName used to lookup if any property descriptors exist for that name
|
||||
* @return new property descriptor if supported
|
||||
*/
|
||||
protected PropertyDescriptor getSupportedDynamicPropertyDescriptor(final String propertyDescriptorName) {
|
||||
|
@ -186,9 +185,10 @@ public abstract class AbstractConfigurableComponent implements ConfigurableCompo
|
|||
return Collections.EMPTY_LIST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final List<PropertyDescriptor> getPropertyDescriptors() {
|
||||
final List<PropertyDescriptor> supported = getSupportedPropertyDescriptors();
|
||||
return supported == null ? Collections.<PropertyDescriptor>emptyList() :new ArrayList<>(supported);
|
||||
return supported == null ? Collections.<PropertyDescriptor>emptyList() : new ArrayList<>(supported);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -33,7 +33,7 @@ public class AllowableValue {
|
|||
* Constructs a new AllowableValue with the given value and and the same
|
||||
* display name and no description.
|
||||
*
|
||||
* @param value
|
||||
* @param value that is allowed
|
||||
*/
|
||||
public AllowableValue(final String value) {
|
||||
this(value, value);
|
||||
|
@ -43,8 +43,8 @@ public class AllowableValue {
|
|||
* Constructs a new AllowableValue with the given value and display name and
|
||||
* no description
|
||||
*
|
||||
* @param value
|
||||
* @param displayName
|
||||
* @param value that is allowed
|
||||
* @param displayName to display for the value
|
||||
*
|
||||
* @throws NullPointerException if either argument is null
|
||||
*/
|
||||
|
@ -56,9 +56,9 @@ public class AllowableValue {
|
|||
* Constructs a new AllowableValue with the given value, display name, and
|
||||
* description
|
||||
*
|
||||
* @param value
|
||||
* @param displayName
|
||||
* @param description
|
||||
* @param value that is valid
|
||||
* @param displayName to show for the value
|
||||
* @param description of the value
|
||||
*
|
||||
* @throws NullPointerException if identifier or value is null
|
||||
*/
|
||||
|
@ -69,40 +69,33 @@ public class AllowableValue {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the value of this AllowableValue
|
||||
*
|
||||
* @return
|
||||
* @return the value of this AllowableValue
|
||||
*/
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a human-readable name for this AllowableValue
|
||||
*
|
||||
* @return
|
||||
* @return a human-readable name for this AllowableValue
|
||||
*/
|
||||
public String getDisplayName() {
|
||||
return displayName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a description for this value, or <code>null</code> if no
|
||||
* @return a description for this value, or <code>null</code> if no
|
||||
* description was provided
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>this</code> is equal to <code>obj</code> of <code>obj</code> is the
|
||||
* @return true if <code>this</code> is equal to <code>obj</code> of <code>obj</code> is the
|
||||
* same object as <code>this</code> or if <code>obj</code> is an instance of
|
||||
* <code>AllowableValue</code> and both have the same value, or if
|
||||
* <code>obj</code> is a String and is equal to
|
||||
* {@link #getValue() this.getValue()}.
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(final Object obj) {
|
||||
|
@ -121,8 +114,7 @@ public class AllowableValue {
|
|||
}
|
||||
|
||||
/**
|
||||
* Hash Code is based solely off of the value
|
||||
* @return
|
||||
* @return based solely off of the value
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
|
|
|
@ -27,7 +27,7 @@ public interface ConfigurableComponent {
|
|||
* not included in the in the purposed configuration, the default value will
|
||||
* be used.
|
||||
*
|
||||
* @param context
|
||||
* @param context of validation
|
||||
* @return Collection of validation result objects for any invalid findings
|
||||
* only. If the collection is empty then the component is valid. Guaranteed
|
||||
* non-null
|
||||
|
@ -35,11 +35,9 @@ public interface ConfigurableComponent {
|
|||
Collection<ValidationResult> validate(ValidationContext context);
|
||||
|
||||
/**
|
||||
* Returns the PropertyDescriptor with the given name, if it exists;
|
||||
* otherwise, returns <code>null</code>.
|
||||
*
|
||||
* @param name
|
||||
* @return
|
||||
* @param name to lookup the descriptor
|
||||
* @return the PropertyDescriptor with the given name, if it exists;
|
||||
* otherwise, returns <code>null</code>
|
||||
*/
|
||||
PropertyDescriptor getPropertyDescriptor(String name);
|
||||
|
||||
|
@ -51,7 +49,7 @@ public interface ConfigurableComponent {
|
|||
* necessary lazily evaluate it. Any throwable that escapes this method will
|
||||
* simply be ignored.
|
||||
*
|
||||
* @param descriptor
|
||||
* @param descriptor the descriptor for the property being modified
|
||||
* @param oldValue the value that was previously set, or null if no value
|
||||
* was previously set for this property
|
||||
* @param newValue the new property value or if null indicates the property
|
||||
|
@ -68,10 +66,8 @@ public interface ConfigurableComponent {
|
|||
List<PropertyDescriptor> getPropertyDescriptors();
|
||||
|
||||
/**
|
||||
* Returns the unique identifier that the framework assigned to this
|
||||
* @return the unique identifier that the framework assigned to this
|
||||
* component
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String getIdentifier();
|
||||
}
|
||||
|
|
|
@ -29,7 +29,6 @@ import org.apache.nifi.controller.ControllerService;
|
|||
* An immutable object for holding information about a type of processor
|
||||
* property.
|
||||
*
|
||||
* @author unattributed
|
||||
*/
|
||||
public final class PropertyDescriptor implements Comparable<PropertyDescriptor> {
|
||||
|
||||
|
@ -121,9 +120,9 @@ public final class PropertyDescriptor implements Comparable<PropertyDescriptor>
|
|||
* If this descriptor has a set of allowable values then the given value is
|
||||
* only checked against the allowable values.
|
||||
*
|
||||
* @param input
|
||||
* @param context
|
||||
* @return
|
||||
* @param input the value to validate
|
||||
* @param context the context of validation
|
||||
* @return the result of validating the input
|
||||
*/
|
||||
public ValidationResult validate(final String input, final ValidationContext context) {
|
||||
ValidationResult lastResult = Validator.INVALID.validate(this.name, input, context);
|
||||
|
@ -142,17 +141,17 @@ public final class PropertyDescriptor implements Comparable<PropertyDescriptor>
|
|||
final Set<String> validIdentifiers = context.getControllerServiceLookup().getControllerServiceIdentifiers(controllerServiceDefinition);
|
||||
if (validIdentifiers != null && validIdentifiers.contains(input)) {
|
||||
final ControllerService controllerService = context.getControllerServiceLookup().getControllerService(input);
|
||||
if ( !context.isValidationRequired(controllerService) ) {
|
||||
if (!context.isValidationRequired(controllerService)) {
|
||||
return new ValidationResult.Builder()
|
||||
.input(input)
|
||||
.subject(getName())
|
||||
.valid(true)
|
||||
.build();
|
||||
.input(input)
|
||||
.subject(getName())
|
||||
.valid(true)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
final String serviceId = controllerService.getIdentifier();
|
||||
if (!context.getControllerServiceLookup().isControllerServiceEnabled(serviceId) &&
|
||||
!context.getControllerServiceLookup().isControllerServiceEnabling(serviceId)) {
|
||||
if (!context.getControllerServiceLookup().isControllerServiceEnabled(serviceId)
|
||||
&& !context.getControllerServiceLookup().isControllerServiceEnabling(serviceId)) {
|
||||
return new ValidationResult.Builder()
|
||||
.input(context.getControllerServiceLookup().getControllerServiceName(serviceId))
|
||||
.subject(getName())
|
||||
|
@ -235,8 +234,8 @@ public final class PropertyDescriptor implements Comparable<PropertyDescriptor>
|
|||
* This is beneficial because it allows a User Interface to represent
|
||||
* the name differently.
|
||||
*
|
||||
* @param displayName
|
||||
* @return
|
||||
* @param displayName of the property
|
||||
* @return the builder
|
||||
*/
|
||||
public Builder displayName(final String displayName) {
|
||||
if (null != displayName) {
|
||||
|
@ -249,8 +248,8 @@ public final class PropertyDescriptor implements Comparable<PropertyDescriptor>
|
|||
/**
|
||||
* Sets the property name.
|
||||
*
|
||||
* @param name
|
||||
* @return
|
||||
* @param name of the property
|
||||
* @return the builder
|
||||
*/
|
||||
public Builder name(final String name) {
|
||||
if (null != name) {
|
||||
|
@ -263,8 +262,8 @@ public final class PropertyDescriptor implements Comparable<PropertyDescriptor>
|
|||
* Sets the value indicating whether or not this Property will support
|
||||
* the Attribute Expression Language.
|
||||
*
|
||||
* @param supported
|
||||
* @return
|
||||
* @param supported true if yes; false otherwise
|
||||
* @return the builder
|
||||
*/
|
||||
public Builder expressionLanguageSupported(final boolean supported) {
|
||||
this.expressionLanguageSupported = supported;
|
||||
|
@ -272,9 +271,8 @@ public final class PropertyDescriptor implements Comparable<PropertyDescriptor>
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param description
|
||||
* @return
|
||||
* @param description of the property
|
||||
* @return the builder
|
||||
*/
|
||||
public Builder description(final String description) {
|
||||
if (null != description) {
|
||||
|
@ -294,8 +292,8 @@ public final class PropertyDescriptor implements Comparable<PropertyDescriptor>
|
|||
* should be set to the "Value" of the {@link AllowableValue} object
|
||||
* (see {@link AllowableValue#getValue()}).
|
||||
*
|
||||
* @param value
|
||||
* @return
|
||||
* @param value default value
|
||||
* @return the builder
|
||||
*/
|
||||
public Builder defaultValue(final String value) {
|
||||
if (null != value) {
|
||||
|
@ -310,9 +308,8 @@ public final class PropertyDescriptor implements Comparable<PropertyDescriptor>
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param values
|
||||
* @return
|
||||
* @param values contrained set of values
|
||||
* @return the builder
|
||||
*/
|
||||
public Builder allowableValues(final Set<String> values) {
|
||||
if (null != values) {
|
||||
|
@ -336,9 +333,8 @@ public final class PropertyDescriptor implements Comparable<PropertyDescriptor>
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param values
|
||||
* @return
|
||||
* @param values constrained set of values
|
||||
* @return the builder
|
||||
*/
|
||||
public Builder allowableValues(final String... values) {
|
||||
if (null != values) {
|
||||
|
@ -353,8 +349,8 @@ public final class PropertyDescriptor implements Comparable<PropertyDescriptor>
|
|||
/**
|
||||
* Sets the Allowable Values for this Property
|
||||
*
|
||||
* @param values
|
||||
* @return
|
||||
* @param values contrained set of values
|
||||
* @return the builder
|
||||
*/
|
||||
public Builder allowableValues(final AllowableValue... values) {
|
||||
if (null != values) {
|
||||
|
@ -364,9 +360,8 @@ public final class PropertyDescriptor implements Comparable<PropertyDescriptor>
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param required
|
||||
* @return
|
||||
* @param required true if yes; false otherwise
|
||||
* @return the builder
|
||||
*/
|
||||
public Builder required(final boolean required) {
|
||||
this.required = required;
|
||||
|
@ -374,9 +369,8 @@ public final class PropertyDescriptor implements Comparable<PropertyDescriptor>
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param sensitive
|
||||
* @return
|
||||
* @param sensitive true if sensitive; false otherwise
|
||||
* @return the builder
|
||||
*/
|
||||
public Builder sensitive(final boolean sensitive) {
|
||||
this.sensitive = sensitive;
|
||||
|
@ -384,9 +378,8 @@ public final class PropertyDescriptor implements Comparable<PropertyDescriptor>
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param validator
|
||||
* @return
|
||||
* @param validator for the property
|
||||
* @return the builder
|
||||
*/
|
||||
public Builder addValidator(final Validator validator) {
|
||||
if (validator != null) {
|
||||
|
@ -401,7 +394,7 @@ public final class PropertyDescriptor implements Comparable<PropertyDescriptor>
|
|||
*
|
||||
* @param controllerServiceDefinition the interface that is implemented
|
||||
* by the Controller Service
|
||||
* @return
|
||||
* @return the builder
|
||||
*/
|
||||
public Builder identifiesControllerService(final Class<? extends ControllerService> controllerServiceDefinition) {
|
||||
if (controllerServiceDefinition != null) {
|
||||
|
@ -436,7 +429,7 @@ public final class PropertyDescriptor implements Comparable<PropertyDescriptor>
|
|||
throw new IllegalStateException("Must specify a name");
|
||||
}
|
||||
if (!isValueAllowed(defaultValue)) {
|
||||
throw new IllegalStateException("Default value ["+ defaultValue +"] is not in the set of allowable values");
|
||||
throw new IllegalStateException("Default value [" + defaultValue + "] is not in the set of allowable values");
|
||||
}
|
||||
|
||||
return new PropertyDescriptor(this);
|
||||
|
@ -525,7 +518,7 @@ public final class PropertyDescriptor implements Comparable<PropertyDescriptor>
|
|||
* Constructs a validator that will check if the given value is in the
|
||||
* given set.
|
||||
*
|
||||
* @param validValues
|
||||
* @param validValues values which are acceptible
|
||||
* @throws NullPointerException if the given validValues is null
|
||||
*/
|
||||
private ConstrainedSetValidator(final Collection<AllowableValue> validValues) {
|
||||
|
|
|
@ -89,25 +89,21 @@ public interface PropertyValue {
|
|||
public Double asDataSize(DataUnit dataUnit);
|
||||
|
||||
/**
|
||||
* Returns the ControllerService whose identifier is the raw value of
|
||||
* @return the ControllerService whose identifier is the raw value of
|
||||
* <code>this</code>, or <code>null</code> if either the value is not set or
|
||||
* the value does not identify a ControllerService
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public ControllerService asControllerService();
|
||||
|
||||
/**
|
||||
* Returns the ControllerService whose identifier is the raw value of the
|
||||
* @param <T> the generic type of the controller service
|
||||
* @param serviceType the class of the Controller Service
|
||||
* @return the ControllerService whose identifier is the raw value of the
|
||||
* <code>this</code>, or <code>null</code> if either the value is not set or
|
||||
* the value does not identify a ControllerService. The object returned by
|
||||
* this method is explicitly cast to type specified, if the type specified
|
||||
* is valid. Otherwise, throws an IllegalArgumentException
|
||||
*
|
||||
* @param <T>
|
||||
* @param serviceType
|
||||
* @return
|
||||
*
|
||||
* @throws IllegalArgumentException if the value of <code>this</code> points
|
||||
* to a ControllerService but that service is not of type
|
||||
* <code>serviceType</code> or if <code>serviceType</code> references a
|
||||
|
@ -116,11 +112,9 @@ public interface PropertyValue {
|
|||
public <T extends ControllerService> T asControllerService(Class<T> serviceType) throws IllegalArgumentException;
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if the user has configured a value, or if the
|
||||
* @return <code>true</code> if the user has configured a value, or if the
|
||||
* {@link PropertyDescriptor} for the associated property has a default
|
||||
* value, <code>false</code> otherwise.
|
||||
*
|
||||
* @return
|
||||
* value, <code>false</code> otherwise
|
||||
*/
|
||||
public boolean isSet();
|
||||
|
||||
|
@ -131,7 +125,8 @@ public interface PropertyValue {
|
|||
* call chaining.
|
||||
* </p>
|
||||
*
|
||||
* @return
|
||||
* @return a PropertyValue with the new value is returned, supporting call
|
||||
* chaining
|
||||
*
|
||||
* @throws ProcessException if the Query cannot be compiled or evaluating
|
||||
* the query against the given attributes causes an Exception to be thrown
|
||||
|
@ -145,8 +140,9 @@ public interface PropertyValue {
|
|||
* call chaining.
|
||||
* </p>
|
||||
*
|
||||
* @param flowFile
|
||||
* @return
|
||||
* @param flowFile to evaluate attributes of
|
||||
* @return a PropertyValue with the new value is returned, supporting call
|
||||
* chaining
|
||||
*
|
||||
* @throws ProcessException if the Query cannot be compiled or evaluating
|
||||
* the query against the given attributes causes an Exception to be thrown
|
||||
|
@ -161,8 +157,10 @@ public interface PropertyValue {
|
|||
* supporting call chaining.
|
||||
* </p>
|
||||
*
|
||||
* @param decorator
|
||||
* @return
|
||||
* @param decorator The supplied decorator is then given a chance to
|
||||
* decorate the value
|
||||
* @return a PropertyValue with the new value is then returned, supporting
|
||||
* call chaining
|
||||
*
|
||||
* @throws ProcessException if the Query cannot be compiled or evaluating
|
||||
* the query against the given attributes causes an Exception to be thrown
|
||||
|
@ -177,10 +175,12 @@ public interface PropertyValue {
|
|||
* supporting call chaining.
|
||||
* </p>
|
||||
*
|
||||
* @param flowFile
|
||||
* @param decorator
|
||||
* @param flowFile to evaluate expressions against
|
||||
* @param decorator The supplied decorator is then given a chance to
|
||||
* decorate the value
|
||||
*
|
||||
* @return
|
||||
* @return a PropertyValue with the new value is then returned, supporting
|
||||
* call chaining
|
||||
*
|
||||
* @throws ProcessException if the Query cannot be compiled or evaluating
|
||||
* the query against the given attributes causes an Exception to be thrown
|
||||
|
|
|
@ -25,86 +25,71 @@ import org.apache.nifi.expression.ExpressionLanguageCompiler;
|
|||
public interface ValidationContext {
|
||||
|
||||
/**
|
||||
* Returns the {@link ControllerServiceLookup} which can be used to obtain
|
||||
* @return the {@link ControllerServiceLookup} which can be used to obtain
|
||||
* Controller Services
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
ControllerServiceLookup getControllerServiceLookup();
|
||||
|
||||
/**
|
||||
* Returns a ValidationContext that is appropriate for validating the given
|
||||
* @param controllerService to lookup the validation context of
|
||||
* @return a ValidationContext that is appropriate for validating the given
|
||||
* {@link ControllerService}
|
||||
*
|
||||
* @param controllerService
|
||||
* @return
|
||||
*/
|
||||
ValidationContext getControllerServiceValidationContext(ControllerService controllerService);
|
||||
|
||||
/**
|
||||
* Creates and returns a new {@link ExpressionLanguageCompiler} that can be
|
||||
* used to compile & evaluate Attribute Expressions
|
||||
*
|
||||
* @return
|
||||
* @return a new {@link ExpressionLanguageCompiler} that can be used to
|
||||
* compile & evaluate Attribute Expressions
|
||||
*/
|
||||
ExpressionLanguageCompiler newExpressionLanguageCompiler();
|
||||
|
||||
/**
|
||||
* Returns a PropertyValue that encapsulates the value configured for the
|
||||
* @param property being validated
|
||||
* @return a PropertyValue that encapsulates the value configured for the
|
||||
* given PropertyDescriptor
|
||||
*
|
||||
* @param property
|
||||
* @return
|
||||
*/
|
||||
PropertyValue getProperty(PropertyDescriptor property);
|
||||
|
||||
/**
|
||||
* Returns a PropertyValue that represents the given value
|
||||
*
|
||||
* @param value
|
||||
* @return
|
||||
* @param value to make a PropertyValue object for
|
||||
* @return a PropertyValue that represents the given value
|
||||
*/
|
||||
PropertyValue newPropertyValue(String value);
|
||||
|
||||
/**
|
||||
* Returns a Map of all configured Properties.
|
||||
*
|
||||
* @return
|
||||
* @return a Map of all configured Properties
|
||||
*/
|
||||
Map<PropertyDescriptor, String> getProperties();
|
||||
|
||||
/**
|
||||
* Returns the currently configured Annotation Data
|
||||
*
|
||||
* @return
|
||||
* @return the currently configured Annotation Data
|
||||
*/
|
||||
String getAnnotationData();
|
||||
|
||||
|
||||
/**
|
||||
* There are times when the framework needs to consider a component valid, even if it
|
||||
* references an invalid ControllerService. This method will return <code>false</code>
|
||||
* if the component is to be considered valid even if the given Controller Service is referenced
|
||||
* and is invalid.
|
||||
* @param service
|
||||
* There are times when the framework needs to consider a component valid,
|
||||
* even if it references an invalid ControllerService. This method will
|
||||
* return <code>false</code> if the component is to be considered valid even
|
||||
* if the given Controller Service is referenced and is invalid.
|
||||
*
|
||||
* @param service to check if validation is required
|
||||
* @return <code>false</code> if the component is to be considered valid
|
||||
* even if the given Controller Service is referenced and is invalid
|
||||
*/
|
||||
boolean isValidationRequired(ControllerService service);
|
||||
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if the given value contains a NiFi Expression Language expression,
|
||||
* <code>false</code> if it does not
|
||||
*
|
||||
* @param value
|
||||
* @return
|
||||
* @param value to test whether expression language is present
|
||||
* @return <code>true</code> if the given value contains a NiFi Expression
|
||||
* Language expression, <code>false</code> if it does not
|
||||
*/
|
||||
boolean isExpressionLanguagePresent(String value);
|
||||
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if the property with the given name supports the NiFi Expression Language,
|
||||
* <code>false</code> if the property does not support the Expression Language or is not a valid property
|
||||
* name
|
||||
*
|
||||
* @param propertyName
|
||||
* @return
|
||||
* @param propertyName to test whether expression language is supported
|
||||
* @return <code>true</code> if the property with the given name supports
|
||||
* the NiFi Expression Language, <code>false</code> if the property does not
|
||||
* support the Expression Language or is not a valid property name
|
||||
*/
|
||||
boolean isExpressionLanguageSupported(String propertyName);
|
||||
}
|
||||
|
|
|
@ -119,8 +119,8 @@ public class ValidationResult {
|
|||
/**
|
||||
* Defaults to false
|
||||
*
|
||||
* @param valid
|
||||
* @return
|
||||
* @param valid true if is valid; false otherwise
|
||||
* @return the builder
|
||||
*/
|
||||
public Builder valid(final boolean valid) {
|
||||
this.valid = valid;
|
||||
|
@ -130,8 +130,8 @@ public class ValidationResult {
|
|||
/**
|
||||
* Defaults to empty string
|
||||
*
|
||||
* @param input
|
||||
* @return
|
||||
* @param input what was validated
|
||||
* @return the builder
|
||||
*/
|
||||
public Builder input(final String input) {
|
||||
if (null != input) {
|
||||
|
@ -143,8 +143,8 @@ public class ValidationResult {
|
|||
/**
|
||||
* Defaults to empty string
|
||||
*
|
||||
* @param explanation
|
||||
* @return
|
||||
* @param explanation of validation result
|
||||
* @return the builder
|
||||
*/
|
||||
public Builder explanation(final String explanation) {
|
||||
if (null != explanation) {
|
||||
|
@ -156,8 +156,8 @@ public class ValidationResult {
|
|||
/**
|
||||
* Defaults to empty string
|
||||
*
|
||||
* @param subject
|
||||
* @return
|
||||
* @param subject the thing that was validated
|
||||
* @return the builder
|
||||
*/
|
||||
public Builder subject(final String subject) {
|
||||
if (null != subject) {
|
||||
|
|
|
@ -32,7 +32,7 @@ public abstract class AbstractControllerService extends AbstractConfigurableComp
|
|||
private ControllerServiceLookup serviceLookup;
|
||||
private volatile ConfigurationContext configContext;
|
||||
private ComponentLog logger;
|
||||
|
||||
|
||||
@Override
|
||||
public final void initialize(final ControllerServiceInitializationContext context) throws InitializationException {
|
||||
this.identifier = context.getIdentifier();
|
||||
|
@ -52,31 +52,25 @@ public abstract class AbstractControllerService extends AbstractConfigurableComp
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the currently configured value for the given
|
||||
* @param descriptor to retrieve value of
|
||||
* @return the currently configured value for the given
|
||||
* {@link PropertyDescriptor}
|
||||
*
|
||||
* @param descriptor
|
||||
* @return
|
||||
*/
|
||||
protected final PropertyValue getProperty(final PropertyDescriptor descriptor) {
|
||||
return configContext.getProperty(descriptor);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an unmodifiable map of all configured properties for this
|
||||
* @return an unmodifiable map of all configured properties for this
|
||||
* {@link ControllerService}
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected final Map<PropertyDescriptor, String> getProperties() {
|
||||
return configContext.getProperties();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the {@link ControllerServiceLookup} that was passed to the
|
||||
* @return the {@link ControllerServiceLookup} that was passed to the
|
||||
* {@link #init(ProcessorInitializationContext)} method
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected final ControllerServiceLookup getControllerServiceLookup() {
|
||||
return serviceLookup;
|
||||
|
@ -86,15 +80,15 @@ public abstract class AbstractControllerService extends AbstractConfigurableComp
|
|||
* Provides a mechanism by which subclasses can perform initialization of
|
||||
* the Reporting Task before it is scheduled to be run
|
||||
*
|
||||
* @param config
|
||||
* @throws InitializationException
|
||||
* @param config of initialization context
|
||||
* @throws InitializationException if unable to init
|
||||
*/
|
||||
protected void init(final ControllerServiceInitializationContext config) throws InitializationException {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the logger that has been provided to the component by the framework in its initialize method.
|
||||
* @return
|
||||
* @return the logger that has been provided to the component by the
|
||||
* framework in its initialize method
|
||||
*/
|
||||
protected ComponentLog getLogger() {
|
||||
return logger;
|
||||
|
|
|
@ -28,18 +28,14 @@ import org.apache.nifi.components.PropertyValue;
|
|||
public interface ConfigurationContext {
|
||||
|
||||
/**
|
||||
* Returns the configured value for the property with the given name
|
||||
*
|
||||
* @param property
|
||||
* @return
|
||||
* @param property to retrieve by name
|
||||
* @return the configured value for the property with the given name
|
||||
*/
|
||||
PropertyValue getProperty(PropertyDescriptor property);
|
||||
|
||||
/**
|
||||
* Returns an unmodifiable map of all configured properties for this
|
||||
* @return an unmodifiable map of all configured properties for this
|
||||
* {@link ControllerService}
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Map<PropertyDescriptor, String> getProperties();
|
||||
|
||||
|
|
|
@ -68,21 +68,20 @@ import org.apache.nifi.reporting.ReportingTask;
|
|||
* </p>
|
||||
* <p>
|
||||
* <code><pre>
|
||||
* public static final PropertyDescriptor MY_PROPERTY = new PropertyDescriptor.Builder()
|
||||
* .name("My Property")
|
||||
* .description("Example Property")
|
||||
* .identifiesControllerService( MyControllerServiceInterface.class )
|
||||
* .build();
|
||||
* public static final PropertyDescriptor MY_PROPERTY = new PropertyDescriptor.Builder()
|
||||
* .name("My Property")
|
||||
* .description("Example Property")
|
||||
* .identifiesControllerService( MyControllerServiceInterface.class )
|
||||
* .build();
|
||||
*
|
||||
* ...
|
||||
* ...
|
||||
* public void onTrigger(ProcessContext context, ProcessSessionFactory sessionFactory) throws ProcessException {
|
||||
* // Obtain the user-selected controller service
|
||||
* final MyControllerServiceInterface service = context.getProperty(MY_PROPERTY).asControllerService( MyControllerServiceInterface.class );
|
||||
* ...
|
||||
* }
|
||||
*
|
||||
* public void onTrigger(ProcessContext context, ProcessSessionFactory sessionFactory) throws ProcessException {
|
||||
* // Obtain the user-selected controller service
|
||||
* final MyControllerServiceInterface service = context.getProperty(MY_PROPERTY).asControllerService( MyControllerServiceInterface.class );
|
||||
* ...
|
||||
* }
|
||||
*
|
||||
* </pre></code></p>
|
||||
* </pre></code></p>
|
||||
* </li>
|
||||
* <li>A Controller Service can be obtained via a
|
||||
* {@link ControllerServiceLookup}. This lookup may be obtained, for example,
|
||||
|
@ -94,10 +93,9 @@ import org.apache.nifi.reporting.ReportingTask;
|
|||
* </p>
|
||||
* <p>
|
||||
* <code><pre>
|
||||
* public void onTrigger(ProcessContext context, ProcessSessionFactory sessionFactory) throws ProcessException {
|
||||
* final MyControllerServiceInterface service = (MyControllerServiceInterface)
|
||||
* context.getControllerServiceLookup().getControllerService("service_identifier");
|
||||
* }
|
||||
* public void onTrigger(ProcessContext context, ProcessSessionFactory sessionFactory) throws ProcessException {
|
||||
* final MyControllerServiceInterface service = (MyControllerServiceInterface) context.getControllerServiceLookup().getControllerService("service_identifier");
|
||||
* }
|
||||
* </pre></code></p>
|
||||
* </li>
|
||||
* </ul>
|
||||
|
@ -142,12 +140,12 @@ import org.apache.nifi.reporting.ReportingTask;
|
|||
* <p>
|
||||
* Typically, this is done by creating a NAR structure as follows:
|
||||
* <pre>
|
||||
* + my-services-api-nar
|
||||
* +--- service-X-implementation-nar
|
||||
* +--- service-Y-implementation-nar
|
||||
* +--- service-Z-implementation-nar
|
||||
* +--- processor-A-nar
|
||||
* +--- processor-B-nar
|
||||
* + my-services-api-nar
|
||||
* +--- service-X-implementation-nar
|
||||
* +--- service-Y-implementation-nar
|
||||
* +--- service-Z-implementation-nar
|
||||
* +--- processor-A-nar
|
||||
* +--- processor-B-nar
|
||||
* </pre>
|
||||
* </p>
|
||||
*
|
||||
|
@ -174,8 +172,8 @@ public interface ControllerService extends ConfigurableComponent {
|
|||
* throughout the life of the service. This method will be called before any
|
||||
* properties are set
|
||||
*
|
||||
* @param context
|
||||
* @throws org.apache.nifi.reporting.InitializationException
|
||||
* @param context of initialization
|
||||
* @throws org.apache.nifi.reporting.InitializationException if unable to init
|
||||
*/
|
||||
void initialize(ControllerServiceInitializationContext context) throws InitializationException;
|
||||
|
||||
|
|
|
@ -21,26 +21,20 @@ import org.apache.nifi.logging.ComponentLog;
|
|||
public interface ControllerServiceInitializationContext {
|
||||
|
||||
/**
|
||||
* Returns the identifier associated with the {@link ControllerService} with
|
||||
* @return the identifier associated with the {@link ControllerService} with
|
||||
* which this context is associated
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String getIdentifier();
|
||||
|
||||
/**
|
||||
* Returns the {@link ControllerServiceLookup} which can be used to obtain
|
||||
* @return the {@link ControllerServiceLookup} which can be used to obtain
|
||||
* Controller Services
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
ControllerServiceLookup getControllerServiceLookup();
|
||||
|
||||
|
||||
/**
|
||||
* Returns a logger that can be used to log important events in a standard way and generate
|
||||
* bulletins when appropriate
|
||||
*
|
||||
* @return
|
||||
* @return a logger that can be used to log important events in a standard
|
||||
* way and generate bulletins when appropriate
|
||||
*/
|
||||
ComponentLog getLogger();
|
||||
}
|
||||
|
|
|
@ -18,68 +18,53 @@ package org.apache.nifi.controller;
|
|||
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
public interface ControllerServiceLookup {
|
||||
|
||||
/**
|
||||
* Returns the ControllerService that is registered with the given
|
||||
* @param serviceIdentifier of controller service
|
||||
* @return the ControllerService that is registered with the given
|
||||
* identifier
|
||||
*
|
||||
* @param serviceIdentifier
|
||||
* @return
|
||||
*/
|
||||
ControllerService getControllerService(String serviceIdentifier);
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if the Controller Service with the given
|
||||
* @param serviceIdentifier identifier of service to check
|
||||
* @return <code>true</code> if the Controller Service with the given
|
||||
* identifier is enabled, <code>false</code> otherwise. If the given
|
||||
* identifier is not known by this ControllerServiceLookup, returns
|
||||
* <code>false</code>
|
||||
*
|
||||
* @param serviceIdentifier
|
||||
* @return
|
||||
*/
|
||||
boolean isControllerServiceEnabled(String serviceIdentifier);
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if the Controller Service with the given
|
||||
* @param serviceIdentifier idenfitier of service to check
|
||||
* @return <code>true</code> if the Controller Service with the given
|
||||
* identifier has been enabled but is still in the transitioning state,
|
||||
* otherwise returns <code>false</code>.
|
||||
* If the given identifier is not known by this ControllerServiceLookup,
|
||||
* returns <code>false</code>.
|
||||
*
|
||||
* @param serviceIdentifier
|
||||
* @return
|
||||
* otherwise returns <code>false</code>. If the given identifier is not
|
||||
* known by this ControllerServiceLookup, returns <code>false</code>
|
||||
*/
|
||||
boolean isControllerServiceEnabling(String serviceIdentifier);
|
||||
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if the given Controller Service is enabled,
|
||||
* @param service service to check
|
||||
* @return <code>true</code> if the given Controller Service is enabled,
|
||||
* <code>false</code> otherwise. If the given Controller Service is not
|
||||
* known by this ControllerServiceLookup, returns <code>false</code>
|
||||
*
|
||||
* @param service
|
||||
* @return
|
||||
*/
|
||||
boolean isControllerServiceEnabled(ControllerService service);
|
||||
|
||||
/**
|
||||
* Returns the set of all Controller Service Identifiers whose Controller
|
||||
* Service is of the given type. The class specified MUST be an interface,
|
||||
* or an IllegalArgumentExcption will be thrown
|
||||
*
|
||||
* @param serviceType
|
||||
* @return
|
||||
*
|
||||
* @param serviceType type of service to get identifiers for
|
||||
* @return the set of all Controller Service Identifiers whose Controller
|
||||
* Service is of the given type.
|
||||
* @throws IllegalArgumentException if the given class is not an interface
|
||||
*/
|
||||
Set<String> getControllerServiceIdentifiers(Class<? extends ControllerService> serviceType) throws IllegalArgumentException;
|
||||
|
||||
/**
|
||||
* Returns the name of the Controller service with the given identifier. If no service can be
|
||||
* found with this identifier, returns {@code null}.
|
||||
* @param serviceIdentifier
|
||||
* @return
|
||||
* @param serviceIdentifier identifier to look up
|
||||
* @return the name of the Controller service with the given identifier. If
|
||||
* no service can be found with this identifier, returns {@code null}
|
||||
*/
|
||||
String getControllerServiceName(String serviceIdentifier);
|
||||
}
|
||||
|
|
|
@ -40,10 +40,8 @@ public interface FlowFileQueue {
|
|||
List<FlowFilePrioritizer> getPriorities();
|
||||
|
||||
/**
|
||||
* Returns the minimum number of FlowFiles that must be present in order for
|
||||
* @return the minimum number of FlowFiles that must be present in order for
|
||||
* FlowFiles to begin being swapped out of the queue
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
int getSwapThreshold();
|
||||
|
||||
|
@ -71,9 +69,7 @@ public interface FlowFileQueue {
|
|||
long getBackPressureObjectThreshold();
|
||||
|
||||
/**
|
||||
* Establishes this queue's preferred maximum data size.
|
||||
*
|
||||
* @param maxDataSize
|
||||
* @param maxDataSize Establishes this queue's preferred maximum data size.
|
||||
*/
|
||||
void setBackPressureDataSizeThreshold(String maxDataSize);
|
||||
|
||||
|
@ -117,21 +113,21 @@ public interface FlowFileQueue {
|
|||
/**
|
||||
* places the given file into the queue
|
||||
*
|
||||
* @param file
|
||||
* @param file to place into queue
|
||||
*/
|
||||
void put(FlowFileRecord file);
|
||||
|
||||
/**
|
||||
* places the given files into the queue
|
||||
*
|
||||
* @param files
|
||||
* @param files to place into queue
|
||||
*/
|
||||
void putAll(Collection<FlowFileRecord> files);
|
||||
|
||||
/**
|
||||
* Removes all records from the internal swap queue and returns them.
|
||||
*
|
||||
* @return
|
||||
* @return all removed records from internal swap queue
|
||||
*/
|
||||
List<FlowFileRecord> pollSwappableRecords();
|
||||
|
||||
|
@ -139,7 +135,7 @@ public interface FlowFileQueue {
|
|||
* Restores the records from swap space into this queue, adding the records
|
||||
* that have expired to the given set instead of enqueuing them.
|
||||
*
|
||||
* @param records
|
||||
* @param records that were swapped in
|
||||
*/
|
||||
void putSwappedRecords(Collection<FlowFileRecord> records);
|
||||
|
||||
|
@ -147,15 +143,13 @@ public interface FlowFileQueue {
|
|||
* Updates the internal counters of how much data is queued, based on
|
||||
* swapped data that is being restored.
|
||||
*
|
||||
* @param numRecords
|
||||
* @param contentSize
|
||||
* @param numRecords count of records swapped in
|
||||
* @param contentSize total size of records being swapped in
|
||||
*/
|
||||
void incrementSwapCount(int numRecords, long contentSize);
|
||||
|
||||
/**
|
||||
* Returns the number of FlowFiles that are enqueued and not swapped
|
||||
*
|
||||
* @return
|
||||
* @return the number of FlowFiles that are enqueued and not swapped
|
||||
*/
|
||||
int unswappedSize();
|
||||
|
||||
|
@ -164,14 +158,14 @@ public interface FlowFileQueue {
|
|||
int getSwapQueueSize();
|
||||
|
||||
/**
|
||||
* @param expiredRecords
|
||||
* @param expiredRecords expired records
|
||||
* @return the next flow file on the queue; null if empty
|
||||
*/
|
||||
FlowFileRecord poll(Set<FlowFileRecord> expiredRecords);
|
||||
|
||||
/**
|
||||
* @param maxResults
|
||||
* @param expiredRecords
|
||||
* @param maxResults limits how many results can be polled
|
||||
* @param expiredRecords for expired records
|
||||
* @return the next flow files on the queue up to the max results; null if
|
||||
* empty
|
||||
*/
|
||||
|
@ -181,10 +175,10 @@ public interface FlowFileQueue {
|
|||
* Drains flow files from the given source queue into the given destination
|
||||
* list.
|
||||
*
|
||||
* @param sourceQueue
|
||||
* @param destination
|
||||
* @param sourceQueue queue to drain from
|
||||
* @param destination Collection to drain to
|
||||
* @param maxResults max number to drain
|
||||
* @param expiredRecords
|
||||
* @param expiredRecords for expired records
|
||||
* @return size (bytes) of flow files drained from queue
|
||||
*/
|
||||
long drainQueue(Queue<FlowFileRecord> sourceQueue, List<FlowFileRecord> destination, int maxResults, Set<FlowFileRecord> expiredRecords);
|
||||
|
|
|
@ -24,89 +24,65 @@ import java.util.Set;
|
|||
public interface Snippet {
|
||||
|
||||
/**
|
||||
* The id of this snippet.
|
||||
*
|
||||
* @return
|
||||
* @return id of this snippet
|
||||
*/
|
||||
public String getId();
|
||||
|
||||
/**
|
||||
* Whether or not this snippet is linked to the data flow. If the Snippet is
|
||||
* @return Whether or not this snippet is linked to the data flow. If the Snippet is
|
||||
* deleted and is linked, then the underlying components will also be
|
||||
* deleted. If the Snippet is deleted and is NOT linked, only the Snippet is
|
||||
* removed
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isLinked();
|
||||
|
||||
/**
|
||||
* The parent group id of the components in this snippet.
|
||||
*
|
||||
* @return
|
||||
* @return parent group id of the components in this snippet
|
||||
*/
|
||||
public String getParentGroupId();
|
||||
|
||||
/**
|
||||
* The connections in this snippet.
|
||||
*
|
||||
* @return
|
||||
* @return connections in this snippet
|
||||
*/
|
||||
public Set<String> getConnections();
|
||||
|
||||
/**
|
||||
* The funnels in this snippet.
|
||||
*
|
||||
* @return
|
||||
* @return funnels in this snippet
|
||||
*/
|
||||
public Set<String> getFunnels();
|
||||
|
||||
/**
|
||||
* The input ports in this snippet.
|
||||
*
|
||||
* @return
|
||||
* @return input ports in this snippet
|
||||
*/
|
||||
public Set<String> getInputPorts();
|
||||
|
||||
/**
|
||||
* The output ports in this snippet.
|
||||
*
|
||||
* @return
|
||||
* @return output ports in this snippet
|
||||
*/
|
||||
public Set<String> getOutputPorts();
|
||||
|
||||
/**
|
||||
* The labels in this snippet.
|
||||
*
|
||||
* @return
|
||||
* @return labels in this snippet
|
||||
*/
|
||||
public Set<String> getLabels();
|
||||
|
||||
/**
|
||||
* Returns the identifiers of all ProcessGroups in this Snippet
|
||||
*
|
||||
* @return
|
||||
* @return the identifiers of all ProcessGroups in this Snippet
|
||||
*/
|
||||
public Set<String> getProcessGroups();
|
||||
|
||||
/**
|
||||
* Returns the identifiers of all Processors in this Snippet
|
||||
*
|
||||
* @return
|
||||
* @return the identifiers of all Processors in this Snippet
|
||||
*/
|
||||
public Set<String> getProcessors();
|
||||
|
||||
/**
|
||||
* Returns the identifiers of all RemoteProcessGroups in this Snippet
|
||||
*
|
||||
* @return
|
||||
* @return the identifiers of all RemoteProcessGroups in this Snippet
|
||||
*/
|
||||
public Set<String> getRemoteProcessGroups();
|
||||
|
||||
/**
|
||||
* Determines if this snippet is empty.
|
||||
*
|
||||
* @return
|
||||
* @return Determines if this snippet is empty
|
||||
*/
|
||||
public boolean isEmpty();
|
||||
|
||||
|
|
|
@ -44,9 +44,9 @@ public interface Triggerable {
|
|||
* be committed or the framework may use the session again for another
|
||||
* processor down stream</p>
|
||||
*
|
||||
* @param context
|
||||
* @param sessionFactory used to generate {@link ProcessSession}s to use
|
||||
* for operating on flow files within the repository
|
||||
* @param context in which the component is triggered
|
||||
* @param sessionFactory used to generate {@link ProcessSession}s to use for
|
||||
* operating on flow files within the repository
|
||||
*
|
||||
* @throws ProcessException if processing did not complete normally though
|
||||
* indicates the problem is an understood potential outcome of processing.
|
||||
|
@ -81,7 +81,7 @@ public interface Triggerable {
|
|||
* <code>Triggerable</code> has any active threads, see
|
||||
* {@link ProcessScheduler#getActiveThreadCount(nifi.connectable.Connectable)}.
|
||||
*
|
||||
* @return
|
||||
* @return the schedule state
|
||||
*/
|
||||
ScheduledState getScheduledState();
|
||||
|
||||
|
@ -92,12 +92,12 @@ public interface Triggerable {
|
|||
* invocation of {@link #onTrigger(ProcessContext, ProcessSessionFactory)}
|
||||
* have not yet returned
|
||||
*
|
||||
* @return
|
||||
* @return true if running;false otherwise
|
||||
*/
|
||||
boolean isRunning();
|
||||
|
||||
/**
|
||||
* @param timeUnit
|
||||
* @param timeUnit for the scheduling period of the component
|
||||
* @return the amount of time between each scheduling period
|
||||
*/
|
||||
long getSchedulingPeriod(TimeUnit timeUnit);
|
||||
|
@ -110,7 +110,8 @@ public interface Triggerable {
|
|||
|
||||
/**
|
||||
* Updates how often this Triggerable should be triggered to run
|
||||
* @param schedulingPeriod
|
||||
*
|
||||
* @param schedulingPeriod to set
|
||||
*/
|
||||
void setScheduldingPeriod(String schedulingPeriod);
|
||||
}
|
||||
|
|
|
@ -31,8 +31,9 @@ import java.lang.annotation.Target;
|
|||
* {@link nifi.controller.ConfigurationContext ConfigurationContext}.
|
||||
*
|
||||
* @author none
|
||||
*
|
||||
* @deprecated This annotation has been replaced by those in the {@link org.apache.nifi.annotation.lifecycle} package.
|
||||
*
|
||||
* @deprecated This annotation has been replaced by those in the
|
||||
* {@link org.apache.nifi.annotation.lifecycle} package.
|
||||
*/
|
||||
@Documented
|
||||
@Target({ElementType.METHOD})
|
||||
|
|
|
@ -31,7 +31,6 @@ import org.apache.nifi.controller.repository.claim.ContentClaimManager;
|
|||
* available on the methods but a merge capability is provided which between
|
||||
* that and creating new claims a merge is available.
|
||||
*
|
||||
* @author none
|
||||
*/
|
||||
public interface ContentRepository {
|
||||
|
||||
|
@ -40,46 +39,38 @@ public interface ContentRepository {
|
|||
* ContentClaimManager that is to be used for interacting with Content
|
||||
* Claims
|
||||
*
|
||||
* @param claimManager
|
||||
* @throws java.io.IOException
|
||||
* @param claimManager to handle claims
|
||||
* @throws java.io.IOException if unable to init
|
||||
*/
|
||||
void initialize(ContentClaimManager claimManager) throws IOException;
|
||||
|
||||
/**
|
||||
* Shuts down the Content Repository, freeing any resources that may be held.
|
||||
* This is called when an administrator shuts down NiFi.
|
||||
* Shuts down the Content Repository, freeing any resources that may be
|
||||
* held. This is called when an administrator shuts down NiFi.
|
||||
*/
|
||||
void shutdown();
|
||||
|
||||
|
||||
/**
|
||||
* Returns the names of all Containers that exist for this Content
|
||||
* @return the names of all Containers that exist for this Content
|
||||
* Repository
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Set<String> getContainerNames();
|
||||
|
||||
/**
|
||||
* Returns the maximum number of bytes that can be stored in the storage
|
||||
* @param containerName name of container to check capacity on
|
||||
* @return the maximum number of bytes that can be stored in the storage
|
||||
* mechanism that backs the container with the given name
|
||||
*
|
||||
* @param containerName
|
||||
* @return
|
||||
* @throws java.io.IOException
|
||||
*
|
||||
* @throws java.io.IOException if unable to check capacity
|
||||
* @throws IllegalArgumentException if no container exists with the given
|
||||
* name
|
||||
*/
|
||||
long getContainerCapacity(String containerName) throws IOException;
|
||||
|
||||
/**
|
||||
* Returns the number of bytes available to be used used by the storage
|
||||
* @param containerName to check space on
|
||||
* @return the number of bytes available to be used used by the storage
|
||||
* mechanism that backs the container with the given name
|
||||
*
|
||||
* @param containerName
|
||||
* @return
|
||||
* @throws java.io.IOException
|
||||
*
|
||||
* @throws java.io.IOException if unable to check space
|
||||
* @throws IllegalArgumentException if no container exists with the given
|
||||
* name
|
||||
*/
|
||||
|
@ -92,14 +83,14 @@ public interface ContentRepository {
|
|||
* loss tolerant. If true the repository might choose more volatile storage
|
||||
* options which could increase performance for a tradeoff with reliability
|
||||
* @return newly created claim
|
||||
* @throws java.io.IOException
|
||||
* @throws java.io.IOException if unable to create claim
|
||||
*/
|
||||
ContentClaim create(boolean lossTolerant) throws IOException;
|
||||
|
||||
/**
|
||||
* Increments the number of claimants for the given claim
|
||||
*
|
||||
* @param claim
|
||||
* @param claim to increment
|
||||
* @return the number of claimants after incrementing
|
||||
*/
|
||||
int incrementClaimaintCount(ContentClaim claim);
|
||||
|
@ -107,7 +98,7 @@ public interface ContentRepository {
|
|||
/**
|
||||
* Obtains the current number of claimants for the given claim
|
||||
*
|
||||
* @param claim
|
||||
* @param claim to get count of
|
||||
* @return the number of claimants
|
||||
*/
|
||||
int getClaimantCount(ContentClaim claim);
|
||||
|
@ -117,15 +108,15 @@ public interface ContentRepository {
|
|||
* claim is null or content cannot be found or removed no exception will be
|
||||
* thrown.
|
||||
*
|
||||
* @param claim
|
||||
* @return
|
||||
* @param claim to decrement
|
||||
* @return new claimant count for the given claim
|
||||
*/
|
||||
int decrementClaimantCount(ContentClaim claim);
|
||||
|
||||
/**
|
||||
* Removes the content indicated by the given claim
|
||||
*
|
||||
* @param claim
|
||||
* @param claim to remove
|
||||
*
|
||||
* @return a boolean indicating whether or not the destruction of the claim
|
||||
* was successful
|
||||
|
@ -136,9 +127,9 @@ public interface ContentRepository {
|
|||
* Clones the content for the given content claim and returns content claim
|
||||
* of the new object
|
||||
*
|
||||
* @param original
|
||||
* @param lossTolerant
|
||||
* @return
|
||||
* @param original to clone
|
||||
* @param lossTolerant if can be place in a loss tolerant repository
|
||||
* @return new claim
|
||||
* @throws IOException if an IO error occurs. Any content written to the new
|
||||
* destination prior to the error will be destroyed
|
||||
*/
|
||||
|
@ -156,7 +147,7 @@ public interface ContentRepository {
|
|||
* @param footer if supplied will be appended to the output
|
||||
* @param demarcator if supplied will be placed in between each merged
|
||||
* object
|
||||
* @throws IOException
|
||||
* @throws IOException if unable to merge
|
||||
* @throws IllegalArgumentException if the given destination is included in
|
||||
* the given claims
|
||||
*/
|
||||
|
@ -167,9 +158,9 @@ public interface ContentRepository {
|
|||
* claim within the repository.
|
||||
*
|
||||
* @return the size of the claim
|
||||
* @param content
|
||||
* @param content to import from
|
||||
* @param claim the claim to write imported content to
|
||||
* @throws IOException
|
||||
* @throws IOException if failure to read given content
|
||||
*/
|
||||
long importFrom(Path content, ContentClaim claim) throws IOException;
|
||||
|
||||
|
@ -179,11 +170,11 @@ public interface ContentRepository {
|
|||
* argument
|
||||
*
|
||||
* @return the size of the claim
|
||||
* @param content
|
||||
* @param content to import from
|
||||
* @param claim the claim to write imported content to
|
||||
* @param append if true, the content will be appended to the claim; if
|
||||
* false, the content will replace the contents of the claim
|
||||
* @throws IOException
|
||||
* @throws IOException if unable to read content
|
||||
*/
|
||||
long importFrom(Path content, ContentClaim claim, boolean append) throws IOException;
|
||||
|
||||
|
@ -192,9 +183,9 @@ public interface ContentRepository {
|
|||
* claim within the repository.
|
||||
*
|
||||
* @return the size of the claim
|
||||
* @param content
|
||||
* @param content to import from
|
||||
* @param claim the claim to write imported content to
|
||||
* @throws IOException
|
||||
* @throws IOException if unable to read content
|
||||
*/
|
||||
long importFrom(InputStream content, ContentClaim claim) throws IOException;
|
||||
|
||||
|
@ -202,11 +193,11 @@ public interface ContentRepository {
|
|||
* Imports content from the given stream, appending or replacing the current
|
||||
* claim, according to the value of the appen dargument
|
||||
*
|
||||
* @param content
|
||||
* @param claim
|
||||
* @param append
|
||||
* @return
|
||||
* @throws IOException
|
||||
* @param content to import from
|
||||
* @param claim to write to
|
||||
* @param append whether to append or replace
|
||||
* @return length of data imported in bytes
|
||||
* @throws IOException if failure to read or write stream
|
||||
*/
|
||||
long importFrom(InputStream content, ContentClaim claim, boolean append) throws IOException;
|
||||
|
||||
|
@ -214,7 +205,7 @@ public interface ContentRepository {
|
|||
* Exports the content of the given claim to the given destination.
|
||||
*
|
||||
* @return the size of the destination or the claim
|
||||
* @param claim
|
||||
* @param claim to export from
|
||||
* @param destination where to export data
|
||||
* @param append if true appends to the destination; false overwrites
|
||||
* @throws IOException if an IO error occurs. The state of the content for
|
||||
|
@ -227,7 +218,7 @@ public interface ContentRepository {
|
|||
* Exports the content of the given claim to the given destination.
|
||||
*
|
||||
* @return the size of the destination or the claim
|
||||
* @param claim
|
||||
* @param claim to export from
|
||||
* @param destination where to export data
|
||||
* @param append if true appends to the destination; false overwrites
|
||||
* @param offset the offset at which the claim should start being copied
|
||||
|
@ -242,7 +233,7 @@ public interface ContentRepository {
|
|||
* Exports the content of the given claim to the given destination.
|
||||
*
|
||||
* @return the size of the claim
|
||||
* @param claim
|
||||
* @param claim to export from
|
||||
* @param destination where to export data
|
||||
* @throws IOException if an IO error occurs.
|
||||
*/
|
||||
|
@ -253,7 +244,7 @@ public interface ContentRepository {
|
|||
* and copying length bytes, to the given destination.
|
||||
*
|
||||
* @return the number of bytes copied
|
||||
* @param claim
|
||||
* @param claim to export from
|
||||
* @param destination where to export data
|
||||
* @param offset the offset into the claim at which the copy should begin
|
||||
* @param length the number of bytes to copy
|
||||
|
@ -262,27 +253,27 @@ public interface ContentRepository {
|
|||
long exportTo(ContentClaim claim, OutputStream destination, long offset, long length) throws IOException;
|
||||
|
||||
/**
|
||||
* @param claim
|
||||
* @param claim to get size of
|
||||
* @return size in bytes of content for given claim
|
||||
* @throws IOException
|
||||
* @throws IOException if size check failed
|
||||
*/
|
||||
long size(ContentClaim claim) throws IOException;
|
||||
|
||||
/**
|
||||
* Provides access to the input stream for the given claim
|
||||
*
|
||||
* @param claim
|
||||
* @param claim to read from
|
||||
* @return InputStream over the content of the given claim
|
||||
* @throws IOException
|
||||
* @throws IOException if unable to read
|
||||
*/
|
||||
InputStream read(ContentClaim claim) throws IOException;
|
||||
|
||||
/**
|
||||
* Obtains an OutputStream to the content for the given claim.
|
||||
*
|
||||
* @param claim
|
||||
* @return
|
||||
* @throws IOException
|
||||
* @param claim to write to
|
||||
* @return the stream to write to
|
||||
* @throws IOException if unable to obtain stream
|
||||
*/
|
||||
OutputStream write(ContentClaim claim) throws IOException;
|
||||
|
||||
|
@ -300,15 +291,13 @@ public interface ContentRepository {
|
|||
void cleanup();
|
||||
|
||||
/**
|
||||
* Returns a boolean indicating whether or not the content specified by the
|
||||
* given claim can be read, regardless of whether the content has been
|
||||
* archived or not. If the ContentRepository does not implement archiving
|
||||
* capabilities, this method will return <code>false</code>.
|
||||
*
|
||||
* @param contentClaim the Content Claim to check
|
||||
* @return
|
||||
* @return Returns a boolean indicating whether or not the content specified
|
||||
* by the given claim can be read, regardless of whether the content has
|
||||
* been archived or not. If the ContentRepository does not implement
|
||||
* archiving capabilities, this method will return <code>false</code>
|
||||
*
|
||||
* @throws IOException
|
||||
* @throws IOException if unable to determine accessibility
|
||||
*/
|
||||
boolean isAccessible(ContentClaim contentClaim) throws IOException;
|
||||
}
|
||||
|
|
|
@ -27,28 +27,22 @@ import org.apache.nifi.flowfile.FlowFile;
|
|||
public interface FlowFileRecord extends FlowFile {
|
||||
|
||||
/**
|
||||
* Returns the time (in millis since epoch) at which this FlowFile should no
|
||||
* longer be penalized.
|
||||
*
|
||||
* @return
|
||||
* @return the time (in millis since epoch) at which this FlowFile should no
|
||||
* longer be penalized
|
||||
*/
|
||||
long getPenaltyExpirationMillis();
|
||||
|
||||
/**
|
||||
* Returns the {@link ContentClaim} that holds the FlowFile's content
|
||||
*
|
||||
* @return
|
||||
* @return the {@link ContentClaim} that holds the FlowFile's content
|
||||
*/
|
||||
ContentClaim getContentClaim();
|
||||
|
||||
/**
|
||||
* Returns the byte offset into the {@link ContentClaim} at which the
|
||||
* @return the byte offset into the {@link ContentClaim} at which the
|
||||
* FlowFile's content occurs. This mechanism allows multiple FlowFiles to
|
||||
* have the same ContentClaim, which can be significantly more efficient for
|
||||
* some implementations of
|
||||
* {@link nifi.controller.repository.ContentRepository ContentRepository}
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
long getContentClaimOffset();
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@ import org.apache.nifi.controller.repository.claim.ContentClaimManager;
|
|||
/**
|
||||
* Implementations must be thread safe
|
||||
*
|
||||
* @author none
|
||||
*/
|
||||
public interface FlowFileRepository extends Closeable {
|
||||
|
||||
|
@ -36,28 +35,24 @@ public interface FlowFileRepository extends Closeable {
|
|||
* ContentClaimManager that is to be used for interacting with Content
|
||||
* Claims
|
||||
*
|
||||
* @param claimManager
|
||||
* @throws java.io.IOException
|
||||
* @param claimManager for handling claims
|
||||
* @throws java.io.IOException if unable to initialize repository
|
||||
*/
|
||||
void initialize(ContentClaimManager claimManager) throws IOException;
|
||||
|
||||
/**
|
||||
* Returns the maximum number of bytes that can be stored in the underlying
|
||||
* @return the maximum number of bytes that can be stored in the underlying
|
||||
* storage mechanism
|
||||
*
|
||||
* @return
|
||||
*
|
||||
* @throws IOException
|
||||
* @throws IOException if computing capacity fails
|
||||
*/
|
||||
long getStorageCapacity() throws IOException;
|
||||
|
||||
/**
|
||||
* Returns the number of bytes currently available for use by the underlying
|
||||
* @return the number of bytes currently available for use by the underlying
|
||||
* storage mechanism
|
||||
*
|
||||
* @return
|
||||
*
|
||||
* @throws IOException
|
||||
* @throws IOException if computing usable space fails
|
||||
*/
|
||||
long getUsableStorageSpace() throws IOException;
|
||||
|
||||
|
@ -65,7 +60,7 @@ public interface FlowFileRepository extends Closeable {
|
|||
* Updates the repository with the given RepositoryRecords.
|
||||
*
|
||||
* @param records the records to update the repository with
|
||||
* @throws java.io.IOException
|
||||
* @throws java.io.IOException if update fails
|
||||
*/
|
||||
void updateRepository(Collection<RepositoryRecord> records) throws IOException;
|
||||
|
||||
|
@ -79,7 +74,7 @@ public interface FlowFileRepository extends Closeable {
|
|||
* returned by a call to {@link #getNextFlowFileSequence()}
|
||||
*
|
||||
* @return index of highest flow file identifier
|
||||
* @throws IOException
|
||||
* @throws IOException if load fails
|
||||
*/
|
||||
long loadFlowFiles(QueueProvider queueProvider, long minimumSequenceNumber) throws IOException;
|
||||
|
||||
|
@ -97,7 +92,7 @@ public interface FlowFileRepository extends Closeable {
|
|||
/**
|
||||
* @return the max ID of all <code>FlowFile</code>s that currently exist in
|
||||
* the repository.
|
||||
* @throws IOException
|
||||
* @throws IOException if computing max identifier fails
|
||||
*/
|
||||
long getMaxFlowFileIdentifier() throws IOException;
|
||||
|
||||
|
@ -109,7 +104,7 @@ public interface FlowFileRepository extends Closeable {
|
|||
* @param flowFileQueue the queue that the FlowFiles belong to
|
||||
* @param swapLocation the location to which the FlowFiles were swapped
|
||||
*
|
||||
* @throws IOException
|
||||
* @throws IOException if swap fails
|
||||
*/
|
||||
void swapFlowFilesOut(List<FlowFileRecord> swappedOut, FlowFileQueue flowFileQueue, String swapLocation) throws IOException;
|
||||
|
||||
|
@ -122,7 +117,7 @@ public interface FlowFileRepository extends Closeable {
|
|||
* @param flowFileRecords the records that were swapped in
|
||||
* @param flowFileQueue the queue that the FlowFiles belong to
|
||||
*
|
||||
* @throws IOException
|
||||
* @throws IOException if swap fails
|
||||
*/
|
||||
void swapFlowFilesIn(String swapLocation, List<FlowFileRecord> flowFileRecords, FlowFileQueue flowFileQueue) throws IOException;
|
||||
}
|
||||
|
|
|
@ -55,9 +55,9 @@ public interface FlowFileSwapManager {
|
|||
* Notifies FlowFile queues of the number of FlowFiles and content size of
|
||||
* all FlowFiles that are currently swapped out
|
||||
*
|
||||
* @param connectionProvider
|
||||
* @param claimManager
|
||||
* @return
|
||||
* @param connectionProvider provider
|
||||
* @param claimManager manager
|
||||
* @return how many flowfiles have been recovered
|
||||
*/
|
||||
long recoverSwappedFlowFiles(QueueProvider connectionProvider, ContentClaimManager claimManager);
|
||||
}
|
||||
|
|
|
@ -27,9 +27,7 @@ import org.apache.nifi.controller.FlowFileQueue;
|
|||
public interface QueueProvider {
|
||||
|
||||
/**
|
||||
* Returns all <code>FlowFileQueue</code>s that currently exist in the flow
|
||||
*
|
||||
* @return
|
||||
* @return all <code>FlowFileQueue</code>s that currently exist in the flow
|
||||
*/
|
||||
Collection<FlowFileQueue> getAllQueues();
|
||||
}
|
||||
|
|
|
@ -26,60 +26,44 @@ import org.apache.nifi.controller.repository.claim.ContentClaim;
|
|||
public interface RepositoryRecord {
|
||||
|
||||
/**
|
||||
* The FlowFileQueue to which the FlowFile is to be transferred
|
||||
*
|
||||
* @return
|
||||
* @return FlowFileQueue to which the FlowFile is to be transferred
|
||||
*/
|
||||
FlowFileQueue getDestination();
|
||||
|
||||
/**
|
||||
* The FlowFileQueue from which the record was pulled
|
||||
*
|
||||
* @return
|
||||
* @return FlowFileQueue from which the record was pulled
|
||||
*/
|
||||
FlowFileQueue getOriginalQueue();
|
||||
|
||||
/**
|
||||
* The type of update that this record encapsulates
|
||||
*
|
||||
* @return
|
||||
* @return type of update that this record encapsulates
|
||||
*/
|
||||
RepositoryRecordType getType();
|
||||
|
||||
/**
|
||||
* The current ContentClaim for the FlowFile
|
||||
*
|
||||
* @return
|
||||
* @return current ContentClaim for the FlowFile
|
||||
*/
|
||||
ContentClaim getCurrentClaim();
|
||||
|
||||
/**
|
||||
* The original ContentClaim for the FlowFile before any changes were made
|
||||
*
|
||||
* @return
|
||||
* @return original ContentClaim for the FlowFile before any changes were made
|
||||
*/
|
||||
ContentClaim getOriginalClaim();
|
||||
|
||||
/**
|
||||
* The byte offset into the Content Claim where this FlowFile's content
|
||||
* @return byte offset into the Content Claim where this FlowFile's content
|
||||
* begins
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
long getCurrentClaimOffset();
|
||||
|
||||
/**
|
||||
* The FlowFile being encapsulated by this record
|
||||
*
|
||||
* @return
|
||||
* @return FlowFile being encapsulated by this record
|
||||
*/
|
||||
FlowFileRecord getCurrent();
|
||||
|
||||
/**
|
||||
* Whether or not the FlowFile's attributes have changed since the FlowFile
|
||||
* @return Whether or not the FlowFile's attributes have changed since the FlowFile
|
||||
* was pulled from its queue (or created)
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
boolean isAttributesChanged();
|
||||
|
||||
|
@ -90,11 +74,9 @@ public interface RepositoryRecord {
|
|||
boolean isMarkedForAbort();
|
||||
|
||||
/**
|
||||
* If the FlowFile is swapped out of the Java heap space, provides the
|
||||
* @return If the FlowFile is swapped out of the Java heap space, provides the
|
||||
* location of the swap file, or <code>null</code> if the FlowFile is not
|
||||
* swapped out
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String getSwapLocation();
|
||||
}
|
||||
|
|
|
@ -45,11 +45,9 @@ public interface ContentClaim extends Comparable<ContentClaim> {
|
|||
String getSection();
|
||||
|
||||
/**
|
||||
* Specifies whether or not the Claim is loss-tolerant. If so, we will
|
||||
* @return Indicates whether or not the Claim is loss-tolerant. If so, we will
|
||||
* attempt to keep the content but will not sacrifice a great deal of
|
||||
* performance to do so.
|
||||
*
|
||||
* @return
|
||||
* performance to do so
|
||||
*/
|
||||
boolean isLossTolerant();
|
||||
}
|
||||
|
|
|
@ -28,20 +28,18 @@ public interface ContentClaimManager {
|
|||
* Creates a new Content Claim with the given id, container, section, and
|
||||
* loss tolerance.
|
||||
*
|
||||
* @param id
|
||||
* @param container
|
||||
* @param section
|
||||
* @param lossTolerant
|
||||
* @return
|
||||
* @param id of claim
|
||||
* @param container of claim
|
||||
* @param section of claim
|
||||
* @param lossTolerant of claim
|
||||
* @return new claim
|
||||
*/
|
||||
ContentClaim newContentClaim(String container, String section, String id, boolean lossTolerant);
|
||||
|
||||
/**
|
||||
* Returns the number of FlowFiles that hold a claim to a particular piece
|
||||
* @param claim to obtain reference count for
|
||||
* @return the number of FlowFiles that hold a claim to a particular piece
|
||||
* of FlowFile content
|
||||
*
|
||||
* @param claim
|
||||
* @return
|
||||
*/
|
||||
int getClaimantCount(ContentClaim claim);
|
||||
|
||||
|
@ -49,8 +47,8 @@ public interface ContentClaimManager {
|
|||
* Decreases by 1 the count of how many FlowFiles hold a claim to a
|
||||
* particular piece of FlowFile content and returns the new count
|
||||
*
|
||||
* @param claim
|
||||
* @return
|
||||
* @param claim to decrement claimants on
|
||||
* @return new claimaint count
|
||||
*/
|
||||
int decrementClaimantCount(ContentClaim claim);
|
||||
|
||||
|
@ -58,8 +56,8 @@ public interface ContentClaimManager {
|
|||
* Increases by 1 the count of how many FlowFiles hold a claim to a
|
||||
* particular piece of FlowFile content and returns the new count
|
||||
*
|
||||
* @param claim
|
||||
* @return
|
||||
* @param claim to increment claims on
|
||||
* @return new claimant count
|
||||
*/
|
||||
int incrementClaimantCount(ContentClaim claim);
|
||||
|
||||
|
@ -73,9 +71,10 @@ public interface ContentClaimManager {
|
|||
* optimize its tasks, knowing that the Content Claim cannot be referenced
|
||||
* by any other component
|
||||
*
|
||||
* @param claim
|
||||
* @param newClaim
|
||||
* @return
|
||||
* @param claim to increment
|
||||
* @param newClaim provides a hint that no other process can have access to this
|
||||
* claim right now
|
||||
* @return new claim count
|
||||
*/
|
||||
int incrementClaimantCount(ContentClaim claim, boolean newClaim);
|
||||
|
||||
|
@ -105,7 +104,7 @@ public interface ContentClaimManager {
|
|||
* unneeded claim. As such, it is now safe to destroy the contents.
|
||||
* </p>
|
||||
*
|
||||
* @param claim
|
||||
* @param claim to mark as now destructable
|
||||
*/
|
||||
void markDestructable(ContentClaim claim);
|
||||
|
||||
|
@ -114,8 +113,8 @@ public interface ContentClaimManager {
|
|||
* of destructable content claims to the given {@code destination} so that
|
||||
* they can be destroyed.
|
||||
*
|
||||
* @param destination
|
||||
* @param maxElements
|
||||
* @param destination to drain to
|
||||
* @param maxElements max items to drain
|
||||
*/
|
||||
void drainDestructableClaims(Collection<ContentClaim> destination, int maxElements);
|
||||
|
||||
|
@ -128,10 +127,10 @@ public interface ContentClaimManager {
|
|||
* ready to be destroyed, the method will return without having added
|
||||
* anything to the given {@code destination}.
|
||||
*
|
||||
* @param destination
|
||||
* @param maxElements
|
||||
* @param timeout
|
||||
* @param unit
|
||||
* @param destination to drain to
|
||||
* @param maxElements max items to drain
|
||||
* @param timeout maximum time to wait
|
||||
* @param unit unit of time to wait
|
||||
*/
|
||||
void drainDestructableClaims(Collection<ContentClaim> destination, int maxElements, long timeout, TimeUnit unit);
|
||||
|
||||
|
|
|
@ -43,6 +43,8 @@ public class ProcessGroupStatus implements Cloneable {
|
|||
private long bytesReceived;
|
||||
private int flowFilesSent;
|
||||
private long bytesSent;
|
||||
private int flowFilesTransferred;
|
||||
private long bytesTransferred;
|
||||
|
||||
private Collection<ConnectionStatus> connectionStatus = new ArrayList<>();
|
||||
private Collection<ProcessorStatus> processorStatus = new ArrayList<>();
|
||||
|
@ -227,6 +229,22 @@ public class ProcessGroupStatus implements Cloneable {
|
|||
this.bytesSent = bytesSent;
|
||||
}
|
||||
|
||||
public int getFlowFilesTransferred() {
|
||||
return flowFilesTransferred;
|
||||
}
|
||||
|
||||
public void setFlowFilesTransferred(int flowFilesTransferred) {
|
||||
this.flowFilesTransferred = flowFilesTransferred;
|
||||
}
|
||||
|
||||
public long getBytesTransferred() {
|
||||
return bytesTransferred;
|
||||
}
|
||||
|
||||
public void setBytesTransferred(long bytesTransferred) {
|
||||
this.bytesTransferred = bytesTransferred;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProcessGroupStatus clone() {
|
||||
|
||||
|
@ -248,6 +266,8 @@ public class ProcessGroupStatus implements Cloneable {
|
|||
clonedObj.bytesReceived = bytesReceived;
|
||||
clonedObj.flowFilesSent = flowFilesSent;
|
||||
clonedObj.bytesSent = bytesSent;
|
||||
clonedObj.flowFilesTransferred = flowFilesTransferred;
|
||||
clonedObj.bytesTransferred = bytesTransferred;
|
||||
|
||||
if (connectionStatus != null) {
|
||||
final Collection<ConnectionStatus> statusList = new ArrayList<>();
|
||||
|
@ -317,6 +337,18 @@ public class ProcessGroupStatus implements Cloneable {
|
|||
builder.append(creationTimestamp);
|
||||
builder.append(", activeThreadCount=");
|
||||
builder.append(activeThreadCount);
|
||||
builder.append(", flowFilesTransferred=");
|
||||
builder.append(flowFilesTransferred);
|
||||
builder.append(", bytesTransferred=");
|
||||
builder.append(bytesTransferred);
|
||||
builder.append(", flowFilesReceived=");
|
||||
builder.append(flowFilesReceived);
|
||||
builder.append(", bytesReceived=");
|
||||
builder.append(bytesReceived);
|
||||
builder.append(", flowFilesSent=");
|
||||
builder.append(flowFilesSent);
|
||||
builder.append(", bytesSent=");
|
||||
builder.append(bytesSent);
|
||||
builder.append(",\n\tconnectionStatus=");
|
||||
|
||||
for (final ConnectionStatus status : connectionStatus) {
|
||||
|
@ -374,6 +406,12 @@ public class ProcessGroupStatus implements Cloneable {
|
|||
target.setBytesRead(target.getBytesRead() + toMerge.getBytesRead());
|
||||
target.setBytesWritten(target.getBytesWritten() + toMerge.getBytesWritten());
|
||||
target.setActiveThreadCount(target.getActiveThreadCount() + toMerge.getActiveThreadCount());
|
||||
target.setFlowFilesTransferred(target.getFlowFilesTransferred() + toMerge.getFlowFilesTransferred());
|
||||
target.setBytesTransferred(target.getBytesTransferred() + toMerge.getBytesTransferred());
|
||||
target.setFlowFilesReceived(target.getFlowFilesReceived() + toMerge.getFlowFilesReceived());
|
||||
target.setBytesReceived(target.getBytesReceived() + toMerge.getBytesReceived());
|
||||
target.setFlowFilesSent(target.getFlowFilesSent() + toMerge.getFlowFilesSent());
|
||||
target.setBytesSent(target.getBytesSent() + toMerge.getBytesSent());
|
||||
|
||||
// connection status
|
||||
// sort by id
|
||||
|
@ -425,7 +463,7 @@ public class ProcessGroupStatus implements Cloneable {
|
|||
// processor run status is disabled/stopped/running is part of the flow configuration
|
||||
// and should not differ amongst nodes. however, whether a processor is invalid
|
||||
// can be driven by environmental conditions. this check allows any of those to
|
||||
// take precedence over the configured run status.
|
||||
// take precedence over the configured run status.
|
||||
if (RunStatus.Invalid.equals(statusToMerge.getRunStatus())) {
|
||||
merged.setRunStatus(RunStatus.Invalid);
|
||||
}
|
||||
|
@ -454,7 +492,7 @@ public class ProcessGroupStatus implements Cloneable {
|
|||
merged.setTransmitting(true);
|
||||
}
|
||||
|
||||
// should be unnecessary here since ports run status should not be affected by
|
||||
// should be unnecessary here since ports run status should not be affected by
|
||||
// environmental conditions but doing so in case that changes
|
||||
if (RunStatus.Invalid.equals(statusToMerge.getRunStatus())) {
|
||||
merged.setRunStatus(RunStatus.Invalid);
|
||||
|
@ -484,7 +522,7 @@ public class ProcessGroupStatus implements Cloneable {
|
|||
merged.setTransmitting(true);
|
||||
}
|
||||
|
||||
// should be unnecessary here since ports run status not should be affected by
|
||||
// should be unnecessary here since ports run status not should be affected by
|
||||
// environmental conditions but doing so in case that changes
|
||||
if (RunStatus.Invalid.equals(statusToMerge.getRunStatus())) {
|
||||
merged.setRunStatus(RunStatus.Invalid);
|
||||
|
|
|
@ -33,7 +33,7 @@ public interface ComponentStatusRepository {
|
|||
/**
|
||||
* Captures the status information provided in the given report
|
||||
*
|
||||
* @param rootGroupStatus
|
||||
* @param rootGroupStatus status of root group
|
||||
*/
|
||||
void capture(ProcessGroupStatus rootGroupStatus);
|
||||
|
||||
|
@ -42,22 +42,17 @@ public interface ComponentStatusRepository {
|
|||
* timestamp that indicates the time at which the status report was
|
||||
* generated. This can be used to replay historical values.
|
||||
*
|
||||
* @param rootGroupStatus
|
||||
* @param timestamp
|
||||
* @param rootGroupStatus status
|
||||
* @param timestamp timestamp of capture
|
||||
*/
|
||||
void capture(ProcessGroupStatus rootGroupStatus, Date timestamp);
|
||||
|
||||
/**
|
||||
* Returns the Date at which the latest capture was performed
|
||||
*
|
||||
* @return
|
||||
* @return the Date at which the latest capture was performed
|
||||
*/
|
||||
Date getLastCaptureDate();
|
||||
|
||||
/**
|
||||
* Returns a {@link StatusHistory} that provides the status information
|
||||
* about the Connection with the given ID during the given time period.
|
||||
*
|
||||
* @param connectionId the ID of the Connection for which the Status is
|
||||
* desired
|
||||
* @param start the earliest date for which status information should be
|
||||
|
@ -70,15 +65,13 @@ public interface ComponentStatusRepository {
|
|||
* If the date range is large, the total number of data points could be far
|
||||
* too many to process. Therefore, this parameter allows the requestor to
|
||||
* indicate how many samples to return.
|
||||
* @return
|
||||
* @return a {@link StatusHistory} that provides the status information
|
||||
* about the Connection with the given ID during the given time period
|
||||
*/
|
||||
StatusHistory getConnectionStatusHistory(String connectionId, Date start, Date end, int preferredDataPoints);
|
||||
|
||||
/**
|
||||
* Returns a {@link StatusHistory} that provides the status information
|
||||
* about the Process Group with the given ID during the given time period.
|
||||
*
|
||||
* @param processGroupId
|
||||
* @param processGroupId of group to get status of
|
||||
* @param start the earliest date for which status information should be
|
||||
* returned; if <code>null</code>, the start date should be assumed to be
|
||||
* the beginning of time
|
||||
|
@ -89,15 +82,13 @@ public interface ComponentStatusRepository {
|
|||
* If the date range is large, the total number of data points could be far
|
||||
* too many to process. Therefore, this parameter allows the requestor to
|
||||
* indicate how many samples to return.
|
||||
* @return
|
||||
* @return a {@link StatusHistory} that provides the status information
|
||||
* about the Process Group with the given ID during the given time period
|
||||
*/
|
||||
StatusHistory getProcessGroupStatusHistory(String processGroupId, Date start, Date end, int preferredDataPoints);
|
||||
|
||||
/**
|
||||
* Returns a {@link StatusHistory} that provides the status information
|
||||
* about the Processor with the given ID during the given time period.
|
||||
*
|
||||
* @param processorId
|
||||
* @param processorId to get status of
|
||||
* @param start the earliest date for which status information should be
|
||||
* returned; if <code>null</code>, the start date should be assumed to be
|
||||
* the beginning of time
|
||||
|
@ -108,16 +99,13 @@ public interface ComponentStatusRepository {
|
|||
* If the date range is large, the total number of data points could be far
|
||||
* too many to process. Therefore, this parameter allows the requestor to
|
||||
* indicate how many samples to return.
|
||||
* @return
|
||||
* @return a {@link StatusHistory} that provides the status information
|
||||
* about the Processor with the given ID during the given time period
|
||||
*/
|
||||
StatusHistory getProcessorStatusHistory(String processorId, Date start, Date end, int preferredDataPoints);
|
||||
|
||||
/**
|
||||
* Returns a {@link StatusHistory} that provides the status information
|
||||
* about the Remote Process Group with the given ID during the given time
|
||||
* period.
|
||||
*
|
||||
* @param remoteGroupId
|
||||
* @param remoteGroupId to get history of
|
||||
* @param start the earliest date for which status information should be
|
||||
* returned; if <code>null</code>, the start date should be assumed to be
|
||||
* the beginning of time
|
||||
|
@ -128,39 +116,33 @@ public interface ComponentStatusRepository {
|
|||
* If the date range is large, the total number of data points could be far
|
||||
* too many to process. Therefore, this parameter allows the requestor to
|
||||
* indicate how many samples to return.
|
||||
* @return
|
||||
* @return a {@link StatusHistory} that provides the status information
|
||||
* about the Remote Process Group with the given ID during the given time
|
||||
* period
|
||||
*/
|
||||
StatusHistory getRemoteProcessGroupStatusHistory(String remoteGroupId, Date start, Date end, int preferredDataPoints);
|
||||
|
||||
/**
|
||||
* Returns a List of all {@link MetricDescriptor}s that are applicable to
|
||||
* @return a List of all {@link MetricDescriptor}s that are applicable to
|
||||
* Process Groups
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<MetricDescriptor<ProcessGroupStatus>> getProcessGroupMetricDescriptors();
|
||||
|
||||
/**
|
||||
* Returns a List of all {@link MetricDescriptor}s that are applicable to
|
||||
* @return a List of all {@link MetricDescriptor}s that are applicable to
|
||||
* Processors
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<MetricDescriptor<ProcessorStatus>> getProcessorMetricDescriptors();
|
||||
|
||||
/**
|
||||
* Returns a List of all {@link MetricDescriptor}s that are applicable to
|
||||
* @return a List of all {@link MetricDescriptor}s that are applicable to
|
||||
* Remote Process Groups
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<MetricDescriptor<RemoteProcessGroupStatus>> getRemoteProcessGroupMetricDescriptors();
|
||||
|
||||
/**
|
||||
* Returns a List of all {@link MetricDescriptor}s that are applicable to
|
||||
* @return a List of all {@link MetricDescriptor}s that are applicable to
|
||||
* Connections
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<MetricDescriptor<ConnectionStatus>> getConnectionMetricDescriptors();
|
||||
|
||||
|
|
|
@ -18,7 +18,8 @@ package org.apache.nifi.controller.status.history;
|
|||
|
||||
/**
|
||||
* Describes a particular metric that is derived from a Status History
|
||||
* @param <T>
|
||||
*
|
||||
* @param <T> type of metric
|
||||
*/
|
||||
public interface MetricDescriptor<T> {
|
||||
|
||||
|
@ -32,44 +33,34 @@ public interface MetricDescriptor<T> {
|
|||
/**
|
||||
* Specifies how the values should be formatted
|
||||
*
|
||||
* @return
|
||||
* @return formatter for values
|
||||
*/
|
||||
Formatter getFormatter();
|
||||
|
||||
/**
|
||||
* Returns a human-readable description of the field
|
||||
*
|
||||
* @return
|
||||
* @return a human-readable description of the field
|
||||
*/
|
||||
String getDescription();
|
||||
|
||||
/**
|
||||
* Returns a human-readable label for the field
|
||||
*
|
||||
* @return
|
||||
* @return a human-readable label for the field
|
||||
*/
|
||||
String getLabel();
|
||||
|
||||
/**
|
||||
* Returns the name of a field
|
||||
*
|
||||
* @return
|
||||
* @return the name of a field
|
||||
*/
|
||||
String getField();
|
||||
|
||||
/**
|
||||
* Returns a {@link ValueMapper} that can be used to extract a value for the
|
||||
* @return a {@link ValueMapper} that can be used to extract a value for the
|
||||
* status history
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
ValueMapper<T> getValueFunction();
|
||||
|
||||
/**
|
||||
* Returns a {@link ValueReducer} that can reduce multiple StatusSnapshots
|
||||
* @return a {@link ValueReducer} that can reduce multiple StatusSnapshots
|
||||
* into a single Long value
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
ValueReducer<StatusSnapshot, Long> getValueReducer();
|
||||
}
|
||||
|
|
|
@ -26,25 +26,19 @@ import java.util.Map;
|
|||
public interface StatusHistory {
|
||||
|
||||
/**
|
||||
* Returns a Date indicating when this report was generated
|
||||
*
|
||||
* @return
|
||||
* @return a Date indicating when this report was generated
|
||||
*/
|
||||
Date getDateGenerated();
|
||||
|
||||
/**
|
||||
* Returns a Map of component field names and their values. The order in
|
||||
* @return a Map of component field names and their values. The order in
|
||||
* which these values are displayed is dependent on the natural ordering of
|
||||
* the Map returned.
|
||||
*
|
||||
* @return
|
||||
* the Map returned
|
||||
*/
|
||||
Map<String, String> getComponentDetails();
|
||||
|
||||
/**
|
||||
* A List of snapshots for a given component
|
||||
*
|
||||
* @return
|
||||
* @return List of snapshots for a given component
|
||||
*/
|
||||
List<StatusSnapshot> getStatusSnapshots();
|
||||
}
|
||||
|
|
|
@ -25,24 +25,18 @@ import java.util.Map;
|
|||
public interface StatusSnapshot {
|
||||
|
||||
/**
|
||||
* Rreturns the point in time for which the status values were obtained
|
||||
*
|
||||
* @return
|
||||
* @return the point in time for which the status values were obtained
|
||||
*/
|
||||
Date getTimestamp();
|
||||
|
||||
/**
|
||||
* Returns a Map of MetricDescriptor to value
|
||||
*
|
||||
* @return
|
||||
* @return a Map of MetricDescriptor to value
|
||||
*/
|
||||
Map<MetricDescriptor<?>, Long> getStatusMetrics();
|
||||
|
||||
/**
|
||||
* Returns a {@link ValueReducer} that is capable of merging multiple
|
||||
* @return a {@link ValueReducer} that is capable of merging multiple
|
||||
* StatusSnapshot objects into a single one
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
ValueReducer<StatusSnapshot, StatusSnapshot> getValueReducer();
|
||||
}
|
||||
|
|
|
@ -22,12 +22,10 @@ import org.apache.nifi.processor.exception.ProcessException;
|
|||
public interface AttributeExpression {
|
||||
|
||||
/**
|
||||
* Evaluates the expression without providing any FlowFile Attributes. This
|
||||
* @return Evaluates the expression without providing any FlowFile Attributes. This
|
||||
* will evaluate the expression based only on System Properties and JVM
|
||||
* Environment properties
|
||||
*
|
||||
* @return
|
||||
* @throws ProcessException
|
||||
* @throws ProcessException if unable to evaluate
|
||||
*/
|
||||
String evaluate() throws ProcessException;
|
||||
|
||||
|
@ -36,9 +34,9 @@ public interface AttributeExpression {
|
|||
* will evaluate the expression based only on System Properties and JVM
|
||||
* Environment properties but allows the values to be decorated
|
||||
*
|
||||
* @param decorator
|
||||
* @return
|
||||
* @throws ProcessException
|
||||
* @param decorator for attribute value
|
||||
* @return evaluated value
|
||||
* @throws ProcessException if failure in evaluation
|
||||
*/
|
||||
String evaluate(AttributeValueDecorator decorator) throws ProcessException;
|
||||
|
||||
|
@ -47,9 +45,9 @@ public interface AttributeExpression {
|
|||
* id, etc. of the given FlowFile, as well as System Properties and JVM
|
||||
* Environment properties
|
||||
*
|
||||
* @param flowFile
|
||||
* @return
|
||||
* @throws ProcessException
|
||||
* @param flowFile to evaluate
|
||||
* @return evaluated value
|
||||
* @throws ProcessException if failure evaluating
|
||||
*/
|
||||
String evaluate(FlowFile flowFile) throws ProcessException;
|
||||
|
||||
|
@ -58,17 +56,15 @@ public interface AttributeExpression {
|
|||
* id, etc. of the given FlowFile, as well as System Properties and JVM
|
||||
* Environment properties and allows the values to be decorated
|
||||
*
|
||||
* @param flowFile
|
||||
* @param decorator
|
||||
* @return
|
||||
* @throws ProcessException
|
||||
* @param flowFile to evaluate
|
||||
* @param decorator for evaluation
|
||||
* @return evaluated value
|
||||
* @throws ProcessException if failed to evaluate
|
||||
*/
|
||||
String evaluate(FlowFile flowFile, AttributeValueDecorator decorator) throws ProcessException;
|
||||
|
||||
/**
|
||||
* Returns the type that is returned by the Expression
|
||||
*
|
||||
* @return
|
||||
* @return the type that is returned by the Expression
|
||||
*/
|
||||
ResultType getResultType();
|
||||
|
||||
|
|
|
@ -22,8 +22,8 @@ public interface AttributeValueDecorator {
|
|||
* Decorates the value of a FlowFile Attribute or System/JVM property in
|
||||
* some way
|
||||
*
|
||||
* @param attributeValue
|
||||
* @return
|
||||
* @param attributeValue to decorate
|
||||
* @return decorated value
|
||||
*/
|
||||
String decorate(String attributeValue);
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ public interface ExpressionLanguageCompiler {
|
|||
* AttributeExpression that can be evaluated
|
||||
*
|
||||
* @param expression the Attribute Expression to be compiled
|
||||
* @return
|
||||
* @return expression that can be evaluated
|
||||
* @throws IllegalArgumentException if the given expression is not valid
|
||||
*/
|
||||
AttributeExpression compile(String expression) throws IllegalArgumentException;
|
||||
|
@ -34,8 +34,8 @@ public interface ExpressionLanguageCompiler {
|
|||
* Indicates whether or not the given string is a valid Attribute
|
||||
* Expression.
|
||||
*
|
||||
* @param expression
|
||||
* @return
|
||||
* @param expression to validate
|
||||
* @return if is value or not
|
||||
*/
|
||||
boolean isValidExpression(String expression);
|
||||
|
||||
|
@ -44,7 +44,7 @@ public interface ExpressionLanguageCompiler {
|
|||
* if the expression is syntactically valid or a String indicating why the
|
||||
* expression is invalid otherwise.
|
||||
*
|
||||
* @param expression
|
||||
* @param expression to validate
|
||||
* @param allowSurroundingCharacters if <code>true</code> allows characters
|
||||
* to surround the Expression, otherwise the expression must be exactly
|
||||
* equal to a valid Expression. E.g., <code>/${path}</code> is valid if and
|
||||
|
@ -60,7 +60,7 @@ public interface ExpressionLanguageCompiler {
|
|||
* Returns the ResultType that will be returned by the given Expression
|
||||
*
|
||||
* @param expression the Expression to evaluate
|
||||
* @return
|
||||
* @return result type for the given expression
|
||||
* @throws IllegalArgumentException if the given Expression is not a valid
|
||||
* Expression Language Expression; the message of this Exception will
|
||||
* indicate the problem if the expression is not syntactically valid.
|
||||
|
|
|
@ -48,24 +48,22 @@ public interface FlowFile extends Comparable<FlowFile> {
|
|||
long getLineageStartDate();
|
||||
|
||||
/**
|
||||
* Returns the time at which the FlowFile was most recently added to a
|
||||
* @return the time at which the FlowFile was most recently added to a
|
||||
* FlowFile queue, or {@code null} if the FlowFile has never been enqueued.
|
||||
* This value will always be populated before it is passed to a
|
||||
* {@link FlowFilePrioritizer}.
|
||||
*
|
||||
* @return
|
||||
* {@link FlowFilePrioritizer}
|
||||
*/
|
||||
Long getLastQueueDate();
|
||||
|
||||
/**
|
||||
* @return a set of identifiers that are unique to this FlowFile's lineage.
|
||||
* If FlowFile X is derived from FlowFile Y, both FlowFiles will have the
|
||||
* same value for the Lineage Claim ID.
|
||||
*
|
||||
* <p>
|
||||
* If a FlowFile is derived from multiple "parent" FlowFiles, all of the
|
||||
* parents' Lineage Identifiers will be in the set.
|
||||
* </p>
|
||||
*
|
||||
* @return a set of identifiers that are unique to this FlowFile's lineage.
|
||||
* If FlowFile X is derived from FlowFile Y, both FlowFiles will have the
|
||||
* same value for the Lineage Claim ID.
|
||||
*/
|
||||
Set<String> getLineageIdentifiers();
|
||||
|
||||
|
@ -77,7 +75,7 @@ public interface FlowFile extends Comparable<FlowFile> {
|
|||
/**
|
||||
* Obtains the attribute value for the given key
|
||||
*
|
||||
* @param key
|
||||
* @param key of the attribute
|
||||
* @return value if found; null otherwise
|
||||
*/
|
||||
String getAttribute(String key);
|
||||
|
|
|
@ -16,36 +16,40 @@
|
|||
*/
|
||||
package org.apache.nifi.logging;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* The ComponentLog provides a mechanism to ensure that all NiFi components are logging and reporting
|
||||
* information in a consistent way. When messages are logged to the ComponentLog, each message has the
|
||||
* following characteristics:
|
||||
* The ComponentLog provides a mechanism to ensure that all NiFi components are
|
||||
* logging and reporting information in a consistent way. When messages are
|
||||
* logged to the ComponentLog, each message has the following characteristics:
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* <ul>
|
||||
* <li>
|
||||
* The <code>toString()</code> of the component is automatically prepended to the message so that it is clear
|
||||
* which component is providing the information. This is important, since a single component may have many
|
||||
* different instances within the same NiFi instance.
|
||||
* </li>
|
||||
* <li>
|
||||
* If the last value in an Object[] argument that is passed to the logger is a Throwable, then the logged message
|
||||
* will include a <code>toString()</code> of the Throwable; in addition, if the component's logger is set to
|
||||
* DEBUG level via the logback configuration, the Stacktrace will also be logged. This provides a mechanism to easily
|
||||
* enable stacktraces in the logs when they are desired without filling the logs with unneeded stack traces for messages
|
||||
* that end up occurring often.
|
||||
* </li>
|
||||
* <li>
|
||||
* Any message that is logged with a Severity level that meets or exceeds the configured Bulletin Level for that component
|
||||
* will also cause a Bulletin to be generated, so that the message is visible in the UI, allowing Dataflow Managers
|
||||
* to understand that a problem exists and what the issue is.
|
||||
* </li>
|
||||
* <li>
|
||||
* The <code>toString()</code> of the component is automatically prepended to
|
||||
* the message so that it is clear which component is providing the information.
|
||||
* This is important, since a single component may have many different instances
|
||||
* within the same NiFi instance.
|
||||
* </li>
|
||||
* <li>
|
||||
* If the last value in an Object[] argument that is passed to the logger is a
|
||||
* Throwable, then the logged message will include a <code>toString()</code> of
|
||||
* the Throwable; in addition, if the component's logger is set to DEBUG level
|
||||
* via the logback configuration, the Stacktrace will also be logged. This
|
||||
* provides a mechanism to easily enable stacktraces in the logs when they are
|
||||
* desired without filling the logs with unneeded stack traces for messages that
|
||||
* end up occurring often.
|
||||
* </li>
|
||||
* <li>
|
||||
* Any message that is logged with a Severity level that meets or exceeds the
|
||||
* configured Bulletin Level for that component will also cause a Bulletin to be
|
||||
* generated, so that the message is visible in the UI, allowing Dataflow
|
||||
* Managers to understand that a problem exists and what the issue is.
|
||||
* </li>
|
||||
* </ul>
|
||||
*
|
||||
*
|
||||
*/
|
||||
public interface ComponentLog {
|
||||
|
||||
void warn(String msg, Throwable t);
|
||||
|
||||
void warn(String msg, Object[] os);
|
||||
|
|
|
@ -16,14 +16,14 @@
|
|||
*/
|
||||
package org.apache.nifi.logging;
|
||||
|
||||
|
||||
/**
|
||||
* The ProcessorLog is an extension of ComponentLog but provides no additional functionality.
|
||||
* It exists because ProcessorLog was created first,
|
||||
* but when Controller Services and Reporting Tasks began to be used more heavily loggers
|
||||
* were needed for them as well. We did not want to return a ProcessorLog to a ControllerService
|
||||
* or a ReportingTask, so all of the methods were moved to a higher interface named ComponentLog.
|
||||
* However, we kept the ProcessorLog interface around in order to maintain backward compatibility.
|
||||
* The ProcessorLog is an extension of ComponentLog but provides no additional
|
||||
* functionality. It exists because ProcessorLog was created first, but when
|
||||
* Controller Services and Reporting Tasks began to be used more heavily loggers
|
||||
* were needed for them as well. We did not want to return a ProcessorLog to a
|
||||
* ControllerService or a ReportingTask, so all of the methods were moved to a
|
||||
* higher interface named ComponentLog. However, we kept the ProcessorLog
|
||||
* interface around in order to maintain backward compatibility.
|
||||
*/
|
||||
public interface ProcessorLog extends ComponentLog {
|
||||
|
||||
|
|
|
@ -41,7 +41,6 @@ import org.apache.nifi.logging.ProcessorLog;
|
|||
* <p>
|
||||
* Thread safe</p>
|
||||
*
|
||||
* @author none
|
||||
*/
|
||||
public abstract class AbstractSessionFactoryProcessor extends AbstractConfigurableComponent implements Processor {
|
||||
|
||||
|
@ -62,10 +61,8 @@ public abstract class AbstractSessionFactoryProcessor extends AbstractConfigurab
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the {@link ControllerServiceLookup} that was passed to the
|
||||
* @return the {@link ControllerServiceLookup} that was passed to the
|
||||
* {@link #init(ProcessorInitializationContext)} method
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected final ControllerServiceLookup getControllerServiceLookup() {
|
||||
return serviceLookup;
|
||||
|
@ -83,17 +80,15 @@ public abstract class AbstractSessionFactoryProcessor extends AbstractConfigurab
|
|||
/**
|
||||
* Provides subclasses the ability to perform initialization logic
|
||||
*
|
||||
* @param context
|
||||
* @param context in which to perform initialization
|
||||
*/
|
||||
protected void init(final ProcessorInitializationContext context) {
|
||||
// Provided for subclasses to override
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if the processor is scheduled to run,
|
||||
* @return <code>true</code> if the processor is scheduled to run,
|
||||
* <code>false</code> otherwise
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected final boolean isScheduled() {
|
||||
return scheduled;
|
||||
|
|
|
@ -21,9 +21,6 @@ import java.util.regex.Pattern;
|
|||
|
||||
public enum DataUnit {
|
||||
|
||||
// 1024 * 1024 =
|
||||
// 1024 * 1024 * 1024
|
||||
// 1024 * 1024 * 1024 * 1024
|
||||
/**
|
||||
* Bytes
|
||||
*/
|
||||
|
|
|
@ -35,8 +35,10 @@ public interface FlowFileFilter {
|
|||
* whether or not the Processor is interested in filtering additional
|
||||
* FlowFiles
|
||||
*
|
||||
* @param flowFile
|
||||
* @return
|
||||
* @param flowFile to apply the filter to
|
||||
* @return true if the given FlowFile should be selected and
|
||||
* if Processor is interested in filtering additional
|
||||
* FlowFiles
|
||||
*/
|
||||
FlowFileFilterResult filter(FlowFile flowFile);
|
||||
|
||||
|
|
|
@ -39,8 +39,8 @@ public interface ProcessContext {
|
|||
* Retrieves the current value set for the given descriptor, if a value is
|
||||
* set - else uses the descriptor to determine the appropriate default value
|
||||
*
|
||||
* @param descriptor
|
||||
* @return
|
||||
* @param descriptor to lookup the value of
|
||||
* @return the property value of the given descriptor
|
||||
*/
|
||||
PropertyValue getProperty(PropertyDescriptor descriptor);
|
||||
|
||||
|
@ -48,8 +48,8 @@ public interface ProcessContext {
|
|||
* Retrieves the current value set for the given descriptor, if a value is
|
||||
* set - else uses the descriptor to determine the appropriate default value
|
||||
*
|
||||
* @param propertyName
|
||||
* @return
|
||||
* @param propertyName of the property to lookup the value for
|
||||
* @return property value as retrieved by property name
|
||||
*/
|
||||
PropertyValue getProperty(String propertyName);
|
||||
|
||||
|
@ -57,8 +57,9 @@ public interface ProcessContext {
|
|||
* Creates and returns a {@link PropertyValue} object that can be used for
|
||||
* evaluating the value of the given String
|
||||
*
|
||||
* @param rawValue
|
||||
* @return
|
||||
* @param rawValue the raw input before any property evaluation has occurred
|
||||
* @return a {@link PropertyValue} object that can be used for
|
||||
* evaluating the value of the given String
|
||||
*/
|
||||
PropertyValue newPropertyValue(String rawValue);
|
||||
|
||||
|
@ -89,11 +90,9 @@ public interface ProcessContext {
|
|||
String getAnnotationData();
|
||||
|
||||
/**
|
||||
* Returns a Map of all PropertyDescriptors to their configured values. This
|
||||
* @return a Map of all PropertyDescriptors to their configured values. This
|
||||
* Map may or may not be modifiable, but modifying its values will not
|
||||
* change the values of the processor's properties
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Map<PropertyDescriptor, String> getProperties();
|
||||
|
||||
|
@ -101,8 +100,8 @@ public interface ProcessContext {
|
|||
* Encrypts the given value using the password provided in the NiFi
|
||||
* Properties
|
||||
*
|
||||
* @param unencrypted
|
||||
* @return
|
||||
* @param unencrypted plaintext value
|
||||
* @return encrypted value
|
||||
*/
|
||||
String encrypt(String unencrypted);
|
||||
|
||||
|
@ -110,19 +109,17 @@ public interface ProcessContext {
|
|||
* Decrypts the given value using the password provided in the NiFi
|
||||
* Properties
|
||||
*
|
||||
* @param encrypted
|
||||
* @return
|
||||
* @param encrypted the encrypted value
|
||||
* @return the plaintext value
|
||||
*/
|
||||
String decrypt(String encrypted);
|
||||
|
||||
/**
|
||||
* Provides a {@code ControllerServiceLookup} that can be used to obtain a
|
||||
* @return a {@code ControllerServiceLookup} that can be used to obtain a
|
||||
* Controller Service
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
ControllerServiceLookup getControllerServiceLookup();
|
||||
|
||||
|
||||
/**
|
||||
* @return the set of all relationships for which space is available to
|
||||
* receive new objects
|
||||
|
|
|
@ -60,7 +60,6 @@ import org.apache.nifi.provenance.ProvenanceReporter;
|
|||
* A process session instance may be used continuously. That is, after each
|
||||
* commit or rollback, the session can be used again.</p>
|
||||
*
|
||||
* @author unattributed
|
||||
*/
|
||||
public interface ProcessSession {
|
||||
|
||||
|
@ -136,7 +135,8 @@ public interface ProcessSession {
|
|||
* single call.
|
||||
*
|
||||
* @param maxResults the maximum number of FlowFiles to return
|
||||
* @return
|
||||
* @return up to <code>maxResults</code> FlowFiles from the work queue. If
|
||||
* no FlowFiles are available, returns an empty list. Will not return null.
|
||||
* @throws IllegalArgumentException if <code>maxResults</code> is less than
|
||||
* 0
|
||||
*/
|
||||
|
@ -152,8 +152,9 @@ public interface ProcessSession {
|
|||
* returned.
|
||||
* </p>
|
||||
*
|
||||
* @param filter
|
||||
* @return
|
||||
* @param filter to limit which flow files are returned
|
||||
* @return all FlowFiles from all of the incoming queues for which the given
|
||||
* {@link FlowFileFilter} indicates should be accepted.
|
||||
*/
|
||||
List<FlowFile> get(FlowFileFilter filter);
|
||||
|
||||
|
@ -170,7 +171,7 @@ public interface ProcessSession {
|
|||
* linkage to a parent FlowFile. This method is appropriate only when data
|
||||
* is received or created from an external system. Otherwise, this method
|
||||
* should be avoided and should instead use {@link #create(FlowFile)} or
|
||||
* {@link #create(Collection<FlowFile>)}.
|
||||
* {@see #create(Collection)}.
|
||||
*
|
||||
* When this method is used, a Provenance CREATE or RECEIVE Event should be
|
||||
* generated. See the {@link #getProvenanceReporter()} method and
|
||||
|
@ -188,8 +189,8 @@ public interface ProcessSession {
|
|||
* event, depending on whether or not other FlowFiles are generated from the
|
||||
* same parent before the ProcessSession is committed.
|
||||
*
|
||||
* @param parent
|
||||
* @return
|
||||
* @param parent to base the new flowfile on
|
||||
* @return newly created flowfile
|
||||
*/
|
||||
FlowFile create(FlowFile parent);
|
||||
|
||||
|
@ -201,8 +202,8 @@ public interface ProcessSession {
|
|||
* only a single parent exists). This method will automatically generate a
|
||||
* Provenance JOIN event.
|
||||
*
|
||||
* @param parents
|
||||
* @return
|
||||
* @param parents which the new flowfile should inherit shared attributes from
|
||||
* @return new flowfile
|
||||
*/
|
||||
FlowFile create(Collection<FlowFile> parents);
|
||||
|
||||
|
@ -239,9 +240,9 @@ public interface ProcessSession {
|
|||
* Event, if the offset is 0 and the size is exactly equal to the size of
|
||||
* the example FlowFile).
|
||||
*
|
||||
* @param example
|
||||
* @param offset
|
||||
* @param size
|
||||
* @param parent to base the new flowfile attributes on
|
||||
* @param offset of the parent flowfile to base the child flowfile content on
|
||||
* @param size of the new flowfile from the offset
|
||||
* @return a FlowFile with the specified size whose parent is first argument
|
||||
* to this function
|
||||
*
|
||||
|
@ -250,14 +251,14 @@ public interface ProcessSession {
|
|||
* the given FlowFile
|
||||
* @throws FlowFileHandlingException if the given FlowFile is already
|
||||
* transferred or removed or doesn't belong to this session, or if the
|
||||
* specified offset + size exceeds that of the size of the example FlowFile.
|
||||
* specified offset + size exceeds that of the size of the parent FlowFile.
|
||||
* Automatic rollback will occur.
|
||||
* @throws MissingFlowFileException if the given FlowFile content cannot be
|
||||
* found. The FlowFile should no longer be reference, will be internally
|
||||
* destroyed, and the session is automatically rolled back and what is left
|
||||
* of the FlowFile is destroyed.
|
||||
*/
|
||||
FlowFile clone(FlowFile example, long offset, long size);
|
||||
FlowFile clone(FlowFile parent, long offset, long size);
|
||||
|
||||
/**
|
||||
* Sets a penalty for the given FlowFile which will make it unavailable to
|
||||
|
@ -368,8 +369,8 @@ public interface ProcessSession {
|
|||
* destination processor will have immediate visibility of the transferred
|
||||
* FlowFiles within the session.
|
||||
*
|
||||
* @param flowFile
|
||||
* @param relationship
|
||||
* @param flowFile to transfer
|
||||
* @param relationship to transfer to
|
||||
* @throws IllegalStateException if detected that this method is being
|
||||
* called from within a callback of another method in this session and for
|
||||
* the given FlowFile(s)
|
||||
|
@ -389,7 +390,7 @@ public interface ProcessSession {
|
|||
* the FlowFile will be maintained. FlowFiles that are created by the
|
||||
* processor cannot be transferred back to themselves via this method.
|
||||
*
|
||||
* @param flowFile
|
||||
* @param flowFile to transfer
|
||||
* @throws IllegalStateException if detected that this method is being
|
||||
* called from within a callback of another method in this session and for
|
||||
* the given FlowFile(s)
|
||||
|
@ -410,7 +411,7 @@ public interface ProcessSession {
|
|||
* created by the processor cannot be transferred back to themselves via
|
||||
* this method.
|
||||
*
|
||||
* @param flowFiles
|
||||
* @param flowFiles to transfer
|
||||
* @throws IllegalStateException if detected that this method is being
|
||||
* called from within a callback of another method in this session and for
|
||||
* the given FlowFile(s)
|
||||
|
@ -435,8 +436,8 @@ public interface ProcessSession {
|
|||
* destination processor will have immediate visibility of the transferred
|
||||
* FlowFiles within the session.
|
||||
*
|
||||
* @param flowFiles
|
||||
* @param relationship
|
||||
* @param flowFiles to transfer
|
||||
* @param relationship to transfer to
|
||||
* @throws IllegalStateException if detected that this method is being
|
||||
* called from within a callback of another method in this session and for
|
||||
* the given FlowFile(s)
|
||||
|
@ -455,7 +456,7 @@ public interface ProcessSession {
|
|||
* nothing else references it and this FlowFile will no longer be available
|
||||
* for further operation.
|
||||
*
|
||||
* @param flowFile
|
||||
* @param flowFile to remove
|
||||
* @throws IllegalStateException if detected that this method is being
|
||||
* called from within a callback of another method in this session and for
|
||||
* the given FlowFile(s)
|
||||
|
@ -471,7 +472,7 @@ public interface ProcessSession {
|
|||
* nothing else references it and this FlowFile will no longer be available
|
||||
* for further operation.
|
||||
*
|
||||
* @param flowFiles
|
||||
* @param flowFiles to remove
|
||||
* @throws IllegalStateException if detected that this method is being
|
||||
* called from within a callback of another method in this session and for
|
||||
* the given FlowFile(s)
|
||||
|
@ -484,12 +485,12 @@ public interface ProcessSession {
|
|||
/**
|
||||
* Executes the given callback against the contents corresponding to the
|
||||
* given FlowFile.
|
||||
*
|
||||
* <i>Note</i>: The OutputStream provided to the given OutputStreamCallback
|
||||
*
|
||||
* <i>Note</i>: The OutputStream provided to the given OutputStreamCallback
|
||||
* will not be accessible once this method has completed its execution.
|
||||
*
|
||||
* @param source
|
||||
* @param reader
|
||||
* @param source flowfile to retrieve content of
|
||||
* @param reader that will be called to read the flowfile content
|
||||
* @throws IllegalStateException if detected that this method is being
|
||||
* called from within a callback of another method in this session and for
|
||||
* the given FlowFile(s)
|
||||
|
@ -501,7 +502,7 @@ public interface ProcessSession {
|
|||
* destroyed, and the session is automatically rolled back and what is left
|
||||
* of the FlowFile is destroyed.
|
||||
* @throws FlowFileAccessException if some IO problem occurs accessing
|
||||
* FlowFile content; if an attempt is made to access the InputStream
|
||||
* FlowFile content; if an attempt is made to access the InputStream
|
||||
* provided to the given InputStreamCallback after this method completed its
|
||||
* execution
|
||||
*/
|
||||
|
@ -511,8 +512,8 @@ public interface ProcessSession {
|
|||
* Combines the content of all given source FlowFiles into a single given
|
||||
* destination FlowFile.
|
||||
*
|
||||
* @param sources
|
||||
* @param destination
|
||||
* @param sources the flowfiles to merge
|
||||
* @param destination the flowfile to use as the merged result
|
||||
* @return updated destination FlowFile (new size, etc...)
|
||||
* @throws IllegalStateException if detected that this method is being
|
||||
* called from within a callback of another method in this session and for
|
||||
|
@ -536,8 +537,8 @@ public interface ProcessSession {
|
|||
* Combines the content of all given source FlowFiles into a single given
|
||||
* destination FlowFile.
|
||||
*
|
||||
* @param sources
|
||||
* @param destination
|
||||
* @param sources to merge together
|
||||
* @param destination to merge to
|
||||
* @param header bytes that will be added to the beginning of the merged
|
||||
* output. May be null or empty.
|
||||
* @param footer bytes that will be added to the end of the merged output.
|
||||
|
@ -566,12 +567,12 @@ public interface ProcessSession {
|
|||
/**
|
||||
* Executes the given callback against the content corresponding to the
|
||||
* given FlowFile.
|
||||
*
|
||||
* <i>Note</i>: The OutputStream provided to the given OutputStreamCallback
|
||||
* will not be accessible once this method has completed its execution.
|
||||
*
|
||||
* @param source
|
||||
* @param writer
|
||||
* <i>Note</i>: The OutputStream provided to the given OutputStreamCallback
|
||||
* will not be accessible once this method has completed its execution.
|
||||
*
|
||||
* @param source to write to
|
||||
* @param writer used to write new content
|
||||
* @return updated FlowFile
|
||||
* @throws IllegalStateException if detected that this method is being
|
||||
* called from within a callback of another method in this session and for
|
||||
|
@ -584,8 +585,8 @@ public interface ProcessSession {
|
|||
* destroyed, and the session is automatically rolled back and what is left
|
||||
* of the FlowFile is destroyed.
|
||||
* @throws FlowFileAccessException if some IO problem occurs accessing
|
||||
* FlowFile content; if an attempt is made to access the OutputStream
|
||||
* provided to the given OutputStreamCallaback after this method completed
|
||||
* FlowFile content; if an attempt is made to access the OutputStream
|
||||
* provided to the given OutputStreamCallaback after this method completed
|
||||
* its execution
|
||||
*/
|
||||
FlowFile write(FlowFile source, OutputStreamCallback writer) throws FlowFileAccessException;
|
||||
|
@ -593,13 +594,13 @@ public interface ProcessSession {
|
|||
/**
|
||||
* Executes the given callback against the content corresponding to the
|
||||
* given flow file.
|
||||
*
|
||||
* <i>Note</i>: The InputStream & OutputStream provided to the given
|
||||
* StreamCallback will not be accessible once this method has completed its
|
||||
* execution.
|
||||
*
|
||||
* @param source
|
||||
* @param writer
|
||||
* <i>Note</i>: The InputStream & OutputStream provided to the given
|
||||
* StreamCallback will not be accessible once this method has completed its
|
||||
* execution.
|
||||
*
|
||||
* @param source to read from and write to
|
||||
* @param writer used to read the old content and write new content
|
||||
* @return updated FlowFile
|
||||
* @throws IllegalStateException if detected that this method is being
|
||||
* called from within a callback of another method in this session and for
|
||||
|
@ -612,8 +613,8 @@ public interface ProcessSession {
|
|||
* destroyed, and the session is automatically rolled back and what is left
|
||||
* of the FlowFile is destroyed.
|
||||
* @throws FlowFileAccessException if some IO problem occurs accessing
|
||||
* FlowFile content; if an attempt is made to access the InputStream or
|
||||
* OutputStream provided to the given StreamCallback after this method
|
||||
* FlowFile content; if an attempt is made to access the InputStream or
|
||||
* OutputStream provided to the given StreamCallback after this method
|
||||
* completed its execution
|
||||
*/
|
||||
FlowFile write(FlowFile source, StreamCallback writer) throws FlowFileAccessException;
|
||||
|
@ -622,16 +623,16 @@ public interface ProcessSession {
|
|||
* Executes the given callback against the content corresponding to the
|
||||
* given FlowFile, such that any data written to the OutputStream of the
|
||||
* content will be appended to the end of FlowFile.
|
||||
*
|
||||
* <i>Note</i>: The OutputStream provided to the given OutputStreamCallback
|
||||
*
|
||||
* <i>Note</i>: The OutputStream provided to the given OutputStreamCallback
|
||||
* will not be accessible once this method has completed its execution.
|
||||
*
|
||||
* @param source
|
||||
* @param writer
|
||||
* @return
|
||||
* @throws FlowFileAccessException if an attempt is made to access the
|
||||
* OutputStream provided to the given OutputStreamCallaback after this method
|
||||
* completed its execution
|
||||
* @param source the flowfile for which content should be appended
|
||||
* @param writer used to write new bytes to the flowfile content
|
||||
* @return the updated flowfile reference for the new content
|
||||
* @throws FlowFileAccessException if an attempt is made to access the
|
||||
* OutputStream provided to the given OutputStreamCallaback after this
|
||||
* method completed its execution
|
||||
*/
|
||||
FlowFile append(FlowFile source, OutputStreamCallback writer) throws FlowFileAccessException;
|
||||
|
||||
|
@ -687,8 +688,8 @@ public interface ProcessSession {
|
|||
/**
|
||||
* Writes the content of the given FlowFile to the given destination path.
|
||||
*
|
||||
* @param flowFile
|
||||
* @param destination
|
||||
* @param flowFile to export the content of
|
||||
* @param destination to export the content to
|
||||
* @param append if true will append to the current content at the given
|
||||
* path; if false will replace any current content
|
||||
* @throws IllegalStateException if detected that this method is being
|
||||
|
@ -709,8 +710,8 @@ public interface ProcessSession {
|
|||
/**
|
||||
* Writes the content of the given FlowFile to the given destination stream
|
||||
*
|
||||
* @param flowFile
|
||||
* @param destination
|
||||
* @param flowFile to export the content of
|
||||
* @param destination to export the content to
|
||||
* @throws IllegalStateException if detected that this method is being
|
||||
* called from within a callback of another method in this session and for
|
||||
* the given FlowFile(s)
|
||||
|
@ -729,7 +730,7 @@ public interface ProcessSession {
|
|||
/**
|
||||
* Returns a ProvenanceReporter that is tied to this ProcessSession.
|
||||
*
|
||||
* @return
|
||||
* @return the provenance reporter
|
||||
*/
|
||||
ProvenanceReporter getProvenanceReporter();
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ public interface Processor extends ConfigurableComponent {
|
|||
* Provides the processor with access to objects that may be of use
|
||||
* throughout the life of the Processor
|
||||
*
|
||||
* @param context
|
||||
* @param context of initialization
|
||||
*/
|
||||
void initialize(ProcessorInitializationContext context);
|
||||
|
||||
|
|
|
@ -29,25 +29,19 @@ import org.apache.nifi.logging.ProcessorLog;
|
|||
public interface ProcessorInitializationContext {
|
||||
|
||||
/**
|
||||
* Returns the unique identifier for this processor
|
||||
*
|
||||
* @return
|
||||
* @return the unique identifier for this processor
|
||||
*/
|
||||
String getIdentifier();
|
||||
|
||||
/**
|
||||
* Returns a {@link ProcessorLog} that is tied to this processor that can be
|
||||
* @return a {@link ProcessorLog} that is tied to this processor that can be
|
||||
* used to log events
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
ProcessorLog getLogger();
|
||||
|
||||
/**
|
||||
* Returns the {@link ControllerServiceLookup} which can be used to obtain
|
||||
* @return the {@link ControllerServiceLookup} which can be used to obtain
|
||||
* Controller Services
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
ControllerServiceLookup getControllerServiceLookup();
|
||||
}
|
||||
|
|
|
@ -28,7 +28,8 @@ import java.lang.annotation.Target;
|
|||
* provided. This description can be provided to a user in logs, UI, etc.
|
||||
*
|
||||
* @author none
|
||||
* @deprecated This Annotation has been replaced by the {@link org.apache.nifi.annotation.documentation.CapabilityDescription}
|
||||
* @deprecated This Annotation has been replaced by the
|
||||
* {@link org.apache.nifi.annotation.documentation.CapabilityDescription}
|
||||
* annotation.
|
||||
*/
|
||||
@Documented
|
||||
|
|
|
@ -39,8 +39,8 @@ import java.lang.annotation.Target;
|
|||
* </p>
|
||||
*
|
||||
* @author none
|
||||
* @deprecated This Annotation has been replaced by the {@link org.apache.nifi.annotation.behavior.EventDriven}
|
||||
* annotation.
|
||||
* @deprecated This Annotation has been replaced by the
|
||||
* {@link org.apache.nifi.annotation.behavior.EventDriven} annotation.
|
||||
*/
|
||||
@Documented
|
||||
@Target({ElementType.TYPE})
|
||||
|
|
|
@ -32,7 +32,8 @@ import java.lang.annotation.Target;
|
|||
* be added to the graph.
|
||||
*
|
||||
* @author none
|
||||
* @deprecated This Annotation has been replaced by the {@link org.apache.nifi.annotation.lifecycle.OnAdded} annotation.
|
||||
* @deprecated This Annotation has been replaced by the
|
||||
* {@link org.apache.nifi.annotation.lifecycle.OnAdded} annotation.
|
||||
*/
|
||||
@Documented
|
||||
@Target({ElementType.METHOD})
|
||||
|
|
|
@ -33,7 +33,8 @@ import java.lang.annotation.Target;
|
|||
* be removed from the graph.
|
||||
*
|
||||
* @author none
|
||||
* @deprecated This Annotation has been replaced by the {@link org.apache.nifi.annotation.lifecycle.OnRemoved} annotation.
|
||||
* @deprecated This Annotation has been replaced by the
|
||||
* {@link org.apache.nifi.annotation.lifecycle.OnRemoved} annotation.
|
||||
*/
|
||||
@Documented
|
||||
@Target({ElementType.METHOD})
|
||||
|
|
|
@ -35,8 +35,9 @@ import java.lang.annotation.Target;
|
|||
* be scheduled to run.
|
||||
*
|
||||
* @author none
|
||||
* @deprecated This Annotation has been replaced by the {@link org.apache.nifi.annotation.lifecycle.OnScheduled} annotation.
|
||||
*/
|
||||
* @deprecated This Annotation has been replaced by the
|
||||
* {@link org.apache.nifi.annotation.lifecycle.OnScheduled} annotation.
|
||||
*/
|
||||
@Documented
|
||||
@Target({ElementType.METHOD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
|
|
|
@ -29,7 +29,8 @@ import java.lang.annotation.Target;
|
|||
* most once for each processor instance in a process lifetime.
|
||||
*
|
||||
* @author none
|
||||
* @deprecated This Annotation has been replaced by the {@link org.apache.nifi.annotation.lifecycle.OnShutdown} annotation.
|
||||
* @deprecated This Annotation has been replaced by the
|
||||
* {@link org.apache.nifi.annotation.lifecycle.OnShutdown} annotation.
|
||||
*/
|
||||
@Documented
|
||||
@Target({ElementType.METHOD})
|
||||
|
|
|
@ -46,7 +46,8 @@ import java.lang.annotation.Target;
|
|||
* </p>
|
||||
*
|
||||
* @author none
|
||||
* @deprecated This Annotation has been replaced by the {@link org.apache.nifi.annotation.lifecycle.OnStopped} annotation.
|
||||
* @deprecated This Annotation has been replaced by the
|
||||
* {@link org.apache.nifi.annotation.lifecycle.OnStopped} annotation.
|
||||
*/
|
||||
@Documented
|
||||
@Target({ElementType.METHOD})
|
||||
|
|
|
@ -37,7 +37,8 @@ import java.lang.annotation.Target;
|
|||
* be scheduled to run.
|
||||
*
|
||||
* @author none
|
||||
* @deprecated This Annotation has been replaced by the {@link org.apache.nifi.annotation.lifecycle.OnUnscheduled} annotation.
|
||||
* @deprecated This Annotation has been replaced by the
|
||||
* {@link org.apache.nifi.annotation.lifecycle.OnUnscheduled} annotation.
|
||||
*/
|
||||
@Documented
|
||||
@Target({ElementType.METHOD})
|
||||
|
|
|
@ -36,7 +36,8 @@ import java.lang.annotation.Target;
|
|||
* repeated (implied idempotent behavior).
|
||||
*
|
||||
* @author none
|
||||
* @deprecated This Annotation has been replaced by the {@link org.apache.nifi.annotation.behavior.SideEffectFree} annotation.
|
||||
* @deprecated This Annotation has been replaced by the
|
||||
* {@link org.apache.nifi.annotation.behavior.SideEffectFree} annotation.
|
||||
*/
|
||||
@Documented
|
||||
@Target({ElementType.TYPE})
|
||||
|
|
|
@ -41,7 +41,8 @@ import java.lang.annotation.Target;
|
|||
* from a remote source.
|
||||
*
|
||||
* @author none
|
||||
* @deprecated This Annotation has been replaced by the {@link org.apache.nifi.annotation.behavior.SupportsBatching} annotation.
|
||||
* @deprecated This Annotation has been replaced by the
|
||||
* {@link org.apache.nifi.annotation.behavior.SupportsBatching} annotation.
|
||||
*/
|
||||
@Documented
|
||||
@Target({ElementType.TYPE})
|
||||
|
|
|
@ -29,9 +29,8 @@ import java.lang.annotation.Target;
|
|||
* any way but serve as additional documentation and can be used to sort/filter
|
||||
* Processors.
|
||||
*
|
||||
* @author none
|
||||
* @deprecated This Annotation has been replaced by the {@link org.apache.nifi.annotation.documentation.Tags}
|
||||
* annotation.
|
||||
* @deprecated This Annotation has been replaced by the
|
||||
* {@link org.apache.nifi.annotation.documentation.Tags} annotation.
|
||||
*/
|
||||
@Documented
|
||||
@Target({ElementType.TYPE})
|
||||
|
@ -40,8 +39,5 @@ import java.lang.annotation.Target;
|
|||
@Deprecated
|
||||
public @interface Tags {
|
||||
|
||||
/**
|
||||
* @return all tag values associated with the given processor
|
||||
*/
|
||||
public String[] value();
|
||||
}
|
||||
|
|
|
@ -30,8 +30,9 @@ import java.lang.annotation.Target;
|
|||
* execution.
|
||||
*
|
||||
* @author none
|
||||
* @deprecated This Annotation has been replaced by the {@link org.apache.nifi.annotation.behavior.TriggerSerially} annotation.
|
||||
*/
|
||||
* @deprecated This Annotation has been replaced by the
|
||||
* {@link org.apache.nifi.annotation.behavior.TriggerSerially} annotation.
|
||||
*/
|
||||
@Documented
|
||||
@Target({ElementType.TYPE})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
|
|
|
@ -30,7 +30,9 @@ import java.lang.annotation.Target;
|
|||
* destinations report that they have available space.
|
||||
*
|
||||
* @author none
|
||||
* @deprecated This Annotation has been replaced by the {@link org.apache.nifi.annotation.behavior.TriggerWhenAnyDestinationAvailable} annotation.
|
||||
* @deprecated This Annotation has been replaced by the
|
||||
* {@link org.apache.nifi.annotation.behavior.TriggerWhenAnyDestinationAvailable}
|
||||
* annotation.
|
||||
*/
|
||||
@Documented
|
||||
@Target({ElementType.TYPE})
|
||||
|
|
|
@ -32,7 +32,8 @@ import java.lang.annotation.Target;
|
|||
* their queue or they present this annotation.
|
||||
*
|
||||
* @author none
|
||||
* @deprecated This Annotation has been replaced by the {@link org.apache.nifi.annotation.behavior.TriggerWhenEmpty} annotation.
|
||||
* @deprecated This Annotation has been replaced by the
|
||||
* {@link org.apache.nifi.annotation.behavior.TriggerWhenEmpty} annotation.
|
||||
*/
|
||||
@Documented
|
||||
@Target({ElementType.TYPE})
|
||||
|
|
|
@ -30,8 +30,8 @@ public interface InputStreamCallback {
|
|||
* automatically opened and closed though it is ok to close the stream
|
||||
* manually.
|
||||
*
|
||||
* @param in
|
||||
* @throws IOException
|
||||
* @param in the stream to read bytes from
|
||||
* @throws IOException if issues reading from the underlying stream
|
||||
*/
|
||||
void process(InputStream in) throws IOException;
|
||||
|
||||
|
|
|
@ -31,8 +31,8 @@ public interface OutputStreamCallback {
|
|||
* manually - and quite important if any streams wrapping these streams open
|
||||
* resources which should be cleared.
|
||||
*
|
||||
* @param out
|
||||
* @throws IOException
|
||||
* @param out the stream to write bytes to
|
||||
* @throws IOException if issues writing to output stream
|
||||
*/
|
||||
void process(OutputStream out) throws IOException;
|
||||
|
||||
|
|
|
@ -20,10 +20,6 @@ import java.io.IOException;
|
|||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author unattributed
|
||||
*/
|
||||
public interface StreamCallback {
|
||||
|
||||
/**
|
||||
|
@ -32,9 +28,9 @@ public interface StreamCallback {
|
|||
* manually - and quite important if any streams wrapping these streams open
|
||||
* resources which should be cleared.
|
||||
*
|
||||
* @param in
|
||||
* @param out
|
||||
* @throws IOException
|
||||
* @param in the stream to read bytes from
|
||||
* @param out the stream to write bytes to
|
||||
* @throws IOException if issues occur reading or writing the underlying streams
|
||||
*/
|
||||
void process(InputStream in, OutputStream out) throws IOException;
|
||||
|
||||
|
|
|
@ -28,8 +28,8 @@ public interface ProvenanceEventBuilder {
|
|||
/**
|
||||
* Sets the type of {@link ProvenanceEventRecord}
|
||||
*
|
||||
* @param eventType
|
||||
* @return
|
||||
* @param eventType of the event
|
||||
* @return the builder
|
||||
*/
|
||||
ProvenanceEventBuilder setEventType(ProvenanceEventType eventType);
|
||||
|
||||
|
@ -38,15 +38,15 @@ public interface ProvenanceEventBuilder {
|
|||
* given event
|
||||
*
|
||||
* @param event the event from which to populate the Builders values
|
||||
* @return
|
||||
* @return the builder
|
||||
*/
|
||||
ProvenanceEventBuilder fromEvent(ProvenanceEventRecord event);
|
||||
|
||||
/**
|
||||
* Sets the date and time at which the FlowFile entered the flow
|
||||
*
|
||||
* @param entryDate
|
||||
* @return
|
||||
* @param entryDate of the flow file
|
||||
* @return the builder
|
||||
*/
|
||||
ProvenanceEventBuilder setFlowFileEntryDate(long entryDate);
|
||||
|
||||
|
@ -54,8 +54,8 @@ public interface ProvenanceEventBuilder {
|
|||
* Sets the Lineage Identifiers. This is a set of all FlowFile UUID's that
|
||||
* were involved in making this event occur.
|
||||
*
|
||||
* @param lineageIdentifiers
|
||||
* @return
|
||||
* @param lineageIdentifiers of the flowfiles in this event
|
||||
* @return the builder
|
||||
*/
|
||||
ProvenanceEventBuilder setLineageIdentifiers(Set<String> lineageIdentifiers);
|
||||
|
||||
|
@ -63,12 +63,12 @@ public interface ProvenanceEventBuilder {
|
|||
* Sets the Content Claim that the FlowFile was previously associated with
|
||||
* before this event occurred.
|
||||
*
|
||||
* @param container
|
||||
* @param section
|
||||
* @param identifier
|
||||
* @param offset
|
||||
* @param size
|
||||
* @return
|
||||
* @param container for previous content
|
||||
* @param section for previous content
|
||||
* @param identifier for previous content
|
||||
* @param offset for previous content
|
||||
* @param size for previous content
|
||||
* @return the builder
|
||||
*/
|
||||
ProvenanceEventBuilder setPreviousContentClaim(String container, String section, String identifier, Long offset, long size);
|
||||
|
||||
|
@ -76,12 +76,12 @@ public interface ProvenanceEventBuilder {
|
|||
* Sets the Content Claim that the FlowFile is associated with as a result
|
||||
* of this event
|
||||
*
|
||||
* @param container
|
||||
* @param section
|
||||
* @param identifier
|
||||
* @param offset
|
||||
* @param size
|
||||
* @return
|
||||
* @param container for resulting content
|
||||
* @param section for resulting content
|
||||
* @param identifier for resulting content
|
||||
* @param offset for resulting content
|
||||
* @param size for resulting content
|
||||
* @return the builder
|
||||
*/
|
||||
ProvenanceEventBuilder setCurrentContentClaim(String container, String section, String identifier, Long offset, long size);
|
||||
|
||||
|
@ -89,8 +89,8 @@ public interface ProvenanceEventBuilder {
|
|||
* Sets the identifier of the FlowFile Queue from which the FlowFile was
|
||||
* pulled
|
||||
*
|
||||
* @param identifier
|
||||
* @return
|
||||
* @param identifier of the source queue
|
||||
* @return the builder
|
||||
*/
|
||||
ProvenanceEventBuilder setSourceQueueIdentifier(String identifier);
|
||||
|
||||
|
@ -99,28 +99,28 @@ public interface ProvenanceEventBuilder {
|
|||
* occurred and any attributes that were added or updated as a result of
|
||||
* this event.
|
||||
*
|
||||
* @param previousAttributes
|
||||
* @param previousAttributes Map of all attributes before the event occurred
|
||||
* @param updatedAttributes Map containing all attributes that were added or
|
||||
* updated. If any entry has a value of <code>null</code>, that attribute is
|
||||
* considered removed
|
||||
*
|
||||
* @return
|
||||
* @return the builder
|
||||
*/
|
||||
ProvenanceEventBuilder setAttributes(Map<String, String> previousAttributes, Map<String, String> updatedAttributes);
|
||||
|
||||
/**
|
||||
* Sets the UUID to associate with the FlowFile
|
||||
*
|
||||
* @param uuid
|
||||
* @return
|
||||
* @param uuid of the flowfile
|
||||
* @return the builder
|
||||
*/
|
||||
ProvenanceEventBuilder setFlowFileUUID(String uuid);
|
||||
|
||||
/**
|
||||
* Sets the time at which the Provenance Event took place
|
||||
*
|
||||
* @param eventTime
|
||||
* @return
|
||||
* @param eventTime time of the event
|
||||
* @return the builder
|
||||
*/
|
||||
ProvenanceEventBuilder setEventTime(long eventTime);
|
||||
|
||||
|
@ -128,16 +128,16 @@ public interface ProvenanceEventBuilder {
|
|||
* Sets the amount of time that was required in order to perform the
|
||||
* function referred to by this event
|
||||
*
|
||||
* @param millis
|
||||
* @return
|
||||
* @param millis of the event
|
||||
* @return the builder
|
||||
*/
|
||||
ProvenanceEventBuilder setEventDuration(long millis);
|
||||
|
||||
/**
|
||||
* Sets the time at which the FlowFile's lineage began
|
||||
*
|
||||
* @param startDate
|
||||
* @return
|
||||
* @param startDate start date of the event
|
||||
* @return the builder
|
||||
*/
|
||||
ProvenanceEventBuilder setLineageStartDate(long startDate);
|
||||
|
||||
|
@ -145,8 +145,8 @@ public interface ProvenanceEventBuilder {
|
|||
* Sets the unique identifier of the NiFi Component (such as a
|
||||
* {@link Processor}) that is generating the Event
|
||||
*
|
||||
* @param componentId
|
||||
* @return
|
||||
* @param componentId that produced the event
|
||||
* @return the builder
|
||||
*/
|
||||
ProvenanceEventBuilder setComponentId(String componentId);
|
||||
|
||||
|
@ -154,8 +154,8 @@ public interface ProvenanceEventBuilder {
|
|||
* Sets the type of the Component that is generating the Event. For
|
||||
* {@link Processor}s, this is the Simple Class Name of the Processor.
|
||||
*
|
||||
* @param componentType
|
||||
* @return
|
||||
* @param componentType of the component that made the event
|
||||
* @return the builder
|
||||
*/
|
||||
ProvenanceEventBuilder setComponentType(String componentType);
|
||||
|
||||
|
@ -167,8 +167,8 @@ public interface ProvenanceEventBuilder {
|
|||
* and {@link ProvenanceEventType#SEND} and will be ignored for any other
|
||||
* event types.
|
||||
*
|
||||
* @param sourceSystemFlowFileIdentifier
|
||||
* @return
|
||||
* @param sourceSystemFlowFileIdentifier identifier the remote system used
|
||||
* @return the builder
|
||||
*/
|
||||
ProvenanceEventBuilder setSourceSystemFlowFileIdentifier(String sourceSystemFlowFileIdentifier);
|
||||
|
||||
|
@ -184,8 +184,8 @@ public interface ProvenanceEventBuilder {
|
|||
* and {@link ProvenanceEventType#SEND} and will be ignored for any other
|
||||
* event types.
|
||||
*
|
||||
* @param transitUri
|
||||
* @return
|
||||
* @param transitUri of the event
|
||||
* @return the builder
|
||||
*/
|
||||
ProvenanceEventBuilder setTransitUri(String transitUri);
|
||||
|
||||
|
@ -194,13 +194,13 @@ public interface ProvenanceEventBuilder {
|
|||
* {@link ProvenanceEventType#FORK}, {@link ProvenanceEventType#JOIN}, and
|
||||
* {@link ProvenanceEventType#CLONE}
|
||||
*
|
||||
* This is valid only for null null null null null {@link ProvenanceEventType#SPAWN},
|
||||
* This is valid only for {@link ProvenanceEventType#SPAWN},
|
||||
* {@link ProvenanceEventType#FORK}, {@link ProvenanceEventType#JOIN}, and
|
||||
* {@link ProvenanceEventType#CLONE} events and will be ignored for any
|
||||
* other event types.
|
||||
*
|
||||
* @param parent
|
||||
* @return
|
||||
* @param parent flowfile that this event is derived from
|
||||
* @return the builder
|
||||
*/
|
||||
ProvenanceEventBuilder addParentFlowFile(FlowFile parent);
|
||||
|
||||
|
@ -209,13 +209,13 @@ public interface ProvenanceEventBuilder {
|
|||
* {@link ProvenanceEventType#FORK}, {@link ProvenanceEventType#JOIN}, and
|
||||
* {@link ProvenanceEventType#CLONE}
|
||||
*
|
||||
* This is valid only for null null null null null {@link ProvenanceEventType#SPAWN},
|
||||
* This is valid only for {@link ProvenanceEventType#SPAWN},
|
||||
* {@link ProvenanceEventType#FORK}, {@link ProvenanceEventType#JOIN}, and
|
||||
* {@link ProvenanceEventType#CLONE} events and will be ignored for any
|
||||
* other event types.
|
||||
*
|
||||
* @param parent
|
||||
* @return
|
||||
* @param parent previous parent of this event
|
||||
* @return the builder
|
||||
*/
|
||||
ProvenanceEventBuilder removeParentFlowFile(FlowFile parent);
|
||||
|
||||
|
@ -224,13 +224,13 @@ public interface ProvenanceEventBuilder {
|
|||
* {@link ProvenanceEventType#FORK}, {@link ProvenanceEventType#JOIN}, and
|
||||
* {@link ProvenanceEventType#CLONE}
|
||||
*
|
||||
* This is valid only for null null null null null {@link ProvenanceEventType#SPAWN},
|
||||
* This is valid only for {@link ProvenanceEventType#SPAWN},
|
||||
* {@link ProvenanceEventType#FORK}, {@link ProvenanceEventType#JOIN}, and
|
||||
* {@link ProvenanceEventType#CLONE} events and will be ignored for any
|
||||
* other event types.
|
||||
*
|
||||
* @param child
|
||||
* @return
|
||||
* @param child the child to add
|
||||
* @return the builder
|
||||
*/
|
||||
ProvenanceEventBuilder addChildFlowFile(FlowFile child);
|
||||
|
||||
|
@ -239,13 +239,13 @@ public interface ProvenanceEventBuilder {
|
|||
* {@link ProvenanceEventType#FORK}, {@link ProvenanceEventType#JOIN}, and
|
||||
* {@link ProvenanceEventType#CLONE}
|
||||
*
|
||||
* This is valid only for null null null null null {@link ProvenanceEventType#SPAWN},
|
||||
* This is valid only for {@link ProvenanceEventType#SPAWN},
|
||||
* {@link ProvenanceEventType#FORK}, {@link ProvenanceEventType#JOIN}, and
|
||||
* {@link ProvenanceEventType#CLONE} events and will be ignored for any
|
||||
* other event types.
|
||||
*
|
||||
* @param child
|
||||
* @return
|
||||
* @param child to remove
|
||||
* @return the builder
|
||||
*/
|
||||
ProvenanceEventBuilder removeChildFlowFile(FlowFile child);
|
||||
|
||||
|
@ -259,8 +259,8 @@ public interface ProvenanceEventBuilder {
|
|||
* This is valid only for {@link ProvenanceEventType#ADDINFO} events and
|
||||
* will be ignored for any other event types.
|
||||
*
|
||||
* @param alternateIdentifierUri
|
||||
* @return
|
||||
* @param alternateIdentifierUri another identifier of the flowfile this event is for
|
||||
* @return the builder
|
||||
*/
|
||||
ProvenanceEventBuilder setAlternateIdentifierUri(String alternateIdentifierUri);
|
||||
|
||||
|
@ -268,8 +268,8 @@ public interface ProvenanceEventBuilder {
|
|||
* Sets the details for this event. This is a free-form String that can
|
||||
* contain any information that is relevant to this event.
|
||||
*
|
||||
* @param details
|
||||
* @return
|
||||
* @param details a description of the event
|
||||
* @return the builder
|
||||
*/
|
||||
ProvenanceEventBuilder setDetails(String details);
|
||||
|
||||
|
@ -279,8 +279,8 @@ public interface ProvenanceEventBuilder {
|
|||
* {@link ProvenanceEventType#ROUTE} events and will be ignored for any
|
||||
* other event types.
|
||||
*
|
||||
* @param relationship
|
||||
* @return
|
||||
* @param relationship to which flowfiles in this event were routed
|
||||
* @return the builder
|
||||
*/
|
||||
ProvenanceEventBuilder setRelationship(Relationship relationship);
|
||||
|
||||
|
@ -288,8 +288,8 @@ public interface ProvenanceEventBuilder {
|
|||
* Populates the builder with as much information as it can from the given
|
||||
* FlowFile
|
||||
*
|
||||
* @param flowFile
|
||||
* @return
|
||||
* @param flowFile to source attributes for this event from
|
||||
* @return the builder
|
||||
*/
|
||||
ProvenanceEventBuilder fromFlowFile(FlowFile flowFile);
|
||||
|
||||
|
@ -301,7 +301,7 @@ public interface ProvenanceEventBuilder {
|
|||
* depend on the {@link ProvevenanceEventRepository} to generate the unique
|
||||
* identifier.
|
||||
*
|
||||
* @return
|
||||
* @return the event
|
||||
*/
|
||||
ProvenanceEventRecord build();
|
||||
|
||||
|
|
|
@ -26,26 +26,20 @@ import java.util.Set;
|
|||
public interface ProvenanceEventRecord {
|
||||
|
||||
/**
|
||||
* Returns a unique ID for this Provenance Event. Depending on the
|
||||
* @return a unique ID for this Provenance Event. Depending on the
|
||||
* implementation, the Event ID may be set to -1 until the event has been
|
||||
* added to the {@link ProvenanceEventRepository}
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
long getEventId();
|
||||
|
||||
/**
|
||||
* Returns the time at which this Provenance Event was created, as the
|
||||
* @return the time at which this Provenance Event was created, as the
|
||||
* number of milliseconds since epoch
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
long getEventTime();
|
||||
|
||||
/**
|
||||
* Returns the EntryDate of the FlowFile to which this Event is associated
|
||||
*
|
||||
* @return
|
||||
* @return the EntryDate of the FlowFile to which this Event is associated
|
||||
*/
|
||||
long getFlowFileEntryDate();
|
||||
|
||||
|
@ -61,236 +55,181 @@ public interface ProvenanceEventRecord {
|
|||
Set<String> getLineageIdentifiers();
|
||||
|
||||
/**
|
||||
* Returns the size of the FlowFile to which this Event is associated
|
||||
*
|
||||
* @return
|
||||
* @return the size of the FlowFile to which this Event is associated
|
||||
*/
|
||||
long getFileSize();
|
||||
|
||||
/**
|
||||
* Returns the previous size of the FlowFile to which this Event is
|
||||
* @return the previous size of the FlowFile to which this Event is
|
||||
* associated, if the FlowFile previously had content and its size was
|
||||
* known; otherwise, returns <code>null</code>
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Long getPreviousFileSize();
|
||||
|
||||
/**
|
||||
* Returns the amount of time in milliseconds that elapsed while performing
|
||||
* this event. If not populated, the value -1 will be returned.
|
||||
*
|
||||
* @return
|
||||
* @return the amount of time in milliseconds that elapsed while performing
|
||||
* this event. If not populated, the value -1 will be returned
|
||||
*/
|
||||
long getEventDuration();
|
||||
|
||||
/**
|
||||
* Returns the type of this Provenance Event
|
||||
*
|
||||
* @return
|
||||
* @return the type of this Provenance Event
|
||||
*/
|
||||
ProvenanceEventType getEventType();
|
||||
|
||||
/**
|
||||
* Returns all FlowFile attributes that were associated with the FlowFile at
|
||||
* @return all FlowFile attributes that were associated with the FlowFile at
|
||||
* the time that this ProvenanceEvent was created
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Map<String, String> getAttributes();
|
||||
|
||||
/**
|
||||
* Returns all FlowFile attributes that existed on the FlowFile before this
|
||||
* @return all FlowFile attributes that existed on the FlowFile before this
|
||||
* event occurred
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Map<String, String> getPreviousAttributes();
|
||||
|
||||
/**
|
||||
* Returns all FlowFile attributes that were updated as a result of this
|
||||
* @return all FlowFile attributes that were updated as a result of this
|
||||
* event
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Map<String, String> getUpdatedAttributes();
|
||||
|
||||
/**
|
||||
* Returns the ID of the Processor/component that created this Provenance
|
||||
* @return the ID of the Processor/component that created this Provenance
|
||||
* Event
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String getComponentId();
|
||||
|
||||
/**
|
||||
* Returns the fully-qualified Class Name of the Processor/component that
|
||||
* @return the fully-qualified Class Name of the Processor/component that
|
||||
* created this Provenance Event
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String getComponentType();
|
||||
|
||||
/**
|
||||
* Returns a URI that provides information about the System and Protocol
|
||||
* @return a URI that provides information about the System and Protocol
|
||||
* information over which the transfer occurred. The intent of this field is
|
||||
* such that both the sender and the receiver can publish the events to an
|
||||
* external Enterprise-wide system that is then able to correlate the SEND
|
||||
* and RECEIVE events.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String getTransitUri();
|
||||
|
||||
/**
|
||||
* Returns the UUID that the Source System used to refer to this data; this
|
||||
* is applicable only when the {@link ProvenanceEventType} is of type
|
||||
* {@link ProvenanceEventType#RECEIVE RECEIVE}.
|
||||
*
|
||||
* Since the receiving system will usually refer to the data using a
|
||||
* different identifier than the source system, this information is used to
|
||||
* correlate the receive system's FlowFile with the sending system's data
|
||||
*
|
||||
* @return
|
||||
* @return the UUID that the Source System used to refer to this data; this
|
||||
* is applicable only when the {@link ProvenanceEventType} is of type
|
||||
* {@link ProvenanceEventType#RECEIVE RECEIVE}
|
||||
*/
|
||||
String getSourceSystemFlowFileIdentifier();
|
||||
|
||||
/**
|
||||
* Returns the UUID of the FlowFile with which this Event is associated
|
||||
*
|
||||
* @return
|
||||
* @return the UUID of the FlowFile with which this Event is associated
|
||||
*/
|
||||
String getFlowFileUuid();
|
||||
|
||||
/**
|
||||
* Returns the UUID's of all Parent FlowFiles. This is applicable only when
|
||||
* @return the UUID's of all Parent FlowFiles. This is applicable only when
|
||||
* the {@link ProvenanceEventType} is of type
|
||||
* {@link ProvenanceEventType#SPAWN SPAWN}.
|
||||
*
|
||||
* @return
|
||||
* {@link ProvenanceEventType#SPAWN SPAWN}
|
||||
*/
|
||||
List<String> getParentUuids();
|
||||
|
||||
/**
|
||||
* Returns the UUID's of all Child FlowFiles. This is applicable only when
|
||||
* @return the UUID's of all Child FlowFiles. This is applicable only when
|
||||
* the {@link ProvenanceEventType} is of type
|
||||
* {@link ProvenanceEventType#SPAWN SPAWN}.
|
||||
*
|
||||
* @return
|
||||
* {@link ProvenanceEventType#SPAWN SPAWN}
|
||||
*/
|
||||
List<String> getChildUuids();
|
||||
|
||||
/**
|
||||
* Returns the Alternate Identifier associated with the FlowFile with which
|
||||
* @return the Alternate Identifier associated with the FlowFile with which
|
||||
* this Event is associated. This is applicable only when the
|
||||
* {@link ProvenanceEventType} is of type
|
||||
* {@link ProvenanceEventType#ADDINFO}.
|
||||
*
|
||||
* @return
|
||||
* {@link ProvenanceEventType#ADDINFO}
|
||||
*/
|
||||
String getAlternateIdentifierUri();
|
||||
|
||||
/**
|
||||
* Returns the details for this record, if any were supplied. Otherwise,
|
||||
* @return the details for this record, if any were supplied. Otherwise,
|
||||
* returns <code>null</code>
|
||||
*
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
String getDetails();
|
||||
|
||||
/**
|
||||
* Returns the relationship to which this record was routed if the event
|
||||
* @return the relationship to which this record was routed if the event
|
||||
* type is {@link ProvenanceEventType#ROUTE}. The relationship is applicable
|
||||
* only to this type.
|
||||
*
|
||||
* @return
|
||||
*
|
||||
* only to this type
|
||||
*/
|
||||
String getRelationship();
|
||||
|
||||
/**
|
||||
* Returns the identifier of the queue from which the FlowFile was taken, if
|
||||
* @return the identifier of the queue from which the FlowFile was taken, if
|
||||
* any. If the FlowFile is created as a result of this event (in this case,
|
||||
* the Event Type is one of null null null null null {@link ProvenanceEventType#CREATE}, {@link ProvenanceEventType#RECEIVE},
|
||||
* the Event Type is one of null null null null null null null null {@link ProvenanceEventType#CREATE}, {@link ProvenanceEventType#RECEIVE},
|
||||
* {@link ProvenanceEventType#FORK}, {@link ProvenanceEventType#JOIN}, or
|
||||
* {@link ProvenanceEventType#CLONE}), or if the queue identifier is
|
||||
* unknown, then this method will return <code>null</code>.
|
||||
*
|
||||
* @return
|
||||
* unknown, then this method will return <code>null</code>
|
||||
*
|
||||
*/
|
||||
String getSourceQueueIdentifier();
|
||||
|
||||
/**
|
||||
* Returns the Section for the Content Claim that this Event refers to, if
|
||||
* @return the Section for the Content Claim that this Event refers to, if
|
||||
* any; otherwise, returns <code>null</code>
|
||||
*
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
String getContentClaimSection();
|
||||
|
||||
/**
|
||||
* Returns the Section for the Content Claim that the FlowFile previously
|
||||
* @return the Section for the Content Claim that the FlowFile previously
|
||||
* referenced, if any; otherwise, returns <code>null</code>
|
||||
*
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
String getPreviousContentClaimSection();
|
||||
|
||||
/**
|
||||
* Returns the Container for the Content Claim that this Event refers to, if
|
||||
* @return the Container for the Content Claim that this Event refers to, if
|
||||
* any; otherwise, returns <code>null</code>
|
||||
*
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
String getContentClaimContainer();
|
||||
|
||||
/**
|
||||
* Returns the Container for the Content Claim that the FlowFile previously
|
||||
* @return the Container for the Content Claim that the FlowFile previously
|
||||
* referenced, if any; otherwise, returns <code>null</code>
|
||||
*
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
String getPreviousContentClaimContainer();
|
||||
|
||||
/**
|
||||
* Returns the Identifier for the Content Claim that this Event refers to,
|
||||
* @return the Identifier for the Content Claim that this Event refers to,
|
||||
* if any; otherwise, returns <code>null</code>
|
||||
*
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
String getContentClaimIdentifier();
|
||||
|
||||
/**
|
||||
* Returns the Identifier for the Content Claim that the FlowFile previously
|
||||
* @return the Identifier for the Content Claim that the FlowFile previously
|
||||
* referenced, if any; otherwise, returns <code>null</code>
|
||||
*
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
String getPreviousContentClaimIdentifier();
|
||||
|
||||
/**
|
||||
* Returns the offset into the Content Claim at which the FlowFile's content
|
||||
* @return the offset into the Content Claim at which the FlowFile's content
|
||||
* begins, if any; otherwise, returns <code>null</code>
|
||||
*
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
Long getContentClaimOffset();
|
||||
|
||||
/**
|
||||
* Returns the offset into the Content Claim at which the FlowFile's
|
||||
* @return the offset into the Content Claim at which the FlowFile's
|
||||
* previous content began, if any; otherwise, returns <code>null</code>
|
||||
*
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
Long getPreviousContentClaimOffset();
|
||||
}
|
||||
|
|
|
@ -36,8 +36,9 @@ public interface ProvenanceEventRepository {
|
|||
/**
|
||||
* Performs any initialization needed. This should be called only by the
|
||||
* framework.
|
||||
* @param eventReporter
|
||||
* @throws java.io.IOException
|
||||
*
|
||||
* @param eventReporter to report to
|
||||
* @throws java.io.IOException if unable to initialize
|
||||
*/
|
||||
void initialize(EventReporter eventReporter) throws IOException;
|
||||
|
||||
|
@ -45,7 +46,7 @@ public interface ProvenanceEventRepository {
|
|||
* Returns a {@link ProvenanceEventBuilder} that is capable of building
|
||||
* {@link ProvenanceEventRecord}s
|
||||
*
|
||||
* @return
|
||||
* @return builder
|
||||
*/
|
||||
ProvenanceEventBuilder eventBuilder();
|
||||
|
||||
|
@ -54,7 +55,7 @@ public interface ProvenanceEventRepository {
|
|||
* the event id has been populated. Depending on the implementation, the
|
||||
* returned event may or may not be the same event given
|
||||
*
|
||||
* @param event
|
||||
* @param event to register
|
||||
*/
|
||||
void registerEvent(ProvenanceEventRecord event);
|
||||
|
||||
|
@ -66,7 +67,7 @@ public interface ProvenanceEventRepository {
|
|||
* of the Collection are atomic. This detail is implementation-specific.
|
||||
* </p>
|
||||
*
|
||||
* @param events
|
||||
* @param events to register
|
||||
*/
|
||||
void registerEvents(Iterable<ProvenanceEventRecord> events);
|
||||
|
||||
|
@ -75,18 +76,16 @@ public interface ProvenanceEventRepository {
|
|||
* repository starting with the given ID. The first ID in the repository
|
||||
* will always be 0 or higher.
|
||||
*
|
||||
* @param firstRecordId
|
||||
* @param maxRecords
|
||||
* @return
|
||||
* @throws java.io.IOException
|
||||
* @param firstRecordId id of the first record to retrieve
|
||||
* @param maxRecords maximum number of records to retrieve
|
||||
* @return records
|
||||
* @throws java.io.IOException if error reading from repository
|
||||
*/
|
||||
List<ProvenanceEventRecord> getEvents(long firstRecordId, final int maxRecords) throws IOException;
|
||||
|
||||
/**
|
||||
* Returns the largest ID of any event that is queryable in the repository.
|
||||
* @return the largest ID of any event that is queryable in the repository.
|
||||
* If no queryable events exists, returns null
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Long getMaxEventId();
|
||||
|
||||
|
@ -94,19 +93,18 @@ public interface ProvenanceEventRepository {
|
|||
* Submits an asynchronous request to process the given query, returning an
|
||||
* identifier that can be used to fetch the results at a later time
|
||||
*
|
||||
* @param query
|
||||
* @return
|
||||
* @param query to submit
|
||||
* @return an identifier that can be used to fetch the results at a later
|
||||
* time
|
||||
*/
|
||||
QuerySubmission submitQuery(Query query);
|
||||
|
||||
/**
|
||||
* Returns the QueryResult associated with the given identifier, if the
|
||||
* @param queryIdentifier of the query
|
||||
*
|
||||
* @return the QueryResult associated with the given identifier, if the
|
||||
* query has finished processing. If the query has not yet finished running,
|
||||
* returns <code>null</code>.
|
||||
*
|
||||
* @param queryIdentifier
|
||||
*
|
||||
* @return
|
||||
* returns <code>null</code>
|
||||
*/
|
||||
QuerySubmission retrieveQuerySubmission(String queryIdentifier);
|
||||
|
||||
|
@ -123,21 +121,17 @@ public interface ProvenanceEventRepository {
|
|||
ComputeLineageSubmission submitLineageComputation(String flowFileUuid);
|
||||
|
||||
/**
|
||||
* Returns the {@link ComputeLineageSubmission} associated with the given
|
||||
* @param lineageIdentifier identifier of lineage to compute
|
||||
* @return the {@link ComputeLineageSubmission} associated with the given
|
||||
* identifier
|
||||
*
|
||||
* @param lineageIdentifier
|
||||
* @return
|
||||
*/
|
||||
ComputeLineageSubmission retrieveLineageSubmission(String lineageIdentifier);
|
||||
|
||||
/**
|
||||
* Returns the Provenance Event Record with the given ID, if it exists, or
|
||||
* @param id to lookup
|
||||
* @return the Provenance Event Record with the given ID, if it exists, or
|
||||
* {@code null} otherwise
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
* @throws IOException
|
||||
* @throws IOException if failure while retrieving event
|
||||
*/
|
||||
ProvenanceEventRecord getEvent(long id) throws IOException;
|
||||
|
||||
|
@ -145,7 +139,7 @@ public interface ProvenanceEventRepository {
|
|||
* Submits a request to expand the parents of the event with the given id
|
||||
*
|
||||
* @param eventId the one-up id of the Event to expand
|
||||
* @return
|
||||
* @return a submission which can be checked for status
|
||||
*
|
||||
* @throws IllegalArgumentException if the given identifier identifies a
|
||||
* Provenance Event that has a Type that is not expandable or if the
|
||||
|
@ -157,7 +151,7 @@ public interface ProvenanceEventRepository {
|
|||
* Submits a request to expand the children of the event with the given id
|
||||
*
|
||||
* @param eventId the one-up id of the Event
|
||||
* @return
|
||||
* @return a submission which can be checked for status
|
||||
*
|
||||
* @throws IllegalArgumentException if the given identifier identifies a
|
||||
* Provenance Event that has a Type that is not expandable or if the
|
||||
|
@ -168,23 +162,19 @@ public interface ProvenanceEventRepository {
|
|||
/**
|
||||
* Closes the repository, freeing any resources
|
||||
*
|
||||
* @throws IOException
|
||||
* @throws IOException if failure closing repository
|
||||
*/
|
||||
void close() throws IOException;
|
||||
|
||||
/**
|
||||
* Returns a list of all fields that can be searched via the
|
||||
* @return a list of all fields that can be searched via the
|
||||
* {@link #submitQuery(nifi.provenance.search.Query)} method
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<SearchableField> getSearchableFields();
|
||||
|
||||
/**
|
||||
* Returns a list of all FlowFile attributes that can be searched via the
|
||||
* @return a list of all FlowFile attributes that can be searched via the
|
||||
* {@link #submitQuery(nifi.provenance.search.Query)} method
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<SearchableField> getSearchableAttributes();
|
||||
}
|
||||
|
|
|
@ -25,46 +25,34 @@ import java.util.List;
|
|||
public interface ComputeLineageResult {
|
||||
|
||||
/**
|
||||
* Returns all nodes for the graph
|
||||
*
|
||||
* @return
|
||||
* @return all nodes for the graph
|
||||
*/
|
||||
public List<LineageNode> getNodes();
|
||||
|
||||
/**
|
||||
* Returns all links for the graph
|
||||
*
|
||||
* @return
|
||||
* @return all links for the graph
|
||||
*/
|
||||
public List<LineageEdge> getEdges();
|
||||
|
||||
/**
|
||||
* Returns the date at which this AsynchronousLineageResult will expire
|
||||
*
|
||||
* @return
|
||||
* @return the date at which this AsynchronousLineageResult will expire
|
||||
*/
|
||||
Date getExpiration();
|
||||
|
||||
/**
|
||||
* If an error occurred while computing the lineage, this will return the
|
||||
* serialized error; otherwise, returns <code>null</code>.
|
||||
*
|
||||
* @return
|
||||
* @return If an error occurred while computing the lineage, this will return the
|
||||
* serialized error; otherwise, returns <code>null</code>
|
||||
*/
|
||||
String getError();
|
||||
|
||||
/**
|
||||
* returns an integer between 0 and 100 (inclusive) that indicates what
|
||||
* @return an integer between 0 and 100 (inclusive) that indicates what
|
||||
* percentage of completion the computation has reached
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
int getPercentComplete();
|
||||
|
||||
/**
|
||||
* Indicates whether or not the lineage has finished running
|
||||
*
|
||||
* @return
|
||||
* @return Indicates whether or not the lineage has finished running
|
||||
*/
|
||||
boolean isFinished();
|
||||
}
|
||||
|
|
|
@ -22,25 +22,19 @@ import java.util.Date;
|
|||
public interface ComputeLineageSubmission {
|
||||
|
||||
/**
|
||||
* Returns the {@link ComputeLineageResult} that contains the results. The
|
||||
* @return the {@link ComputeLineageResult} that contains the results. The
|
||||
* results may be partial if a call to
|
||||
* {@link ComputeLineageResult#isFinished()} returns <code>false</code>.
|
||||
*
|
||||
* @return
|
||||
* {@link ComputeLineageResult#isFinished()} returns <code>false</code>
|
||||
*/
|
||||
ComputeLineageResult getResult();
|
||||
|
||||
/**
|
||||
* Returns the date at which this lineage was submitted
|
||||
*
|
||||
* @return
|
||||
* @return the date at which this lineage was submitted
|
||||
*/
|
||||
Date getSubmissionTime();
|
||||
|
||||
/**
|
||||
* Returns the generated identifier for this lineage result
|
||||
*
|
||||
* @return
|
||||
* @return the generated identifier for this lineage result
|
||||
*/
|
||||
String getLineageIdentifier();
|
||||
|
||||
|
@ -56,27 +50,21 @@ public interface ComputeLineageSubmission {
|
|||
boolean isCanceled();
|
||||
|
||||
/**
|
||||
* Returns the type of Lineage Computation that was submitted
|
||||
*
|
||||
* @return
|
||||
* @return the type of Lineage Computation that was submitted
|
||||
*/
|
||||
LineageComputationType getLineageComputationType();
|
||||
|
||||
/**
|
||||
* If the Lineage Computation Type of this submission is
|
||||
* @return If the Lineage Computation Type of this submission is
|
||||
* {@link LineageComputationType.EXPAND_CHILDREN} or
|
||||
* {@link LineageComputationType.EXPAND_PARENTS}, indicates the ID event
|
||||
* that is to be expanded; otherwise, returns <code>null</code>.
|
||||
*
|
||||
* @return
|
||||
* that is to be expanded; otherwise, returns <code>null</code>
|
||||
*/
|
||||
Long getExpandedEventId();
|
||||
|
||||
/**
|
||||
* Returns all FlowFile UUID's that are encapsulated in this lineage
|
||||
* @return all FlowFile UUID's that are encapsulated in this lineage
|
||||
* computation submission
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Collection<String> getLineageFlowFileUuids();
|
||||
}
|
||||
|
|
|
@ -25,16 +25,12 @@ import java.util.List;
|
|||
public interface Lineage {
|
||||
|
||||
/**
|
||||
* Returns all nodes for the graph
|
||||
*
|
||||
* @return
|
||||
* @return all nodes for the graph
|
||||
*/
|
||||
public List<LineageNode> getNodes();
|
||||
|
||||
/**
|
||||
* Returns all links for the graph
|
||||
*
|
||||
* @return
|
||||
* @return all links for the graph
|
||||
*/
|
||||
public List<LineageEdge> getEdges();
|
||||
|
||||
|
|
|
@ -19,43 +19,33 @@ package org.apache.nifi.provenance.lineage;
|
|||
public interface LineageNode {
|
||||
|
||||
/**
|
||||
* Returns the identifier of the Clustered NiFi Node that generated the
|
||||
* @return the identifier of the Clustered NiFi Node that generated the
|
||||
* event
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String getClusterNodeIdentifier();
|
||||
|
||||
/**
|
||||
* Returns the type of the LineageNode
|
||||
*
|
||||
* @return
|
||||
* @return the type of the LineageNode
|
||||
*/
|
||||
LineageNodeType getNodeType();
|
||||
|
||||
/**
|
||||
* Returns the UUID of the FlowFile for which this Node was created
|
||||
*
|
||||
* @return
|
||||
* @return the UUID of the FlowFile for which this Node was created
|
||||
*/
|
||||
String getFlowFileUuid();
|
||||
|
||||
/**
|
||||
* Returns the UUID for this LineageNode.
|
||||
*
|
||||
* @return
|
||||
* @return the UUID for this LineageNode
|
||||
*/
|
||||
String getIdentifier();
|
||||
|
||||
/**
|
||||
* Returns the timestamp that corresponds to this Node. The meaning of the
|
||||
* @return the timestamp that corresponds to this Node. The meaning of the
|
||||
* timestamp may differ between implementations. For example, a
|
||||
* {@link ProvenanceEventLineageNode}'s timestamp indicates the time at
|
||||
* which the event occurred. However, for a Node that reperesents a
|
||||
* FlowFile, for example, the timestamp may represent the time at which the
|
||||
* FlowFile was created.
|
||||
*
|
||||
* @return
|
||||
* FlowFile was created
|
||||
*/
|
||||
long getTimestamp();
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue