Skip to content

Refactored version of the Apache Nifi NAR system for other apps

Notifications You must be signed in to change notification settings

palindromicity/bundles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

Bundles

Bundles are a derivative of the Apache Nifi NARs. This is an attempt to adapt the NAR system to be usable outside of Apache Nifi in other scenarios.

bundles-maven-plugin

The bundles-maven-plugin is an adapted version of the jar dependency plugin whose function is to bundle a jar of jars based on the dependencies for a project. It also creates metadata attributes. A project's jar, and it's non-provided dependency jars are place in a /lib entry in the bundle, with the bundle itself being in jar format.

bundles-lib

The bundles-lib contains the functionality required to:

  • discover bundles
  • inspect bundles for exposed extension types
  • load the bundles
  • create special class loaders for bundles
  • deliver instances of extension types for use

NAR exposed the bundles through many classes. I have created the BundleSystem interface to expose a more usable, simplified api for our use cases.

What is different

  • Adaptation of nifi-nar-utils to be used outside of the Apache Nifi project
  • Rudimentary extensibility to allow configuration and injection of service types and other things that were hard coded to nifi
  • Refactored from File based to Apache Commons VFS based, allowing for bundle libraries to be loaded from HDFS
  • Rebranding to Bundle from Nar ( although the lib and the plugin allow that to be configured now )
  • Added capability to the properties class to write to stream, adapted to uri from paths
  • Added integration tests for hdfs
  • Changed to be ClassIndex based instead of ServiceLoader. Service loader is slower, and Casey's ClassIndex work is great. This also removes the NAR's required manual maintenance of the service file.
  • Refactored to use VFS to load the bundle/nar into the classloader AND to use VFS to load the dependency jars -> VFS as a composite filesystem. Thus going from NAR's 'working directory', exploded NARS to just loading the bundle/nar.
  • Created a simple interface for interacting with the system
  • Refactored such that it is possible to add new bundles to the running system without having to restart the application

Project info

  • bundles-lib The bundles library
  • bundles-testing a sample project showing how to use bundles
  • test-bundles source for bundles used for bundles-lib tests

TODO items

  • [ ]checkstyle
  • [ ]clean up the javadoc
  • [ ]refactor the namespace so it isn't so flat

About

Refactored version of the Apache Nifi NAR system for other apps

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages