UIMA
  1. UIMA
  2. UIMA-1754

Incorrect description of getCAS() method in UIMA AS documentation

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.3AS
    • Fix Version/s: 2.3.1AS
    • Component/s: Async Scaleout
    • Labels:
      None

      Description

      Chapter 4.2 The UimaAsynchronousEngine Interface describes UIMA AS client interface. Its description of getCAS() tells the reader to call reset() or release() on the CAS before calling getCAS() again. This is wrong when the client application uses an async style of sending CASes using sendCAS() method. When using async calls, the framework actually releases a CAS after the user's listener callback completes. The code calls release() if the user callback is not provided. The only time when the user's code must call release() or reset() is when the synchronous calls are made via sendAndReceive(). In this style of invocation, the framework does not call release() nor reset() and it is user's responsibility to do so.

        Activity

        Hide
        Jerry Cwiklik added a comment -

        Modified description of getCAS() to read:

        CAS getCAS(): Requests a new CAS instance from the CAS pool. This method
        blocks until a free instance of CAS is available in the CAS pool. Applications that
        use synchronous sendAndReceive() and getCAS() need to call CAS.reset()
        before reusing the CAS, or CAS.release() to return it to the Cas pool. Applications
        that use asychronous sendCAS() and getCAS() must not call CAS.release() nor
        CAS.reset(). The UIMA AS client releases each CAS at the end of processing. If
        a callback listener object is registered with UIMA AS client, the CAS.release() is
        called after a call to the callback listener entityProcessComplete() completes.

        Show
        Jerry Cwiklik added a comment - Modified description of getCAS() to read: CAS getCAS(): Requests a new CAS instance from the CAS pool. This method blocks until a free instance of CAS is available in the CAS pool. Applications that use synchronous sendAndReceive() and getCAS() need to call CAS.reset() before reusing the CAS, or CAS.release() to return it to the Cas pool. Applications that use asychronous sendCAS() and getCAS() must not call CAS.release() nor CAS.reset(). The UIMA AS client releases each CAS at the end of processing. If a callback listener object is registered with UIMA AS client, the CAS.release() is called after a call to the callback listener entityProcessComplete() completes.
        Hide
        Jerry Cwiklik added a comment -

        Modified to read:

        CAS getCAS(): Requests a new CAS instance from a CAS pool. This method blocks until
        a free instance of CAS is available in the CAS pool. Applications that use synchronous
        sendAndReceive() and getCAS() need to call CAS.reset() before reusing the CAS,
        or CAS.release() to return it to the CAS pool. Applications that use asynchronous
        sendCAS() and getCAS() must not call CAS.release() nor CAS.reset() unless
        sendCAS() throws an exception. If sendCAS() call is successful, the UIMA AS framework
        code releases each CAS automatically when a reply is received. The framework releases a
        CAS right after a callback listener entityProcessComplete() completes.

        Show
        Jerry Cwiklik added a comment - Modified to read: CAS getCAS(): Requests a new CAS instance from a CAS pool. This method blocks until a free instance of CAS is available in the CAS pool. Applications that use synchronous sendAndReceive() and getCAS() need to call CAS.reset() before reusing the CAS, or CAS.release() to return it to the CAS pool. Applications that use asynchronous sendCAS() and getCAS() must not call CAS.release() nor CAS.reset() unless sendCAS() throws an exception. If sendCAS() call is successful, the UIMA AS framework code releases each CAS automatically when a reply is received. The framework releases a CAS right after a callback listener entityProcessComplete() completes.

          People

          • Assignee:
            Jerry Cwiklik
            Reporter:
            Jerry Cwiklik
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development