Class CachingDataStore

    • Constructor Detail

      • CachingDataStore

        public CachingDataStore()
    • Method Detail

      • init

        public void init​(java.lang.String homeDir)
                  throws RepositoryException
        Initialized the data store. If the path is not set, <repository home>/repository/datastore is used. This directory is automatically created if it does not yet exist. During first initialization, it upload all files from local datastore to backed and local datastore act as a local cache.
        Specified by:
        init in interface DataStore
        Parameters:
        homeDir - the home directory of the repository
        Throws:
        RepositoryException
      • getRecord

        public DataRecord getRecord​(DataIdentifier identifier)
                             throws DataStoreException
        Description copied from interface: DataStore
        Returns the identified data record. The given identifier should be the identifier of a previously saved data record. Since records are never removed, there should never be cases where the identified record is not found. Abnormal cases like that are treated as errors and handled by throwing an exception.
        Specified by:
        getRecord in interface DataStore
        Overrides:
        getRecord in class AbstractDataStore
        Parameters:
        identifier - data identifier
        Returns:
        identified data record
        Throws:
        DataStoreException - if the data store could not be accessed, or if the given identifier is invalid
      • updateModifiedDateOnAccess

        public void updateModifiedDateOnAccess​(long before)
        Description copied from interface: DataStore
        From now on, update the modified date of an object even when accessing it. Usually, the modified date is only updated when creating a new object, or when a new link is added to an existing object. When this setting is enabled, even getLength() will update the modified date.
        Specified by:
        updateModifiedDateOnAccess in interface DataStore
        Parameters:
        before - - update the modified date to the current time if it is older than this value
      • deleteAllOlderThan

        public int deleteAllOlderThan​(long min)
                               throws DataStoreException
        Description copied from interface: DataStore
        Delete objects that have a modified date older than the specified date.
        Specified by:
        deleteAllOlderThan in interface DataStore
        Parameters:
        min - the minimum time
        Returns:
        the number of data records deleted
        Throws:
        DataStoreException
      • getPendingUploads

        public java.util.Set<java.lang.String> getPendingUploads()
      • confirmDelete

        public boolean confirmDelete​(DataIdentifier identifier)
        Method to confirm that identifier can be deleted from Backend
        Parameters:
        identifier -
        Returns:
      • clearInUse

        public void clearInUse()
        Description copied from interface: DataStore
        Clear the in-use list. This is only used for testing to make the the garbage collection think that objects are no longer in use.
        Specified by:
        clearInUse in interface DataStore
      • setSecret

        public void setSecret​(java.lang.String secret)
        Setter for configuration based secret
        Parameters:
        secret - the secret used to sign reference binaries
      • setMinRecordLength

        public void setMinRecordLength​(int minRecordLength)
        Set the minimum object length.
        Parameters:
        minRecordLength - the length
      • getMinRecordLength

        public int getMinRecordLength()
        Return mininum object length.
        Specified by:
        getMinRecordLength in interface DataStore
        Returns:
        the minimum size in bytes
      • getConfig

        public java.lang.String getConfig()
        Return path of configuration properties.
        Returns:
        path of configuration properties.
      • setConfig

        public void setConfig​(java.lang.String config)
        Set the configuration properties path.
        Parameters:
        config - path of configuration properties.
      • getCacheSize

        public long getCacheSize()
        Returns:
        size of LocalCache.
      • setCacheSize

        public void setCacheSize​(long cacheSize)
        Set size of LocalCache.
        Parameters:
        cacheSize - size of LocalCache.
      • getPath

        public java.lang.String getPath()
        Returns:
        path of LocalCache.
      • setPath

        public void setPath​(java.lang.String path)
        Set path of LocalCache.
        Parameters:
        path - of LocalCache.
      • getCachePurgeTrigFactor

        public double getCachePurgeTrigFactor()
        Returns:
        Purge trigger factor of LocalCache.
      • setCachePurgeTrigFactor

        public void setCachePurgeTrigFactor​(double cachePurgeTrigFactor)
        Set purge trigger factor of LocalCache.
        Parameters:
        cachePurgeTrigFactor - purge trigger factor.
      • getCachePurgeResizeFactor

        public double getCachePurgeResizeFactor()
        Returns:
        Purge resize factor of LocalCache.
      • setCachePurgeResizeFactor

        public void setCachePurgeResizeFactor​(double cachePurgeResizeFactor)
        Set purge resize factor of LocalCache.
        Parameters:
        cachePurgeResizeFactor - purge resize factor.
      • getConcurrentUploadsThreads

        public int getConcurrentUploadsThreads()
      • setConcurrentUploadsThreads

        public void setConcurrentUploadsThreads​(int concurrentUploadsThreads)
      • getAsyncUploadLimit

        public int getAsyncUploadLimit()
      • setAsyncUploadLimit

        public void setAsyncUploadLimit​(int asyncUploadLimit)
      • isContinueOnAsyncUploadFailure

        public boolean isContinueOnAsyncUploadFailure()
      • setContinueOnAsyncUploadFailure

        public void setContinueOnAsyncUploadFailure​(boolean continueOnAsyncUploadFailure)
      • getUploadRetries

        public int getUploadRetries()
      • setUploadRetries

        public void setUploadRetries​(int uploadRetries)
      • setTouchAsync

        public void setTouchAsync​(boolean touchAsync)
      • setProactiveCaching

        public void setProactiveCaching​(boolean proactiveCaching)
      • setRecLengthCacheSize

        public void setRecLengthCacheSize​(int recLengthCacheSize)
      • getBackend

        public Backend getBackend()