Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-538

remove code duplication from HotRodOperationsImpl

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Done
    • Major
    • 4.1.0.CR2
    • None
    • None
    • None

    Description

      HotRodOperationsImpl - contain code duplication in the way retry is handled. Basically following logic is replicated through all operations:
      Transport transport = getTransport(key, true);
      int retryCount = 0;
      do {
      try

      { //to something here }

      catch (TransportException te)

      { logErrorAndThrowExceptionIfNeeded(retryCount, te); }

      finally

      { releaseTransport(transport); }

      if (shouldRetry(retryCount))

      { transport = getTransport(key, false); }

      retryCount++;
      } while (shouldRetry(retryCount));
      throw new IllegalStateException("We should not reach here!");

      This should be factorized in a TemplateMethod because: a - duplication is evil and b - duplication is more even in a reference implementation.

      Attachments

        Activity

          People

            mircea.markus Mircea Markus (Inactive)
            mircea.markus Mircea Markus (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: