VolD 0.1

de.zib.vold.frontend.Frontend Class Reference

The Frontend used by the user interfaces for VolD. More...

Collaboration diagram for de.zib.vold.frontend.Frontend:

List of all members.

Public Member Functions

 Frontend ()
 Construct an uninitialized Frontend.
void setVolatileDirectory (VolatileDirectory volatileDirectory)
 Set the volatile directory to store the informations in.
boolean getRecursiveScopeLookups ()
 Are recursive scope lookups enabled?
void setRecursiveScopeLookups (boolean recursiveScopeLookups)
 Enable/disable recursive scope lookups.
boolean getPrefixLookupsAllowed ()
 Are prefix lookups allowed?
void setPrefixLookupsAllowed (boolean prefixLookupsAllowed)
 (Do not) allow prefix lookups.
void insert (String source, Key key, Set< String > value)
 Insert a key.
void refresh (String source, Key key)
 Refresh a key.
void delete (String source, Key key)
 Delete a key.
Map< Key, Set< String > > lookup (Key key)
 Lookup the specified key.

Protected Member Functions

void checkState ()
 Internal method which acts as part of the guard of all public methods.

Package Attributes

final String scopeDelimiter = "/"

Private Member Functions

String prepare_prefix_key (String key)
 Prepare key for (prefix-) lookup.
String scope_base (String scope)
 Get the parent of a scope.
Map< Key, Set< String > > scopeLookup (Key key)
 Lookup the specified key only in the given scope.

Private Attributes

final ReentrantReadWriteLock rwlock
VolatileDirectory volatileDirectory
boolean recursiveScopeLookups
boolean prefixLookupsAllowed

Static Private Attributes

static final Logger log = LoggerFactory.getLogger( Frontend.class )

Detailed Description

The Frontend used by the user interfaces for VolD.

This class implements the key/value logic offered by VolD: Each key stored on the volatile directory is associated with a source. When a key will be inserted from two different sources, a lookup for that key will result in the merged set of values. A Deletion or freshening of a key is associated with a certain source, thus just a part of the values will deleted or renewed.

See also:
Key

Definition at line 30 of file Frontend.java.


Constructor & Destructor Documentation

de.zib.vold.frontend.Frontend.Frontend ( )

Member Function Documentation

void de.zib.vold.frontend.Frontend.checkState ( ) [protected]

Internal method which acts as part of the guard of all public methods.

Definition at line 107 of file Frontend.java.

References de.zib.vold.frontend.Frontend.volatileDirectory.

Referenced by de.zib.vold.frontend.Frontend.delete(), de.zib.vold.frontend.Frontend.insert(), de.zib.vold.frontend.Frontend.lookup(), and de.zib.vold.frontend.Frontend.refresh().

Here is the caller graph for this function:

void de.zib.vold.frontend.Frontend.delete ( String  source,
Key  key 
)

Delete a key.

Parameters:
sourceThe source for which the key should be deleted.
keyThe key to delete.

Definition at line 205 of file Frontend.java.

References de.zib.vold.frontend.Frontend.checkState(), de.zib.vold.volatilelogic.SlicedDirectory.delete(), de.zib.vold.frontend.Frontend.log, de.zib.vold.frontend.Frontend.rwlock, and de.zib.vold.frontend.Frontend.volatileDirectory.

Referenced by de.zib.vold.userInterface.RESTController.post().

Here is the call graph for this function:

Here is the caller graph for this function:

boolean de.zib.vold.frontend.Frontend.getPrefixLookupsAllowed ( )

Are prefix lookups allowed?

Definition at line 88 of file Frontend.java.

References de.zib.vold.frontend.Frontend.prefixLookupsAllowed.

Referenced by de.zib.vold.frontend.Frontend.scopeLookup().

Here is the caller graph for this function:

boolean de.zib.vold.frontend.Frontend.getRecursiveScopeLookups ( )

Are recursive scope lookups enabled?

Definition at line 68 of file Frontend.java.

References de.zib.vold.frontend.Frontend.recursiveScopeLookups.

Referenced by de.zib.vold.frontend.Frontend.lookup().

Here is the caller graph for this function:

void de.zib.vold.frontend.Frontend.insert ( String  source,
Key  key,
Set< String >  value 
)

Insert a key.

Note:
This method is reentrant.
Parameters:
sourceThe source where the key comes from.
keyThe key to insert.
valueThe values associated with that key.

Definition at line 145 of file Frontend.java.

References de.zib.vold.common.Key._buildkey(), de.zib.vold.frontend.Frontend.checkState(), de.zib.vold.volatilelogic.SimpleDirectory.insert(), de.zib.vold.frontend.Frontend.log, de.zib.vold.frontend.Frontend.rwlock, and de.zib.vold.frontend.Frontend.volatileDirectory.

Referenced by de.zib.vold.userInterface.ABI.main(), and de.zib.vold.userInterface.RESTController.post().

Here is the call graph for this function:

Here is the caller graph for this function:

Map< Key, Set< String > > de.zib.vold.frontend.Frontend.lookup ( Key  key)

Lookup the specified key.

If recursive lookups are enabled , the key will be searched recursive to the root scope until one is found. If prefix lookups are enabled, the suffix "..." indicates a prefix lookup. Lists for search keys given by different hosts are merged.

Definition at line 238 of file Frontend.java.

References de.zib.vold.common.Key._buildkey(), de.zib.vold.frontend.Frontend.checkState(), de.zib.vold.common.Key.get_keyname(), de.zib.vold.common.Key.get_scope(), de.zib.vold.common.Key.get_type(), de.zib.vold.frontend.Frontend.getRecursiveScopeLookups(), de.zib.vold.frontend.Frontend.log, de.zib.vold.frontend.Frontend.rwlock, de.zib.vold.frontend.Frontend.scope_base(), de.zib.vold.frontend.Frontend.scopeLookup(), and de.zib.vold.common.Key.toString().

Referenced by de.zib.vold.userInterface.RESTController.get(), and de.zib.vold.userInterface.ABI.main().

Here is the call graph for this function:

Here is the caller graph for this function:

String de.zib.vold.frontend.Frontend.prepare_prefix_key ( String  key) [private]

Prepare key for (prefix-) lookup.

Removes three dots at the end if they are appended.

Definition at line 120 of file Frontend.java.

Referenced by de.zib.vold.frontend.Frontend.scopeLookup().

Here is the caller graph for this function:

void de.zib.vold.frontend.Frontend.refresh ( String  source,
Key  key 
)

Refresh a key.

Parameters:
sourceThe source for which the keys timestamp should be updated.
keyThe key to refresh.

Definition at line 175 of file Frontend.java.

References de.zib.vold.common.Key._buildkey(), de.zib.vold.frontend.Frontend.checkState(), de.zib.vold.frontend.Frontend.log, de.zib.vold.volatilelogic.SimpleDirectory.refresh(), de.zib.vold.frontend.Frontend.rwlock, and de.zib.vold.frontend.Frontend.volatileDirectory.

Referenced by de.zib.vold.userInterface.RESTController.post().

Here is the call graph for this function:

Here is the caller graph for this function:

String de.zib.vold.frontend.Frontend.scope_base ( String  scope) [private]

Get the parent of a scope.

Parameters:
scopeThe scope to get the parent for.
Returns:
The parent of the scope.

Definition at line 304 of file Frontend.java.

References de.zib.vold.frontend.Frontend.scopeDelimiter.

Referenced by de.zib.vold.frontend.Frontend.lookup().

Here is the caller graph for this function:

Map< Key, Set< String > > de.zib.vold.frontend.Frontend.scopeLookup ( Key  key) [private]

Lookup the specified key only in the given scope.

If prefix lookups are enabled, the suffix "..." indicates a prefix lookup. Lists for Keys given by different hosts are merged;

Exceptions:
VoldException

Definition at line 323 of file Frontend.java.

References de.zib.vold.common.Key._buildkey(), de.zib.vold.common.Key.buildkey(), de.zib.vold.common.Key.get_keyname(), de.zib.vold.common.Key.get_scope(), de.zib.vold.common.Key.get_type(), de.zib.vold.frontend.Frontend.getPrefixLookupsAllowed(), de.zib.vold.frontend.Frontend.log, de.zib.vold.volatilelogic.SimpleDirectory.prefixLookup(), de.zib.vold.frontend.Frontend.prepare_prefix_key(), and de.zib.vold.frontend.Frontend.volatileDirectory.

Referenced by de.zib.vold.frontend.Frontend.lookup().

Here is the call graph for this function:

Here is the caller graph for this function:

void de.zib.vold.frontend.Frontend.setPrefixLookupsAllowed ( boolean  prefixLookupsAllowed)

(Do not) allow prefix lookups.

Prefix lookups are indicated by appending three dots ("...") to the key, searched for.

Definition at line 99 of file Frontend.java.

References de.zib.vold.frontend.Frontend.prefixLookupsAllowed.

Referenced by de.zib.vold.frontend.Frontend.Frontend().

Here is the caller graph for this function:

void de.zib.vold.frontend.Frontend.setRecursiveScopeLookups ( boolean  recursiveScopeLookups)

Enable/disable recursive scope lookups.

When recursive scope lookups are enabled, a key will be searched not only in the given scope but also in each parent directory, until a result has been found.

Definition at line 80 of file Frontend.java.

References de.zib.vold.frontend.Frontend.recursiveScopeLookups.

Referenced by de.zib.vold.frontend.Frontend.Frontend().

Here is the caller graph for this function:

void de.zib.vold.frontend.Frontend.setVolatileDirectory ( VolatileDirectory  volatileDirectory)

Set the volatile directory to store the informations in.

Definition at line 60 of file Frontend.java.

References de.zib.vold.frontend.Frontend.volatileDirectory.


Member Data Documentation

final String de.zib.vold.frontend.Frontend.scopeDelimiter = "/" [package]

Definition at line 37 of file Frontend.java.

Referenced by de.zib.vold.frontend.Frontend.scope_base().


The documentation for this class was generated from the following file: