Package org.yamcs.yarch
Class FileSystemBucketDatabase
- java.lang.Object
-
- org.yamcs.yarch.FileSystemBucketDatabase
-
- All Implemented Interfaces:
BucketDatabase
public class FileSystemBucketDatabase extends Object implements BucketDatabase
BucketDatabaseimplementation that maps objects to files on a file system.
-
-
Constructor Summary
Constructors Constructor Description FileSystemBucketDatabase(String yamcsInstance)FileSystemBucketDatabase(String yamcsInstance, Map<String,Object> args)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FileSystemBucketcreateBucket(String bucketName)voiddeleteBucket(String bucketName)FileSystemBucketgetBucket(String bucketName)Retrieve a bucket handler from the database.PathgetRootPath()List<Tablespace.BucketProperties>listBuckets()FileSystemBucketregisterBucket(String bucketName, Path location)Manually register a bucket based on a location on the file system.
-
-
-
Constructor Detail
-
FileSystemBucketDatabase
public FileSystemBucketDatabase(String yamcsInstance) throws IOException
- Throws:
IOException
-
FileSystemBucketDatabase
public FileSystemBucketDatabase(String yamcsInstance, Map<String,Object> args) throws IOException
- Throws:
IOException
-
-
Method Detail
-
createBucket
public FileSystemBucket createBucket(String bucketName) throws IOException
- Specified by:
createBucketin interfaceBucketDatabase- Throws:
IOException
-
registerBucket
public FileSystemBucket registerBucket(String bucketName, Path location) throws IOException
Manually register a bucket based on a location on the file system.It is not necessary to register buckets that exist in the standard location (directly under under dataDir).
Remark that bucket registration is transient.
- Parameters:
bucketName- the name of the bucket.location- the path to the bucket. This location should already exist.- Throws:
IOException
-
getBucket
public FileSystemBucket getBucket(String bucketName) throws IOException
Description copied from interface:BucketDatabaseRetrieve a bucket handler from the database.- Specified by:
getBucketin interfaceBucketDatabase- Returns:
- the bucket with the given name or null if it does not exist
- Throws:
IOException
-
listBuckets
public List<Tablespace.BucketProperties> listBuckets() throws IOException
- Specified by:
listBucketsin interfaceBucketDatabase- Throws:
IOException
-
deleteBucket
public void deleteBucket(String bucketName) throws IOException
- Specified by:
deleteBucketin interfaceBucketDatabase- Throws:
IOException
-
getRootPath
public Path getRootPath()
-
-