Tokens and their distribution and management by the File Exporter are completely transparent at the user level. The File Exporter uses tokens to
· Track the clients to which it has given data and the types of operations they are permitted to perform on the data.
· Ensure that multiple clients are not simultaneously accessing the same data in a conflicting manner.
· Guarantee that each client always has access to the most-recent versions of read/write data. If data stored on a File Server machine changes while a client has a copy of it, the File Exporter on that machine notifies the client; the client then obtains the new version of the data the next time it needs it.
Different operations require different types of tokens. DFS includes four general classes of tokens:
Open Tokens
Allow a client to open an entire file or fileset to read from it, write to it, delete it, or prevent it from being deleted. For example, a client that wants to open a file
for reading requests an open token for the file.
Status Tokens
Allow a client to read or write file status information. For example, a client that wants to append data to a file, thus changing its size, needs a status token for the
file.
Data Tokens
Allow a client to read from or write to a range of bytes in a file. For example, a client that wants to modify the first 10 bytes of a file requests a data token for those
bytes.
Lock Tokens
Allow a client to read lock or write lock a range of bytes in a file. For example, a client that must ensure that only one process is locking the first 10 bytes of a file
requests a lock token for those bytes.
Each token class includes a number of token types; for example, the data class includes the read data and write data types. The different classes and types of tokens combine to allow for the different kinds of data access required by file system clients. Most operations require that a client possess multiple tokens for the data it wishes to manipulate; for instance, appending text to a file requires open tokens to access the file, data tokens to modify the contents of the file, and status tokens to change the size of the file.
Some tokens can be granted to different clients simultaneously, while others cannot. Two tokens that can be granted simultaneously are said to be compatible; two tokens that cannot be granted at the same time are said to be conflicting. A token is always compatible with tokens from other classes, but it may conflict with other token types from within its class. In general, the token types associated with read operations are mutually compatible, while those associated with write operations conflict with other tokens.