Thursday, October 26, 2017

Version 2 of the Time2 Library and CrNiCKL

New versions of the Time2 Library and of CrNiCKL have been released on October 5, 2017.

The software can be found on GitHub and in Maven Central. Various resources are available on the Time2 Library project website and the CrNiCKL project website.

Most changes are in the Time2 Library and can be summarized as:

  • improved thread safety, achieved by the elimination of TimeDomainFactory, TimeSeriesFactory, and ExternalTimeFormat;
  • partial reorganization of the package structure;
  • support for nanoseconds;
  • various fixes and improvements.
Consult the release notes for more details.

Version 2.0.0 of the Time2 Library is not fully compatible with version 1.1.7. Due to the elimination and replacement of some classes and interfaces, a minimum of application recoding is unavoidable. It is in principle limited to initialization code. In addition, the reorganization of packages makes it necessary to reorganize imports.

The important change is the improvement of thread safety. Factories were implemented as singletons and thread safety was enforced with the help of synchronized methods. In rare and hard-to-replicate cases, the software experienced deadlocks. To address the issue, all singletons have been eliminated. The functionality is of course still available. It is implemented by using injection and immutable objects. The new approach does not require any synchronization and is inherently safer. As a bonus, it also makes testing easier.

Instead of TimeDomainFactory, applications use a TimeDomainCatalog, implemented as an immutable object with all time domains passed as parameters to the constructor. The role of TimeSeriesFactory has been taken over by public constructors of RegularTimeSeries and SparseTimeSeries. The functionality of ExternalTimeFormat has been split into TimeScanner and TimeFormatter.

The CrNiCKL database software depends on the Time2 Library and has been upgraded. Its version 2.0.0 is likewise incompatible with the previous one, 1.2.1. The JDBC and MongoDB drivers have also been upgraded. Use crnickl-jdbc 2.0.1 and crnickl-mongodb 2.0.1 instead of 2.0.0; the 2.0.0 versions have a glitch in their POMs and cannot be used for unit testing.

The demos on GitHub have been updated and provide a simple illustration of how to use the new versions. The direct links are time2lib-demo and crnickl-demo.