public class HashFileSystem extends ContentAddressableStorageAbstract
LISTING_MAX_RESULTS
Constructor and Description |
---|
HashFileSystem(StorageConfiguration configuration) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
createContainer(String containerName)
Creates a container
|
String |
createReadOrderRequest(String containerName,
List<String> objectsIds)
Create read order (asynchronous read from tape to local FS) for the given objects representing the data at location containerName/objectId.
|
void |
deleteObject(String containerName,
String objectName)
Deletes a object representing the data at location containerName/objectName
|
ContainerInformation |
getContainerInformation(String containerName)
Get container information like capacity
|
ObjectContent |
getObject(String containerName,
String objectName)
Retrieves an object representing the data at location containerName/objectName
|
String |
getObjectDigest(String containerName,
String objectName,
DigestType algo,
boolean noCache)
compute Object Digest using a defined algorithm
|
MetadatasObject |
getObjectMetadata(String containerName,
String objectId,
boolean noCache)
get metadata of the object
|
boolean |
isExistingContainer(String containerName)
Determines if a container exists
|
boolean |
isExistingObject(String containerName,
String objectName)
Determines if an object exists
|
VitamPageSet<? extends VitamStorageMetadata> |
listContainer(String containerName)
List container (create cursor)
|
VitamPageSet<? extends VitamStorageMetadata> |
listContainerNext(String containerName,
String nextMarker)
List container (next on cursor)
|
String |
putObject(String containerName,
String objectName,
InputStream stream,
DigestType digestType,
Long size)
Adds an object representing the data at location containerName/objectName
|
void |
removeReadOrderRequest(String readRequestID)
Purge all read request id to cleanup local FS
|
cacheExistsContainer, computeObjectDigest, disableContainerCaching, getConfiguration, isExistingContainerInCache
public HashFileSystem(StorageConfiguration configuration)
configuration
- public void createContainer(String containerName) throws ContentAddressableStorageServerException
ContentAddressableStorage
containerName
- name of container to createContentAddressableStorageServerException
- Thrown when internal server error happenspublic boolean isExistingContainer(String containerName)
ContentAddressableStorage
containerName
- name of containerpublic String putObject(String containerName, String objectName, InputStream stream, DigestType digestType, Long size) throws ContentAddressableStorageException
ContentAddressableStorage
containerName
- container to place the object.objectName
- fully qualified object name relative to the container.stream
- the datadigestType
- parameter to compute an hash.size
- size off the input streamContentAddressableStorageNotFoundException
- Thrown when the container cannot be located.ContentAddressableStorageException
- Thrown when put action failed due some other failureContentAddressableStorageAlreadyExistException
- Thrown when object creating existspublic ObjectContent getObject(String containerName, String objectName) throws ContentAddressableStorageException
ContentAddressableStorage
containerName
- container where this exists.objectName
- fully qualified name relative to the container.ContentAddressableStorageNotFoundException
- Thrown when the container cannot be located.ContentAddressableStorageException
- Thrown when get action failed due some other failureContentAddressableStorageAlreadyExistException
- Thrown when object creating existspublic String createReadOrderRequest(String containerName, List<String> objectsIds)
ContentAddressableStorage
containerName
- container where this exists.objectsIds
- list of the fully qualified name relative to the container.public void removeReadOrderRequest(String readRequestID)
ContentAddressableStorage
readRequestID
- the read request ID.public void deleteObject(String containerName, String objectName) throws ContentAddressableStorageException
ContentAddressableStorage
containerName
- container where this exists.objectName
- fully qualified name relative to the container.ContentAddressableStorageNotFoundException
- Thrown when the container cannot be located or the blob cannot
be located in the container.ContentAddressableStorageException
- Thrown when delete action failed due some other failurepublic boolean isExistingObject(String containerName, String objectName) throws ContentAddressableStorageServerException
ContentAddressableStorage
containerName
- container where the object residesobjectName
- fully qualified name relative to the container.ContentAddressableStorageServerException
- Thrown when internal server error happenspublic String getObjectDigest(String containerName, String objectName, DigestType algo, boolean noCache) throws ContentAddressableStorageException
ContentAddressableStorage
containerName
- container where this exists.objectName
- fully qualified name relative to the container.algo
- Digest algonoCache
- forces full digest computationContentAddressableStorageNotFoundException
- Thrown when the container or the object cannot be locatedContentAddressableStorageServerException
- Thrown when internal server error happensContentAddressableStorageException
- Thrown when put action failed due some other failurepublic ContainerInformation getContainerInformation(String containerName) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageServerException
ContentAddressableStorage
containerName
- the container nameContentAddressableStorageNotFoundException
- Thrown when the container cannot be located.ContentAddressableStorageServerException
- Thrown when internal server error happenspublic MetadatasObject getObjectMetadata(String containerName, String objectId, boolean noCache) throws ContentAddressableStorageException, IOException
ContentAddressableStorage
containerName
- the container nameobjectId
- the objectId to checkContentAddressableStorageException
- Thrown when get action failed due some other failureIOException
- if an IOException is encountered with filespublic VitamPageSet<? extends VitamStorageMetadata> listContainer(String containerName) throws ContentAddressableStorageServerException
ContentAddressableStorage
containerName
- the container nameContentAddressableStorageServerException
- Thrown when internal server error happenspublic VitamPageSet<? extends VitamStorageMetadata> listContainerNext(String containerName, String nextMarker) throws ContentAddressableStorageServerException
ContentAddressableStorage
containerName
- the container namenextMarker
- the last id of the list to get nextContentAddressableStorageServerException
- Thrown when internal server error happenspublic void close()
Copyright © 2019 Vitam. All rights reserved.