forked from apache/nifi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NIFI-8519 Adding HDFS support for NAR autoload
- Refining classloader management with the help of @markap14 This closes apache#5059 Signed-off-by: Mark Payne <markap14@hotmail.com>
- Loading branch information
1 parent
7c08fbc
commit 51aae5b
Showing
22 changed files
with
1,193 additions
and
111 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
nifi-api/src/main/java/org/apache/nifi/nar/NarProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* 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. | ||
*/ | ||
package org.apache.nifi.nar; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.util.Collection; | ||
|
||
/** | ||
* Represents an external source where the NAR files might be acquired from. Used by the NAR auto loader functionality | ||
* in order to poll an external source for new NAR files to load. | ||
*/ | ||
public interface NarProvider { | ||
/** | ||
* Initializes the NAR Provider based on the given set of properties. | ||
*/ | ||
void initialize(NarProviderInitializationContext context); | ||
|
||
/** | ||
* Performs a listing of all NAR's that are available. | ||
* | ||
* @Return The result is a list of locations, where the format depends on the actual implementation. | ||
*/ | ||
Collection<String> listNars() throws IOException; | ||
|
||
/** | ||
* Fetches the NAR at the given location. The location should be one of the values returned by <code>listNars()</code>. | ||
*/ | ||
InputStream fetchNarContents(String location) throws IOException; | ||
} |
30 changes: 30 additions & 0 deletions
30
nifi-api/src/main/java/org/apache/nifi/nar/NarProviderInitializationContext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* 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. | ||
*/ | ||
package org.apache.nifi.nar; | ||
|
||
import java.util.Map; | ||
|
||
/** | ||
* Contains necessary information for extensions of NAR auto loader functionality. | ||
*/ | ||
public interface NarProviderInitializationContext { | ||
|
||
/** | ||
* @return Returns with the available properties. | ||
*/ | ||
Map<String, String> getProperties(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.