public boolean cleanup ( ) throws IOException { return ! state . compareAndSet ( State . ONGOING , State . DELETED ) || fileSystem . delete ( directory , true ) ; }
Calling this method will attempt delete the underlying snapshot directory recursively if the state is ongoing . In this case the state will be set to deleted as a result of this call .