Class BlobStoreConnector.Abstract<B>
java.lang.Object
one.microstream.afs.blobstore.types.BlobStoreConnector.Abstract<B>
- Type Parameters:
B
- the blob type
- All Implemented Interfaces:
AutoCloseable
,BlobStoreConnector
- Direct Known Subclasses:
AzureStorageConnector.Default
,DynamoDbConnector.Default
,GoogleCloudFirestoreConnector.Default
,HazelcastConnector.Default
,KafkaConnector.Default
,OracleCloudObjectStorageConnector.Default
,OracleCoherenceConnector.Default
,RedisConnector.Default
,S3Connector.Default
- Enclosing interface:
- BlobStoreConnector
public abstract static class BlobStoreConnector.Abstract<B> extends Object implements BlobStoreConnector
-
Nested Class Summary
Nested classes/interfaces inherited from interface one.microstream.afs.blobstore.types.BlobStoreConnector
BlobStoreConnector.Abstract<B>
-
Field Summary
Fields Modifier and Type Field Description protected static String
NUMBER_SUFFIX_REGEX
protected static String
NUMBER_SUFFIX_SEPARATOR
protected static char
NUMBER_SUFFIX_SEPARATOR_CHAR
-
Constructor Summary
Constructors Modifier Constructor Description protected
Abstract(Function<B,String> blobKeyProvider, ToLongFunction<B> blobSizeProvider, boolean useCache)
protected
Abstract(Function<B,String> blobKeyProvider, ToLongFunction<B> blobSizeProvider, BlobStorePath.Validator blobStorePathValidator, boolean useCache)
-
Method Summary
Modifier and Type Method Description protected Comparator<B>
blobComparator()
protected static String
blobKeyRegex(String prefix)
protected long
blobNumber(B blob)
protected abstract Stream<? extends B>
blobs(BlobStorePath file)
protected abstract Stream<String>
childKeys(BlobStorePath directory)
protected static String
childKeysRegex(BlobStorePath directory)
protected static String
childKeysRegexWithContainer(BlobStorePath directory)
void
close()
long
copyFile(BlobStorePath sourceFile, BlobStorePath targetFile, long offset, long length)
boolean
createDirectory(BlobStorePath directory)
boolean
createFile(BlobStorePath file)
boolean
deleteFile(BlobStorePath file)
boolean
directoryExists(BlobStorePath directory)
protected static String
directoryNameOfKey(String key)
protected void
ensureOpen()
boolean
fileExists(BlobStorePath file)
protected String
fileNameOfKey(String key)
long
fileSize(BlobStorePath file)
protected void
internalClose()
protected long
internalCopyFile(BlobStorePath sourceFile, BlobStorePath targetFile, long offset, long length)
protected boolean
internalCreateDirectory(BlobStorePath directory)
protected boolean
internalCreateFile(BlobStorePath file)
protected abstract boolean
internalDeleteBlobs(BlobStorePath file, List<? extends B> blobs)
protected boolean
internalDeleteFile(BlobStorePath file)
protected boolean
internalDirectoryExists(BlobStorePath directory)
protected boolean
internalFileExists(BlobStorePath file)
protected long
internalFileSize(BlobStorePath file)
protected boolean
internalIsEmpty(BlobStorePath directory)
protected void
internalMoveFile(BlobStorePath sourceFile, BlobStorePath targetFile)
protected abstract void
internalReadBlobData(BlobStorePath file, B blob, ByteBuffer targetBuffer, long offset, long length)
protected ByteBuffer
internalReadData(BlobStorePath file, long offset, long length)
protected long
internalReadData(BlobStorePath file, ByteBuffer targetBuffer, long offset, long length)
protected long
internalReadData(BlobStorePath file, LongFunction<ByteBuffer> bufferProvider, long offset, long length)
protected void
internalTruncateFile(BlobStorePath file, long newLength)
protected void
internalVisitChildren(BlobStorePath directory, BlobStorePathVisitor visitor)
protected abstract long
internalWriteData(BlobStorePath file, Iterable<? extends ByteBuffer> sourceBuffers)
protected static boolean
isBlobKey(String key)
protected static boolean
isDirectoryKey(String key)
boolean
isEmpty(BlobStorePath directory)
void
moveFile(BlobStorePath sourceFile, BlobStorePath targetFile)
protected long
nextBlobNumber(BlobStorePath file)
ByteBuffer
readData(BlobStorePath file, long offset, long length)
long
readData(BlobStorePath file, ByteBuffer targetBuffer, long offset, long length)
protected static String
removeNumberSuffix(String key)
protected static String
toBlobKey(BlobStorePath file, long nr)
protected static String
toBlobKeyPrefix(BlobStorePath file)
protected static String
toBlobKeyPrefixWithContainer(BlobStorePath file)
protected static String
toBlobKeyWithContainer(BlobStorePath file, long nr)
protected static String
toChildKeysPrefix(BlobStorePath directory)
protected static String
toChildKeysPrefixWithContainer(BlobStorePath directory)
protected static String
toContainerKey(BlobStorePath directory)
protected long
totalSize(Iterable<? extends ByteBuffer> sourceBuffers)
void
truncateFile(BlobStorePath file, long newLength)
void
visitChildren(BlobStorePath directory, BlobStorePathVisitor visitor)
long
writeData(BlobStorePath file, Iterable<? extends ByteBuffer> sourceBuffers)
-
Field Details
-
NUMBER_SUFFIX_SEPARATOR
- See Also:
- Constant Field Values
-
NUMBER_SUFFIX_SEPARATOR_CHAR
protected static final char NUMBER_SUFFIX_SEPARATOR_CHAR- See Also:
- Constant Field Values
-
NUMBER_SUFFIX_REGEX
- See Also:
- Constant Field Values
-
-
Constructor Details
-
Abstract
protected Abstract(Function<B,String> blobKeyProvider, ToLongFunction<B> blobSizeProvider, boolean useCache) -
Abstract
protected Abstract(Function<B,String> blobKeyProvider, ToLongFunction<B> blobSizeProvider, BlobStorePath.Validator blobStorePathValidator, boolean useCache)
-
-
Method Details
-
toContainerKey
-
toBlobKey
-
toBlobKeyWithContainer
-
toBlobKeyPrefix
-
toBlobKeyPrefixWithContainer
-
blobKeyRegex
-
toChildKeysPrefix
-
toChildKeysPrefixWithContainer
-
childKeysRegex
-
childKeysRegexWithContainer
-
removeNumberSuffix
-
isBlobKey
-
isDirectoryKey
-
directoryNameOfKey
-
blobs
-
childKeys
-
internalDeleteBlobs
-
internalReadBlobData
protected abstract void internalReadBlobData(BlobStorePath file, B blob, ByteBuffer targetBuffer, long offset, long length) -
internalWriteData
protected abstract long internalWriteData(BlobStorePath file, Iterable<? extends ByteBuffer> sourceBuffers) -
internalFileSize
-
internalDirectoryExists
-
internalFileExists
-
internalIsEmpty
-
internalVisitChildren
-
fileNameOfKey
-
internalCreateDirectory
-
internalCreateFile
-
internalDeleteFile
-
internalReadData
-
internalReadData
protected long internalReadData(BlobStorePath file, ByteBuffer targetBuffer, long offset, long length) -
internalMoveFile
-
internalCopyFile
protected long internalCopyFile(BlobStorePath sourceFile, BlobStorePath targetFile, long offset, long length) -
internalTruncateFile
-
ensureOpen
protected final void ensureOpen() -
internalClose
protected void internalClose() -
blobComparator
-
blobNumber
-
nextBlobNumber
-
internalReadData
protected long internalReadData(BlobStorePath file, LongFunction<ByteBuffer> bufferProvider, long offset, long length) -
totalSize
-
fileSize
- Specified by:
fileSize
in interfaceBlobStoreConnector
-
directoryExists
- Specified by:
directoryExists
in interfaceBlobStoreConnector
-
fileExists
- Specified by:
fileExists
in interfaceBlobStoreConnector
-
isEmpty
- Specified by:
isEmpty
in interfaceBlobStoreConnector
-
visitChildren
- Specified by:
visitChildren
in interfaceBlobStoreConnector
-
createDirectory
- Specified by:
createDirectory
in interfaceBlobStoreConnector
-
createFile
- Specified by:
createFile
in interfaceBlobStoreConnector
-
deleteFile
- Specified by:
deleteFile
in interfaceBlobStoreConnector
-
readData
- Specified by:
readData
in interfaceBlobStoreConnector
-
readData
- Specified by:
readData
in interfaceBlobStoreConnector
-
writeData
- Specified by:
writeData
in interfaceBlobStoreConnector
-
moveFile
- Specified by:
moveFile
in interfaceBlobStoreConnector
-
copyFile
public final long copyFile(BlobStorePath sourceFile, BlobStorePath targetFile, long offset, long length)- Specified by:
copyFile
in interfaceBlobStoreConnector
-
truncateFile
- Specified by:
truncateFile
in interfaceBlobStoreConnector
-
close
public final void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceBlobStoreConnector
-