Package org.eclipse.rdf4j.federated
Class FedX
- java.lang.Object
-
- org.eclipse.rdf4j.sail.helpers.AbstractSail
-
- org.eclipse.rdf4j.federated.FedX
-
- All Implemented Interfaces:
RepositoryResolverClient,Sail
public class FedX extends AbstractSail implements RepositoryResolverClient
FedX serves as implementation of the federation layer. It implements RDF4J's Sail interface and can thus be used as a normal repository in a RDF4J environment. The federation layer enables transparent access to the underlying members as if they were a central repository.For initialization of the federation and usage see
FederationManager.- Author:
- Andreas Schwarte
-
-
Field Summary
-
Fields inherited from class org.eclipse.rdf4j.sail.helpers.AbstractSail
connectionTimeOut, DEFAULT_CONNECTION_TIMEOUT, DEFAULT_ITERATION_SYNC_THRESHOLD, initializationLock
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddMember(Endpoint endpoint)Add a member to the federation (internal).protected SailConnectiongetConnectionInternal()Returns a store-specific SailConnection object.FilegetDataDir()Gets the Sail's data directory.List<Endpoint>getMembers()ValueFactorygetValueFactory()Gets a ValueFactory object that can be used to create IRI-, blank node-, literal- and statement objects.protected voidinitializeInternal()Do store-specific operations to initialize the store.protected voidinitializeMember(Endpoint member)booleanisWritable()Checks whether this Sail object is writable, i.e.booleanremoveMember(Endpoint endpoint)Remove a member from the federation (internal)voidsetDataDir(File dataDir)Sets the data directory for the Sail.voidsetFederationContext(FederationContext federationContext)voidsetFederationEvaluationStrategy(FederationEvaluationStrategyFactory strategyFactory)voidsetRepositoryResolver(RepositoryResolver resolver)voidsetWriteStrategyFactory(WriteStrategyFactory writeStrategyFactory)protected voidshutDownInternal()Try to shut down all federation members.-
Methods inherited from class org.eclipse.rdf4j.sail.helpers.AbstractSail
addSupportedIsolationLevel, connectionClosed, debugEnabled, getConnection, getDefaultIsolationLevel, getIterationCacheSyncThreshold, getSupportedIsolationLevels, init, isInitialized, isTrackResultSize, removeSupportedIsolationLevel, setConnectionTimeOut, setDefaultIsolationLevel, setIterationCacheSyncThreshold, setSupportedIsolationLevels, setSupportedIsolationLevels, setTrackResultSize, shutDown, toString
-
-
-
-
Method Detail
-
setFederationContext
public void setFederationContext(FederationContext federationContext)
-
setFederationEvaluationStrategy
public void setFederationEvaluationStrategy(FederationEvaluationStrategyFactory strategyFactory)
-
setWriteStrategyFactory
public void setWriteStrategyFactory(WriteStrategyFactory writeStrategyFactory)
- Parameters:
writeStrategyFactory- theWriteStrategyFactory
-
addMember
protected void addMember(Endpoint endpoint)
Add a member to the federation (internal).If the federation is already initialized, the given endpoint is explicitly initialized as well.
- Parameters:
endpoint-
-
removeMember
public boolean removeMember(Endpoint endpoint)
Remove a member from the federation (internal)- Parameters:
endpoint-- Returns:
- whether the member was removed
-
getConnectionInternal
protected SailConnection getConnectionInternal() throws SailException
Description copied from class:AbstractSailReturns a store-specific SailConnection object.- Specified by:
getConnectionInternalin classAbstractSail- Returns:
- A connection to the store.
- Throws:
SailException
-
getDataDir
public File getDataDir()
Description copied from interface:SailGets the Sail's data directory.- Specified by:
getDataDirin interfaceSail- Overrides:
getDataDirin classAbstractSail- See Also:
Sail.setDataDir(File)
-
getValueFactory
public ValueFactory getValueFactory()
Description copied from interface:SailGets a ValueFactory object that can be used to create IRI-, blank node-, literal- and statement objects.- Specified by:
getValueFactoryin interfaceSail- Returns:
- a ValueFactory object for this Sail object.
-
initializeInternal
protected void initializeInternal() throws SailExceptionDescription copied from class:AbstractSailDo store-specific operations to initialize the store. The default implementation of this method does nothing.- Overrides:
initializeInternalin classAbstractSail- Throws:
SailException
-
initializeMember
protected void initializeMember(Endpoint member) throws SailException
- Throws:
SailException
-
isWritable
public boolean isWritable() throws SailExceptionDescription copied from interface:SailChecks whether this Sail object is writable, i.e. if the data contained in this Sail object can be changed.- Specified by:
isWritablein interfaceSail- Throws:
SailException
-
setDataDir
public void setDataDir(File dataDir)
Description copied from interface:SailSets the data directory for the Sail. The Sail can use this directory for storage of data, parameters, etc. This directory must be set before the Sail isinitialized.- Specified by:
setDataDirin interfaceSail- Overrides:
setDataDirin classAbstractSail
-
shutDownInternal
protected void shutDownInternal() throws SailExceptionTry to shut down all federation members.- Specified by:
shutDownInternalin classAbstractSail- Throws:
FedXException- if not all members could be shut downSailException
-
setRepositoryResolver
public void setRepositoryResolver(RepositoryResolver resolver)
- Specified by:
setRepositoryResolverin interfaceRepositoryResolverClient
-
-