datawave
datawave copied to clipboard
MarkingFunctionsFactory.createMarkingFunctions() should not be called as a static initializer
MarkingFunctionsFactory.createMarkingFunctions() ocassionally fails and returns a null. One of the reasons is a VFS / HDFS error. If the failure (null) is cached in a static member of a classs, then that JVM will always have that null value and must be restarted.
Instead, we should call MarkingFunctions.Factory.createMarkingFunctions()
or MarkingFunctionsFactory.createMarkingFunctions() when we want the markingFunctions since both calls cache the object in an instance member anyway. If the createMarkingFunctions call fails (VFS / HDFS error), then the null will be temporarily stored in the Factory and overwritten when it succeeds -- this is much better than a null being sored in a static member of a different class.