com.bigdata.relation.locator
Interface IResourceLocator<T extends ILocatableResource>

Type Parameters:
T - The generic [T]ype of the resource.
All Known Implementing Classes:
DefaultResourceLocator

public interface IResourceLocator<T extends ILocatableResource>

An object that knows how to resolve a resource identifier (aka namespace) to an ILocatableResource instance. "Locating" a relation means (a) resolving the namespace for the resource to the resource declaration as of some timestamp; and (b) materializing (often from cache) an ILocatableResource for that resource. Locatable resources are essentially containers for indices, including an IRelation and an IDatabase, which is essentially a container for IRelations.

Note: a locator does not proxy for a resource. Either the resource is locally accessible, including the case of a resource distributed across a federation, or it is not since the resource is accessible using the IBigdataFederation's API. However, you CAN NOT "locate" a local resource on another JVM or machine using this interface.

Version:
$Id: IResourceLocator.java 6041 2012-02-20 20:46:45Z thompsonbry $
Author:
Bryan Thompson

Method Summary
 void discard(ILocatableResource<T> instance)
          Resources that hold hard references to local index objects MUST be discarded during abort processing.
 T locate(String namespace, long timestamp)
          Locate.
 

Method Detail

locate

T locate(String namespace,
         long timestamp)
Locate.

Parameters:
namespace - The resource namespace.
timestamp - The timestamp for the view.
Returns:
A view of the resource iff it exists (specifically, if the declaration for the resource can be resolved) -or- null if the resource declaration could not be resolved.

discard

void discard(ILocatableResource<T> instance)
Resources that hold hard references to local index objects MUST be discarded during abort processing. Otherwise the same resource objects will be returned from the cache and buffered writes on the indices for those relations (if they are local index objects) will still be visible, thus defeating the abort semantics.



Copyright © 2006-2012 SYSTAP, LLC. All Rights Reserved.