Class TarFileSystem
java.lang.Object
java.nio.file.FileSystem
org.epics.archiverappliance.utils.nio.tar.TarFileSystem
- All Implemented Interfaces:
Closeable,AutoCloseable,ETLOptimizable
An NIO2 file system that encapsulates a tar file containing gzipped pb files.
This is intended to be used as a extra-long-term-store where performance of retrieval is not necessarily a requirement.
There is limited support for updating a file; updating an existing entry relies on logical deletes and is inefficient.
There is support for optimizing a tar file by copying into a new file and discarding all the logically deleted blocks ( similar to MySQL's optimize )
Only the final component of the path is used to identify the tar entry.
Given a path of the form
tar:///arch/XLTS/epics/arch/tartest:2016.pb, we map it to the tar file /arch/XLTS/epics/arch/tartest.tar
and the entry tartest:2016.pb or tartest:2016.parquet within the tar file.
We do not maintain nested paths inside a tar file system; the tar catalog is treated as a single directory containing all the entries in the tar file.
Also, for now, we do not support links, devices and other tar features.
Because updates and deletes are inefficient logical operations, a tar data store is expected to be the very last data store in a PVTypeInfo.
ETL into and out of an tar data store is expected to be infrequent ( maybe once a year ).-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()booleangetPathMatcher(String syntaxAndPattern) booleanisOpen()booleanlookupTarEntry(String entryName) lookupTarEntry(String entryName, TarEntry defaultEntry) lookupTarEntry(Path path) booleanbooleanoptimize()provider()void
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classFileSystem- Throws:
IOException
-
getFileStores
- Specified by:
getFileStoresin classFileSystem
-
getPath
- Specified by:
getPathin classFileSystem
-
getPathMatcher
- Specified by:
getPathMatcherin classFileSystem
-
getRootDirectories
- Specified by:
getRootDirectoriesin classFileSystem
-
getSeparator
- Specified by:
getSeparatorin classFileSystem
-
getUserPrincipalLookupService
- Specified by:
getUserPrincipalLookupServicein classFileSystem
-
isOpen
public boolean isOpen()- Specified by:
isOpenin classFileSystem
-
isReadOnly
public boolean isReadOnly()- Specified by:
isReadOnlyin classFileSystem
-
newWatchService
- Specified by:
newWatchServicein classFileSystem- Throws:
IOException
-
provider
- Specified by:
providerin classFileSystem
-
supportedFileAttributeViews
- Specified by:
supportedFileAttributeViewsin classFileSystem
-
getTarPath
-
getTarFile
-
getTarFileCatalog
-
lookupTarEntry
-
lookupTarEntry
-
lookupTarEntry
-
reloadCatalog
- Throws:
IOException
-
equals
-
needsOptimization
- Throws:
IOException
-
optimize
- Specified by:
optimizein interfaceETLOptimizable- Throws:
IOException
-