Package org.nuxeo.ecm.core.blob.scroll
Class AbstractBlobScroll<T extends BlobStoreBlobProvider>
- java.lang.Object
-
- org.nuxeo.ecm.core.blob.scroll.AbstractBlobScroll<T>
-
- All Implemented Interfaces:
AutoCloseable
,Iterator<List<String>>
,Scroll
- Direct Known Subclasses:
AzureBlobScroll
,GoogleStorageBlobScroll
,GridFSBlobScroll
,InMemoryBlobScroll
,LocalBlobScroll
,S3BlobScroll
public abstract class AbstractBlobScroll<T extends BlobStoreBlobProvider> extends Object implements Scroll
Abstract class to scroll blobs from a blob provider, the scroll query is the provider id.- Since:
- 2023
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
isKeyPrefixed
protected KeyStrategy
keyStrategy
protected String
providerId
protected int
size
protected static String
SIZE_DELIMITER
protected long
totalBlobCount
protected long
totalBlobSizeCount
-
Constructor Summary
Constructors Constructor Description AbstractBlobScroll()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected boolean
addTo(List<String> list, String key, Supplier<Long> getSize)
Adds the blob key to the list if it is valid (e.g.void
close()
static String
getBlobKey(String id)
static Long
getBlobSize(String id)
void
init(ScrollRequest request, Map<String,String> options)
Initialization of the iterator.protected abstract void
init(T provider)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining, hasNext, next, remove
-
-
-
-
Field Detail
-
SIZE_DELIMITER
protected static final String SIZE_DELIMITER
- See Also:
- Constant Field Values
-
isKeyPrefixed
protected boolean isKeyPrefixed
-
keyStrategy
protected KeyStrategy keyStrategy
-
providerId
protected String providerId
-
size
protected int size
-
totalBlobCount
protected long totalBlobCount
-
totalBlobSizeCount
protected long totalBlobSizeCount
-
-
Method Detail
-
init
public void init(ScrollRequest request, Map<String,String> options)
Description copied from interface:Scroll
Initialization of the iterator.
-
addTo
protected boolean addTo(List<String> list, String key, Supplier<Long> getSize)
Adds the blob key to the list if it is valid (e.g. looks like a digest if the provider has digest strategy).The key added to the list will be prefixed with the provider id if it has to be.
The key added to the list will be suffixed with the size of the associated blob with the
SIZE_DELIMITER
separator.- Parameters:
list
- the list to bekey
- the blob keygetSize
- supplier to sum the total size- Returns:
- true if the key was added to the list
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceScroll
-
init
protected abstract void init(T provider)
-
-