dmlite::INode Class Reference
#include <inode.h>
Inherits dmlite::BaseInterface.
List of all members.
Public Member Functions |
virtual | ~INode () |
| Destructor.
|
virtual void | begin (void) |
| Start a transaction.
|
virtual void | commit (void) |
| Commit a transaction.
|
virtual void | rollback (void) |
| Rollback changes.
|
virtual ExtendedStat | create (const ExtendedStat &f) |
virtual void | symlink (ino_t inode, const std::string &link) |
virtual void | unlink (ino_t inode) |
virtual void | move (ino_t inode, ino_t dest) |
virtual void | rename (ino_t inode, const std::string &name) |
virtual ExtendedStat | extendedStat (ino_t inode) |
virtual DmStatus | extendedStat (ExtendedStat &xstat, ino_t inode) |
virtual ExtendedStat | extendedStat (ino_t parent, const std::string &name) |
virtual DmStatus | extendedStat (ExtendedStat &xstat, ino_t parent, const std::string &name) |
virtual ExtendedStat | extendedStat (const std::string &guid) |
virtual SymLink | readLink (ino_t inode) |
virtual void | addReplica (const Replica &replica) |
virtual void | deleteReplica (const Replica &replica) |
virtual Replica | getReplica (int64_t rid) |
virtual Replica | getReplica (const std::string &rfn) |
virtual void | updateReplica (const Replica &replica) |
virtual std::vector< Replica > | getReplicas (ino_t inode) |
virtual void | utime (ino_t inode, const struct utimbuf *buf) |
virtual void | setMode (ino_t inode, uid_t uid, gid_t gid, mode_t mode, const Acl &acl) |
virtual void | setSize (ino_t inode, size_t size) |
virtual void | setChecksum (ino_t inode, const std::string &csumtype, const std::string &csumvalue) |
virtual std::string | getComment (ino_t inode) |
virtual void | setComment (ino_t inode, const std::string &comment) |
virtual void | deleteComment (ino_t inode) |
virtual void | setGuid (ino_t inode, const std::string &guid) |
virtual void | updateExtendedAttributes (ino_t inode, const Extensible &attr) |
virtual IDirectory * | openDir (ino_t inode) |
virtual void | closeDir (IDirectory *dir) |
virtual ExtendedStat * | readDirx (IDirectory *dir) |
virtual struct dirent * | readDir (IDirectory *dir) |
Detailed Description
Low-level interface. Based on i-nodes.
- Note:
- Security checks NOT done on this level.
Constructor & Destructor Documentation
virtual dmlite::INode::~INode |
( |
|
) |
[virtual] |
Member Function Documentation
virtual void dmlite::INode::addReplica |
( |
const Replica & |
replica |
) |
[virtual] |
Add a new replica for a file.
- Parameters:
-
| replica | Stores the data that is going to be added. fileid must point to the id of the logical file in the catalog. |
virtual void dmlite::INode::begin |
( |
void |
|
) |
[virtual] |
virtual void dmlite::INode::closeDir |
( |
IDirectory * |
dir |
) |
[virtual] |
Close a directory.
- Parameters:
-
| dir | The opaque structure to close. |
virtual void dmlite::INode::commit |
( |
void |
|
) |
[virtual] |
Create a new file or directory
- Parameters:
-
| f | The file that will be inserted. Its fields must be initialized. |
- Returns:
- An stat of the created file.
virtual void dmlite::INode::deleteComment |
( |
ino_t |
inode |
) |
[virtual] |
Remove the associated comment.
- Parameters:
-
| inode | The file whose comment will be removed. |
virtual void dmlite::INode::deleteReplica |
( |
const Replica & |
replica |
) |
[virtual] |
Delete a replica.
- Parameters:
-
| replica | The replica to remove. |
virtual ExtendedStat dmlite::INode::extendedStat |
( |
const std::string & |
guid |
) |
[virtual] |
Do an extended stat using the GUID.
- Parameters:
-
virtual DmStatus dmlite::INode::extendedStat |
( |
ExtendedStat & |
xstat, |
|
|
ino_t |
parent, |
|
|
const std::string & |
name | |
|
) |
| | [virtual] |
Do an extended stat of an entry using the parent inode and the name, exception-safe version.
- Parameters:
-
| xstat | The extended status of the file. |
| parent | The parent inode. |
| name | The file or directory name. |
- Returns:
- The status of the operation.
- Note:
- No security check will be done.
virtual ExtendedStat dmlite::INode::extendedStat |
( |
ino_t |
parent, |
|
|
const std::string & |
name | |
|
) |
| | [virtual] |
Do an extended stat of an entry using the parent inode and the name.
- Parameters:
-
| parent | The parent inode. |
| name | The file or directory name. |
- Note:
- No security check will be done.
Do an extended stat of an entry using its inode, exception-safe version.
- Parameters:
-
| xstat | The extended status of the file. |
| inode | The inode of the file. |
- Returns:
- The status of the operation.
virtual ExtendedStat dmlite::INode::extendedStat |
( |
ino_t |
inode |
) |
[virtual] |
Do an extended stat of an entry using its inode.
- Parameters:
-
| inode | The inode of the file. |
- Returns:
- The extended status of the file.
virtual std::string dmlite::INode::getComment |
( |
ino_t |
inode |
) |
[virtual] |
Get the comment associated to a file.
- Parameters:
-
| inode | The inode of the file. |
- Returns:
- The comment.
virtual Replica dmlite::INode::getReplica |
( |
const std::string & |
rfn |
) |
[virtual] |
Get a replica.
- Parameters:
-
| rfn | The replica to retrieve. |
virtual Replica dmlite::INode::getReplica |
( |
int64_t |
rid |
) |
[virtual] |
Get a replica using the replica ID.
- Parameters:
-
virtual std::vector<Replica> dmlite::INode::getReplicas |
( |
ino_t |
inode |
) |
[virtual] |
Get replicas for a file.
- Parameters:
-
virtual void dmlite::INode::move |
( |
ino_t |
inode, |
|
|
ino_t |
dest | |
|
) |
| | [virtual] |
Move a file between two directories.
- Parameters:
-
| inode | File to be moved. |
| dest | The new parent. |
virtual IDirectory* dmlite::INode::openDir |
( |
ino_t |
inode |
) |
[virtual] |
Open a directory.
- Parameters:
-
| inode | The inode of the directory. |
- Returns:
- An opaque pointer to a directory.
virtual struct dirent* dmlite::INode::readDir |
( |
IDirectory * |
dir |
) |
[read, virtual] |
Read the next entry.
- Parameters:
-
| dir | The opaque structure of a directory. |
- Returns:
- NULL when finished. Extended stat of the next entry otherwise.
Read the next entry.
- Parameters:
-
| dir | The opaque structure of a directory. |
- Returns:
- NULL when finished. Extended stat of the next entry otherwise.
virtual SymLink dmlite::INode::readLink |
( |
ino_t |
inode |
) |
[virtual] |
Get the symlink associated with a inode.
- Parameters:
-
| inode | The inode of the file. |
- Returns:
- A SymLink struct.
- Note:
- If inode is not a symlink, an exception will be thrown.
virtual void dmlite::INode::rename |
( |
ino_t |
inode, |
|
|
const std::string & |
name | |
|
) |
| | [virtual] |
Change the name of a file.
- Parameters:
-
| inode | The inode of the file. |
| name | New name. |
virtual void dmlite::INode::rollback |
( |
void |
|
) |
[virtual] |
virtual void dmlite::INode::setChecksum |
( |
ino_t |
inode, |
|
|
const std::string & |
csumtype, |
|
|
const std::string & |
csumvalue | |
|
) |
| | [virtual] |
Set the checksum of a file.
- Parameters:
-
| inode | The inode of the file. |
| csumtype | The checksum type. |
| csumvalue | The checksum value. |
virtual void dmlite::INode::setComment |
( |
ino_t |
inode, |
|
|
const std::string & |
comment | |
|
) |
| | [virtual] |
Set the comment associated to a file.
- Parameters:
-
| inode | The inode of the file. |
| comment | The new comment. |
virtual void dmlite::INode::setGuid |
( |
ino_t |
inode, |
|
|
const std::string & |
guid | |
|
) |
| | [virtual] |
Set the GUID of a file.
- Parameters:
-
| inode | The inode of the file. |
| guid | The new GUID. |
virtual void dmlite::INode::setMode |
( |
ino_t |
inode, |
|
|
uid_t |
uid, |
|
|
gid_t |
gid, |
|
|
mode_t |
mode, |
|
|
const Acl & |
acl | |
|
) |
| | [virtual] |
Set the mode of a file.
- Parameters:
-
| inode | The inode of the file. |
| uid | The owner. If -1, not changed. |
| gid | The group. If -1, not changed. |
| mode | The new mode. S_IFMT bits are cleared, and kept as they are in the DB. |
| acl | The new ACL. If empty, not changed. |
virtual void dmlite::INode::setSize |
( |
ino_t |
inode, |
|
|
size_t |
size | |
|
) |
| | [virtual] |
Set the size of a file.
- Parameters:
-
| inode | The inode of the file. |
| size | The new size. |
virtual void dmlite::INode::symlink |
( |
ino_t |
inode, |
|
|
const std::string & |
link | |
|
) |
| | [virtual] |
Create or modify the file inode to point to another file.
- Parameters:
-
| inode | The file to modify. |
| link | The new symbolic link. |
- Note:
- This does NOT create the file. Use create first.
virtual void dmlite::INode::unlink |
( |
ino_t |
inode |
) |
[virtual] |
Remove a file or directory. It will fail if it is a directory and it is not empty, or if it a file and it has replicas.
- Parameters:
-
| inode | The inode of the file. |
- Note:
- This will check for non empty directories.
-
This will remove associated comments and replicas.
virtual void dmlite::INode::updateExtendedAttributes |
( |
ino_t |
inode, |
|
|
const Extensible & |
attr | |
|
) |
| | [virtual] |
Update extended metadata on the catalog.
- Parameters:
-
| attr | The extended attributes struct. |
virtual void dmlite::INode::updateReplica |
( |
const Replica & |
replica |
) |
[virtual] |
Modify a replica.
- Parameters:
-
| replica | The replica data. |
virtual void dmlite::INode::utime |
( |
ino_t |
inode, |
|
|
const struct utimbuf * |
buf | |
|
) |
| | [virtual] |
Change access and/or modification time.
- Parameters:
-
| inode | The inode of the file. |
| buf | A struct holding the new times. |
The documentation for this class was generated from the following file: