Use java.lang.ref.Cleaner in controller.cluster.io 86/93286/2
authortadei.bilan <tadei.bilan@pantheon.tech>
Fri, 23 Oct 2020 11:12:06 +0000 (14:12 +0300)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 16 Nov 2020 16:39:50 +0000 (17:39 +0100)
commite0e956ecf0a4e5085f33e67f4fb73141876f1668
tree065b77c37763e0d4e0a123f532a8275d5be89cff
parentc805b57270f82d09d460672372d8d21f5aa54fde
Use java.lang.ref.Cleaner in controller.cluster.io

Improve temporary file clean up by using a Cleaner to dispatch
cleaning tasks. Since it gives us a Cleanable, we can dispense with
a tracking map and removal from it -- Cleanable makes sure it is
called exactly once.

JIRA: CONTROLLER-1911
Change-Id: I5fb715102912359cf002129d25a7433199826982
Signed-off-by: tadei.bilan <tadei.bilan@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/io/FileBackedOutputStream.java
opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/io/FileBackedOutputStreamTest.java
opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/io/SharedFileBackedOutputStreamTest.java

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.