|Infrastructure Utilities Facts|
Project Creation Date: March 17, 2016
Project Lead: Michael Vorburger <email@example.com>
IRC: freenode.net #opendaylight-infrautils
- 1 Introduction
- 2 Features
- 2.1 Completed & Available
- 2.2 Planned Features (WIP)
- 2.3 Future Ideas
- 2.4 Removed Features
- 3 Appendix
Welcome to the Infrastructure Utilities project page!
This project offers technical utilities and infrastructures for other projects to use.
We currently (as of May 2017) consider infrautils a low-level offset 0 project. As is now, it only depends on odlparent, and does not have dependencies to e.g. controller & mdsal or yangtools. This is intentional, as this would allow such projects to use utilities from infrautils (without causing circular dependencies among offset 0 projects).
We anticipate that e.g. the upcoming ready service may eventually want to be used by other offset 0 projects, and therefore want to be careful to not accidentally introduce dependencies from infrautils to other offset 0 projects.
Should there be a need to build utilities requiring such dependencies in the future (for example Cache layer for mdsal, YANG RPC for ready, etc.), we should discuss whether to create a new infrautils2 (?) project with dependencies to infrautils and other offset 0 projects, or put such utilities into existing projects such as e.g. genius.
This presentation given at the OpenDaylight Oxygen Developer Forum in October 2017 gives a good overview of the project.
Completed & Available
In chronological order when merged to master:
Create, update and output counters is a basic tool for debugging and generating statistics in any system. We've developed a counter infrastructure integrated into ODL which has already been successfully used with multiple products, and more recently in debugging and fixing the OpenFlow plugin/Java and LACP modules.
Utils incl. org.opendaylight.infrautils.utils.concurrent
Bunch of small (non test related) low level general utility classes à la Apache (Lang) Commons or Guava and similar incl. utils.concurrent:
- ListenableFutures toCompletionStage & addErrorLogging
- CompletableFutures completedExceptionally
- CompletionStages completedExceptionally
- LoggingRejectedExecutionHandler, LoggingThreadUncaughtExceptionHandler, ThreadFactoryProvider, Executors newSingleThreadExecutor
also includes the (as of 2018.09 WIP) ExecutionOrigin & Co. in infrautils.utils.mdc.
- LogRule which logs (using slf4j-api) the start and stop of each @Test method
- LogCaptureRule which can fail a test if something logs any ERROR from anywhere (This work even if the LOG.error() is happening in a background thread, not the test's main thread... which can be particularly interesting.)
- RunUntilFailureRule which allows to keep running tests indefinitely; for local usage to debug "flaky" (sometimes passing, sometimes failing) tests until they fail
- ClasspathHellDuplicatesCheckRule verifies, and guarantees future non-regression, against JAR hell due to duplicate classpath entries. Tests with this JUnit Rule will fail if their classpath contains duplicate class. This could be caused e.g. by changes to upstream transitive dependencies. See also http://jhades.github.io (which this internally uses, not exposed).
- see https://github.com/opendaylight/infrautils/blob/master/testutils/src/test/java/org/opendaylight/infrautils/testutils/tests/ExampleTest.java
Also some low level general utility classes helpful for unit testing concurrency related things in infrautils.testutils.concurrent:
- CompletionStageTestAwaiter, see CompletionStageAwaitExampleTest
JobCoordinator service which enables executing jobs in a parallel/sequential fashion based on their keys.
Originally in genius project, but moved to infrautils to be more widely available to other projects as well, as it was deemed to be a technical infrastructure not related to genius' project network abstraction. Subsequently improved within infrautils. Genius still has the previous incarnation of this code as deprecated util as of May 2017, but this is about to disappear via c/60303.
Integration Test Utilities (itestutils)
Used for non-regression self-testing of features in this project (and available to others).
Planned Features (WIP)
Logging with ExecutionOrigin ID
Linux Foundation (LF) Cloud Native Computing Foundation (CNCF) Open Tracing for OpenDaylight and its north- and southbound!
Remove in https://git.opendaylight.org/gerrit/#/c/53215/ : The decision to split a service into one or more threads with asynchronous interactions between them is frequently dependent on constraints learned late in the development and even the deployment cycle. In order to allow flexibility in making these decisions we've developed an infrastructure which is configuration driven allowing agnostic code to be written under generic constrains which can then later be customized according to the required constraints.
The infrautils project does not publish forward looking release plans. This Wiki page does however have a "Completed & Available" and a "Planned Features (WIP)" section above. So whatever is in is in by cut off and makes it, what's not gets deferred to the next release. Parties interested in "Planned Features (WIP)" are welcome to contribute!