Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-17884

Improve TransientStore API

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.4
    • Component/s: TransientStore
    • Tags:
    • Impact type:
      API change, Configuration Change
    • Upgrade notes:
      Hide

      Added:

      • StorageEntry#getParameters()
      • TransientStorageComponent#DEFAULT_STORE_NAME

      Removed:

      • TransientStore#removeAll()
      • TransientStore#getConfig()
      • StorageEntry#addBlob(Blob blob)

      Removed throws IOException from:

      • Cache API
      • TransientStore API
      • StorageEntry API
      • RedisAdmin#clear(String prefix)
      • RedisCallable#call(Jedis jedis)
      • RedisExecutor API

      Changed:

      • TransientStore#canDelete(String key) to TransientStore#release(String key)
      • StorageEntry#put(Map<String, Serializable> p) to StorageEntry#putAll(Map<String, Serializable> params)

      Added "default" TransientStore configuration in templates/common/config/transient-store-config.xml.nxftl

      Show
      Added: StorageEntry#getParameters() TransientStorageComponent#DEFAULT_STORE_NAME Removed: TransientStore#removeAll() TransientStore#getConfig() StorageEntry#addBlob(Blob blob) Removed throws IOException from: Cache API TransientStore API StorageEntry API RedisAdmin#clear(String prefix) RedisCallable#call(Jedis jedis) RedisExecutor API Changed: TransientStore#canDelete(String key) to TransientStore#release(String key) StorageEntry#put(Map<String, Serializable> p) to StorageEntry#putAll(Map<String, Serializable> params) Added "default" TransientStore configuration in templates/common/config/transient-store-config.xml.nxftl
    • Sprint:
      TGV 07

      Description

      The TransientStore API, the TransientStoreService and the related interfaces have been improved mainly to:

      Be more consistent

      The StorageEntry interface now:

      • Handles putting and getting a map of parameters
        void putAll(Map<String, Serializable> params)
        
        Map<String, Serializable> getParameters()
        
      • Only provides one method to add blobs
        void setBlobs(List<Blob> blobs)
        

      Define a default transient store configuration

      The templates/common/config/transient-store-config.xml.nxftl contribution defines the "default" transient store:

      <#if "${nuxeo.redis.enabled}" == "true">
        <#assign className = "org.nuxeo.ecm.core.redis.contribs.RedisTransientStore" />
      <#else>
        <#assign className = "org.nuxeo.ecm.core.transientstore.SimpleTransientStore" />
      </#if>
      
      <extension target="org.nuxeo.ecm.core.transientstore.TransientStorageComponent"
        point="store">
      
        <store name="default" class="${className}">
          <targetMaxSizeMB>-1</targetMaxSizeMB>
          <absoluteMaxSizeMB>-1</absoluteMaxSizeMB>
          <fistLevelTTL>120</fistLevelTTL>
          <secondLevelTTL>10</secondLevelTTL>
          <minimalRetention>10</minimalRetention>
        </store>
      
      </extension>
      

      We can see that its implementation depends on the nuxeo.redis.enabled property, using the RedisTransientStore implementation if Redis is enabled and the SimpleTransientStore otherwise.

      When getting a store with TransientStoreService#getStore(String name) if the store doesn't exist a fallback is done on the "default" one.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: