Package oracle.pgx.api.subgraph
Class PgqlBasedSubgraphReader<R extends PgqlBasedSubgraphReader<R,P>,P extends PgqlBasedSubgraphReader<R,P> & PreparedPgqlQueryBuilder<P>>
- java.lang.Object
-
- oracle.pgx.api.subgraph.AbstractSubgraphReader<R>
-
- oracle.pgx.api.subgraph.PgqlBasedSubgraphReader<R,P>
-
- Type Parameters:
R- The subgraph loader type.P- The prepared query type.
- Direct Known Subclasses:
PgSqlSubgraphReader,PgViewSubgraphReader,PreparedPgSqlPgqlQuery,PreparedPgViewPgqlQuery
public abstract class PgqlBasedSubgraphReader<R extends PgqlBasedSubgraphReader<R,P>,P extends PgqlBasedSubgraphReader<R,P> & PreparedPgqlQueryBuilder<P>> extends AbstractSubgraphReader<R>
Common base class for subgraph loaders that use PGQL queries to declare a subgraph.
-
-
Constructor Summary
Constructors Constructor Description PgqlBasedSubgraphReader(PgxSession session, oracle.pgx.api.subgraph.internal.KeystoreLookup keystoreLookup, java.util.function.Function<GraphConfig,PgxFuture<PgxGraph>> readFunction, SourceType graphSourceType, java.lang.String owner, java.lang.String dbGraphName)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Rconnections(int numConnections)sets the number of connections to open to load the data in parallelRdataSourceId(java.lang.String dataSourceId)sets the dataSourceId to which to connectRjdbcUrl(java.lang.String jdbcUrl)sets the jdbcUrl to use for connecting to the DBRkeystoreAlias(java.lang.String keystoreAlias)sets the keystore alias to retrieve the password from the keystorePgxFuture<PgxGraph>loadAsync()Load the subgraph.PgxFuture<PgxGraph>loadAsync(java.lang.String graphName)Load the subgraph.Rpassword(java.lang.String password)sets the password to use for connecting to the databaseabstract PpreparedPgqlQuery(java.lang.String query)Adds a prepared query to list of queries that will be executed to load the subgraph.RqueryPgql(java.lang.String query)Adds another filtering query to the list of queries that will be executed to load the subgraph.Rusername(java.lang.String userName)sets the username of the DB user to use to connect to the DBRwithConfig(PartitionedGraphConfig config)sets the graph configuration to use for loading the subgraph.-
Methods inherited from class oracle.pgx.api.subgraph.AbstractSubgraphReader
load, load
-
-
-
-
Constructor Detail
-
PgqlBasedSubgraphReader
public PgqlBasedSubgraphReader(PgxSession session, oracle.pgx.api.subgraph.internal.KeystoreLookup keystoreLookup, java.util.function.Function<GraphConfig,PgxFuture<PgxGraph>> readFunction, SourceType graphSourceType, java.lang.String owner, java.lang.String dbGraphName)
-
-
Method Detail
-
withConfig
public R withConfig(PartitionedGraphConfig config)
sets the graph configuration to use for loading the subgraph. It has to correspond to a graph configuration for a graph that comes from a PG view.- Parameters:
config- the configuration of the graph to load- Returns:
- this loader
-
dataSourceId
public R dataSourceId(java.lang.String dataSourceId)
sets the dataSourceId to which to connect- Parameters:
dataSourceId- the datasourceId- Returns:
- this loader
-
jdbcUrl
public R jdbcUrl(java.lang.String jdbcUrl)
sets the jdbcUrl to use for connecting to the DB- Parameters:
jdbcUrl- the jdbc url- Returns:
- this loader
-
username
public R username(java.lang.String userName)
sets the username of the DB user to use to connect to the DB- Parameters:
userName- the username- Returns:
- this loader
-
keystoreAlias
public R keystoreAlias(java.lang.String keystoreAlias)
sets the keystore alias to retrieve the password from the keystore- Parameters:
keystoreAlias- the keystore alias- Returns:
- this loader
-
password
public R password(java.lang.String password)
sets the password to use for connecting to the database- Parameters:
password- the password- Returns:
- this loader
-
connections
public R connections(int numConnections)
sets the number of connections to open to load the data in parallel- Parameters:
numConnections- the number of connections- Returns:
- this loader
-
queryPgql
public R queryPgql(java.lang.String query)
Adds another filtering query to the list of queries that will be executed to load the subgraph. The query has to be starting at the first MATCH pattern (e.g. MATCH (u)-[e]->(v) WHERE ...).- Parameters:
query- the PGQL query to use for filtering- Returns:
- this loader
-
preparedPgqlQuery
public abstract P preparedPgqlQuery(java.lang.String query)
Adds a prepared query to list of queries that will be executed to load the subgraph. The query has to also start with aMATCHclause. This returns a builder which can be used to specify arguments for the prepared query. All the arguments must be provided before the reading operation is triggered.- Parameters:
query- The PGQL query.- Returns:
- A builder used for providing arguments of the prepared query.
-
loadAsync
public PgxFuture<PgxGraph> loadAsync()
Description copied from class:AbstractSubgraphReaderLoad the subgraph.- Overrides:
loadAsyncin classAbstractSubgraphReader<R extends PgqlBasedSubgraphReader<R,P>>- Returns:
- The subgraph.
-
loadAsync
public PgxFuture<PgxGraph> loadAsync(java.lang.String graphName)
Description copied from class:AbstractSubgraphReaderLoad the subgraph.- Specified by:
loadAsyncin classAbstractSubgraphReader<R extends PgqlBasedSubgraphReader<R,P>>- Parameters:
graphName- the name of the graph- Returns:
- The subgraph.
-
-