@InterfaceAudience.Private public interface ForeignExceptionSnare
To use, one would pass an implementation of this object to a long running method and
periodically check by calling
rethrowException(). If any foreign exceptions have
been received, the calling thread is then responsible for handling the rethrown exception.
One could use the boolean
hasException() to determine if there is an exceptoin as well.
NOTE: This is very similar to the InterruptedException/interrupt/interrupted pattern. There, the notification state is bound to a Thread. Using this, applications receive Exceptions in the snare. The snare is referenced and checked by multiple threads which enables exception notification in all the involved threads/processes.
void rethrowException() throws ForeignException
ForeignExceptionSnare. If there is no exception this is a no-op
ForeignException- all exceptions from remote sources are procedure exceptions
rethrowException(). Checks to see if any process to which the exception checkers is bound has created an error that would cause a failure.
Copyright © 2007–2018 Cloudera. All rights reserved.