Package convex.dlfs
Class DLFileSystem
java.lang.Object
java.nio.file.FileSystem
convex.dlfs.DLFileSystem
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Cloneable
- Direct Known Subclasses:
DLFSLocal
Base class for Data Lattice FileSystems.
A Data Lattice FileSystem has:
- A single root directory
- A method of snapshotting any path on the tree
- An efficient method of cloning the Drive with an immutable snapshot
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
DLFileSystem
(DLFSProvider dlfsProvider, String uriPath, CVMLong timestamp) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
checkAccess
(DLPath path) Implementation for DLFSProvider delegationabstract DLFileSystem
clone()
void
close()
protected abstract DLPath
createDirectory
(DLPath dir, FileAttribute<?>[] attrs) Implementation for delegation by DLFSProvider, create a directorycreateFile
(DLPath path) Creates a file, returning the new nodeabstract void
Gets an empty path for this FileSystemgetFileAttributes
(DLPath path) Gets DLFS node for the given pathgetPathMatcher
(String syntaxAndPattern) getRoot()
Gets the unique root path for this FileSystemabstract Hash
final CVMLong
Gets the timestamp of this DLFS driveboolean
isOpen()
boolean
abstract void
Merges another DLFS drive into this oneabstract SeekableByteChannel
newByteChannel
(DLPath path, Set<? extends OpenOption> options, FileAttribute<?>[] attrs) Implementation for delegation by DLFSProviderabstract DLDirectoryStream
newDirectoryStream
(DLPath dir, DirectoryStream.Filter<? super Path> filter) Implementation for delegation by DLFSProviderprovider()
void
replicate
(DLFileSystem other) final void
setTimestamp
(CVMLong newTimestamp) Sets the timestamp of this DLFS driveupdateNode
(DLPath path, AVector<ACell> newNode) Updates a node, returning the new nodeUpdates the timestamp of the drive to the current system timestampupdateTimestamp
(long newTimestamp) Updates the timestamp of this DLFS drive to the maximum of the given timestamp or it's current time stamp
-
Field Details
-
provider
-
root
-
emptyPath
-
uriPath
-
-
Constructor Details
-
DLFileSystem
-
-
Method Details
-
provider
- Specified by:
provider
in classFileSystem
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classFileSystem
- Throws:
IOException
-
getTimestamp
Gets the timestamp of this DLFS drive- Returns:
- Current timestamp as a CVM integer
-
setTimestamp
Sets the timestamp of this DLFS drive- Parameters:
newTimestamp
- New timestamp
-
updateTimestamp
Updates the timestamp of this DLFS drive to the maximum of the given timestamp or it's current time stamp- Parameters:
newTimestamp
- Potential new timestamp- Returns:
- The new timestamp value, or the original one if unchanged
-
updateTimestamp
Updates the timestamp of the drive to the current system timestamp -
isOpen
public boolean isOpen()- Specified by:
isOpen
in classFileSystem
-
isReadOnly
public boolean isReadOnly()- Specified by:
isReadOnly
in classFileSystem
-
getSeparator
- Specified by:
getSeparator
in classFileSystem
-
getRootDirectories
- Specified by:
getRootDirectories
in classFileSystem
-
getFileStores
- Specified by:
getFileStores
in classFileSystem
-
supportedFileAttributeViews
- Specified by:
supportedFileAttributeViews
in classFileSystem
-
getPath
- Specified by:
getPath
in classFileSystem
-
getPathMatcher
- Specified by:
getPathMatcher
in classFileSystem
-
getUserPrincipalLookupService
- Specified by:
getUserPrincipalLookupService
in classFileSystem
-
newWatchService
- Specified by:
newWatchService
in classFileSystem
- Throws:
IOException
-
getRoot
Gets the unique root path for this FileSystem- Returns:
- Path instance to root
-
getEmptyPath
-
newByteChannel
public abstract SeekableByteChannel newByteChannel(DLPath path, Set<? extends OpenOption> options, FileAttribute<?>[] attrs) throws IOException Implementation for delegation by DLFSProvider- Parameters:
path
- Path for new fileoptions
- Options for file creationattrs
- File attributes- Returns:
- ByteChannel instance
- Throws:
IOException
- In case of IO Error
-
newDirectoryStream
public abstract DLDirectoryStream newDirectoryStream(DLPath dir, DirectoryStream.Filter<? super Path> filter) Implementation for delegation by DLFSProvider- Returns:
- Directory stream
-
getFileAttributes
-
getNode
-
createDirectory
Implementation for delegation by DLFSProvider, create a directory- Returns:
- Throws:
IOException
-
checkAccess
Implementation for DLFSProvider delegation- Parameters:
path
-- Throws:
IOException
-
delete
- Throws:
IOException
-
getRootHash
-
getNodeHash
-
createFile
Creates a file, returning the new node- Parameters:
path
- Path for which to create DLFSNode- Returns:
- New file node
- Throws:
IOException
- In event of IOError
-
updateNode
-
merge
-
replicate
-
clone
-