Constructor and Description |
---|
BmcDataStore(BmcPropertyAccessor propertyAccessor,
com.oracle.bmc.objectstorage.ObjectStorage objectStorage,
String namespace,
String bucket,
FileSystem.Statistics statistics) |
Modifier and Type | Method and Description |
---|---|
static String |
configureParquetCacheString(BmcPropertyAccessor propertyAccessor) |
void |
createDirectory(Path path)
Creates a pseudo directory at the given path.
|
void |
delete(Path path)
Deletes the object at the given path.
|
void |
deleteDirectory(Path path)
Deletes the directory at the given path.
|
org.apache.commons.lang3.tuple.Pair<List<FileStatus>,String> |
flatListDirectoryRecursive(Path path,
String nextToken)
A method to list all files/dirs in a given directory in a flat manner.
|
long |
getBlockSizeInBytes()
Gets the configured block size in bytes.
|
ContentSummary |
getContentSummary(Path path) |
FileStatus |
getFileStatus(Path path)
Returns the
FileStatus for the object at the given path. |
static int |
getReadAheadSizeInBytes(BmcPropertyAccessor propertyAccessor) |
boolean |
isEmptyDirectory(Path path)
Tests to see if the directory at the given path is considered empty or not.
|
List<FileStatus> |
listDirectory(Path path)
Returns the status of each entry in the directory specified.
|
FSInputStream |
openReadStream(FileStatus status,
Path path,
int bufferSizeInBytes,
FileSystem.Statistics statistics)
Creates a new
FSInputStream that can be used to read the object at the given path. |
OutputStream |
openWriteStream(Path path,
int bufferSizeInBytes,
Progressable progress)
Creates a new
OutputStream that can be written to in order to create a new file. |
void |
renameDirectory(Path sourceDirectoryPath,
Path destinationDirectoryPath)
Renames a directory to have a new location or name.
|
void |
renameFile(Path source,
Path destination)
Renames an object from one name to another.
|
public BmcDataStore(BmcPropertyAccessor propertyAccessor, com.oracle.bmc.objectstorage.ObjectStorage objectStorage, String namespace, String bucket, FileSystem.Statistics statistics)
public static int getReadAheadSizeInBytes(BmcPropertyAccessor propertyAccessor)
public static String configureParquetCacheString(BmcPropertyAccessor propertyAccessor)
public void renameFile(Path source, Path destination) throws IOException
source
- The source to rename, assumed to exist.destination
- The destination, may not exist, will be overwrittenIOException
- if the operation cannot be completed.public void renameDirectory(Path sourceDirectoryPath, Path destinationDirectoryPath) throws IOException
Note, source and destination should not be root TODO: destination could be?
sourceDirectoryPath
- The source directory to rename, assumed to exist.destinationDirectoryPath
- The destination directory.IOException
- if the operation cannot be completed.public void delete(Path path) throws IOException
path
- Path of object to delete.IOException
- if the operation cannot be completed.public void deleteDirectory(Path path) throws IOException
path
- Path of object to delete.IOException
- if the operation cannot be completed.public void createDirectory(Path path) throws IOException
path
- The path to create a directory object at.IOException
- if the operation cannot be completed.public boolean isEmptyDirectory(Path path) throws IOException
path
- The directory path.IOException
- if the operation could not be completed.public List<FileStatus> listDirectory(Path path) throws IOException
path
- The directory path.IOException
- if the operation could not be completedpublic org.apache.commons.lang3.tuple.Pair<List<FileStatus>,String> flatListDirectoryRecursive(Path path, String nextToken) throws IOException
path
- The path to the directory for which the listing needs to be done.nextToken
- This is the token string in order to continue with a next page of results. It should be
passed null in the first call to start fresh.IOException
public ContentSummary getContentSummary(Path path) throws IOException
IOException
public FileStatus getFileStatus(Path path) throws IOException
FileStatus
for the object at the given path.path
- The path to query.IOException
- if the operation could not be completed.public FSInputStream openReadStream(FileStatus status, Path path, int bufferSizeInBytes, FileSystem.Statistics statistics)
FSInputStream
that can be used to read the object at the given path.status
- The file status for this file.path
- The path to open.bufferSizeInBytes
- The buffer size in bytes (may not be used).statistics
- The FileSystem.Statistics
instance to publish metrics into.public OutputStream openWriteStream(Path path, int bufferSizeInBytes, Progressable progress)
OutputStream
that can be written to in order to create a new file.path
- The path for the new file.bufferSizeInBytes
- The buffer size in bytes can be configured by setting the config key BmcConstants.MULTIPART_PART_SIZE_IN_MB_KEY
.
Default value is 128MiB which comes from OCI Java SDK UploadConfiguration
progress
- Progressable
instance to report progress updates to.public long getBlockSizeInBytes()
Copyright © 2016–2023. All rights reserved.