public class S3Backend extends Object implements SharedS3Backend
| Constructor and Description |
|---|
S3Backend() |
| Modifier and Type | Method and Description |
|---|---|
void |
addMetadataRecord(File input,
String name)
Adds a metadata record with the specified name
|
void |
addMetadataRecord(InputStream input,
String name)
Adds a metadata record with the specified name
|
void |
close() |
void |
deleteAllMetadataRecords(String prefix)
Deletes all the metadata records with the specified prefix.
|
Set<DataIdentifier> |
deleteAllOlderThan(long min) |
boolean |
deleteMetadataRecord(String name)
Deletes the metadata record with the specified name
|
void |
deleteRecord(DataIdentifier identifier) |
boolean |
exists(DataIdentifier identifier)
Check if record identified by identifier exists in Amazon S3.
|
boolean |
exists(DataIdentifier identifier,
boolean touch) |
Iterator<DataIdentifier> |
getAllIdentifiers() |
List<DataRecord> |
getAllMetadataRecords(String prefix)
Gets all the metadata with a specified prefix.
|
Iterator<DataRecord> |
getAllRecords()
Returns a list of all DataRecords
|
String |
getBucket() |
long |
getLastModified(DataIdentifier identifier) |
long |
getLength(DataIdentifier identifier) |
DataRecord |
getMetadataRecord(String name)
Gets the metadata of the specified name.
|
DataRecord |
getRecord(DataIdentifier identifier)
Gets the record with the specified identifier
|
void |
init(CachingDataStore store,
String homeDir,
Properties prop) |
void |
init(CachingDataStore store,
String homeDir,
String config)
Initialize S3Backend.
|
InputStream |
read(DataIdentifier identifier) |
void |
setBucket(String bucket) |
void |
setProperties(Properties properties)
Properties used to configure the backend.
|
void |
touch(DataIdentifier identifier,
long minModifiedDate) |
void |
touchAsync(DataIdentifier identifier,
long minModifiedDate,
AsyncTouchCallback callback) |
void |
write(DataIdentifier identifier,
File file)
It uploads file to Amazon S3.
|
void |
writeAsync(DataIdentifier identifier,
File file,
AsyncUploadCallback callback) |
public void init(CachingDataStore store, String homeDir, String config) throws DataStoreException
init in interface BackendDataStoreExceptionpublic void init(CachingDataStore store, String homeDir, Properties prop) throws DataStoreException
DataStoreExceptionpublic void write(DataIdentifier identifier, File file) throws DataStoreException
write in interface BackendDataStoreExceptionpublic void writeAsync(DataIdentifier identifier, File file, AsyncUploadCallback callback) throws DataStoreException
writeAsync in interface BackendDataStoreExceptionpublic boolean exists(DataIdentifier identifier) throws DataStoreException
exists in interface BackendDataStoreExceptionpublic boolean exists(DataIdentifier identifier, boolean touch) throws DataStoreException
exists in interface BackendDataStoreExceptionpublic void touchAsync(DataIdentifier identifier, long minModifiedDate, AsyncTouchCallback callback) throws DataStoreException
touchAsync in interface BackendDataStoreExceptionpublic void touch(DataIdentifier identifier, long minModifiedDate) throws DataStoreException
touch in interface BackendDataStoreExceptionpublic InputStream read(DataIdentifier identifier) throws DataStoreException
read in interface BackendDataStoreExceptionpublic Iterator<DataIdentifier> getAllIdentifiers() throws DataStoreException
getAllIdentifiers in interface BackendDataStoreExceptionpublic long getLastModified(DataIdentifier identifier) throws DataStoreException
getLastModified in interface BackendDataStoreExceptionpublic long getLength(DataIdentifier identifier) throws DataStoreException
getLength in interface BackendDataStoreExceptionpublic void deleteRecord(DataIdentifier identifier) throws DataStoreException
deleteRecord in interface BackendDataStoreExceptionpublic Set<DataIdentifier> deleteAllOlderThan(long min) throws DataStoreException
deleteAllOlderThan in interface BackendDataStoreExceptionpublic String getBucket()
public void setBucket(String bucket)
public void setProperties(Properties properties)
properties - to configure S3Backendpublic void addMetadataRecord(InputStream input, String name) throws DataStoreException
SharedS3BackendaddMetadataRecord in interface SharedS3Backendinput - the record input streamname - the nameDataStoreExceptionpublic void addMetadataRecord(File input, String name) throws DataStoreException
SharedS3BackendaddMetadataRecord in interface SharedS3Backendinput - the record filename - the nameDataStoreExceptionpublic DataRecord getMetadataRecord(String name)
SharedS3BackendgetMetadataRecord in interface SharedS3Backendname - the name of the recordpublic List<DataRecord> getAllMetadataRecords(String prefix)
SharedS3BackendgetAllMetadataRecords in interface SharedS3Backendprefix - the prefix of the records to retrievepublic boolean deleteMetadataRecord(String name)
SharedS3BackenddeleteMetadataRecord in interface SharedS3Backendname - the name of the recordpublic void deleteAllMetadataRecords(String prefix)
SharedS3BackenddeleteAllMetadataRecords in interface SharedS3Backendprefix - the prefix of the recordpublic Iterator<DataRecord> getAllRecords()
SharedS3BackendgetAllRecords in interface SharedS3Backendpublic DataRecord getRecord(DataIdentifier identifier) throws DataStoreException
SharedS3BackendgetRecord in interface SharedS3Backendidentifier - the record identifierDataStoreExceptionCopyright © 2012-2017 The Apache Software Foundation. All Rights Reserved.