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

Make NonBlockingStore.delete() return CompletionStage<Void>

    XMLWordPrintable

    Details

      Description

      NonBlockingStore.delete(int segment, Object key) returns a CompletionStage<Boolean>, just like CacheWriter.delete(Object key) returns a boolean. But the Boolean return value is not used, so it could be replaced with Void.

      In CacheWriterInterceptor, the return value of the remove command is based only on the value that was loaded in the invocation context, not on the result of the store delete operation:

      https://github.com/infinispan/infinispan/blob/7206596b4a0258d0b8f1a20d78259e7f270a81ec/core/src/main/java/org/infinispan/interceptors/impl/CacheWriterInterceptor.java#L166

      Same with the removeHits statistic in CacheMgmtInterceptor:

      https://github.com/infinispan/infinispan/blob/2d53d0a1e59f2dc3335235f9dafb8e93e611c60e/core/src/main/java/org/infinispan/interceptors/impl/CacheMgmtInterceptor.java#L495

      Changing the return value to CompletionStage<Void> would improve performance in some stores, e.g. RocksDBStore wouldn't have to read the value first. And the async store can't return the result of the actual deletion anyway.

        Attachments

          Activity

            People

            Assignee:
            dan.berindei Dan Berindei
            Reporter:
            dan.berindei Dan Berindei
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: