NetDB: SubDB lifecycle fixes (Gitlab #406)
This should resolve the remaining portion of #406 (closed).
Tested both functionally and with VisualVM to verify that the FNDF objects do not leak after client/subdb shutdown.
major:
- Disable RefreshRoutersJob for subdbs, not required
- Cancel ExpireRoutersJob and ExpireLeasesJob at netdb shutdown
- Do not run ExpireRoutersJob at shutdown for subdbs, they are transient
- Do not create _exploreKeys HashMap for subdbs, and add checks for subdbs attempting to access
- Convert NegativeLookupCache timer to SimpleTimer2 so we may cancel it
- Add method to cancel NegativeLookupCache timer; cancel it when netdb shuts down
minor:
- Revert unnecessary subdb check in FloodfillMonitorJob, it is not instantiated for subdbs
- Revert unnecessary changes to KNDF.getDbDir() that were for reverted persistent subdbs, and add javadocs
- Revert changes in initialization of _dbDir in KNDF.startup()
- Disable and deprecate KNDF.restart(), it is unused, untested, and broken
- Remove DataStore.restart() and extensions, they are unused
- Cleanup unnecessary setting things to null that already are
- Cleanup in FNDF super.isMainDb() to simply isMainDb(); there is no override in FNDF to avoid
Not addressed here:
- Basic subdb creation/destruction (#406 (closed)) - fixed earlier
- Persistent subdb storage (#407 (closed)) - fixed earlier but still open
- Multihome DB (#409 (closed))
- Is burst lookup throttler required? (#453 (closed))
Closes #406 (closed)