public class EmbeddedGraknSession extends Object implements GraknSession
Builds a TxFactory
This class facilitates the construction of GraknTx by determining which factory should be built.
It does this by either defaulting to an in memory tx GraknTxTinker or by
retrieving the factory definition from engine.
The deployment of engine decides on the backend and this class will handle producing the correct graphs.
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
CommitLogHandler |
commitLogHandler() |
GraknConfig |
config()
The config options of this
GraknSession which were passed in at the time of construction |
static EmbeddedGraknSession |
create(Keyspace keyspace,
String engineUri)
This methods creates a
EmbeddedGraknSession object for the remote API. |
static EmbeddedGraknSession |
createEngineSession(Keyspace keyspace,
String engineUri,
GraknConfig config,
TxFactoryBuilder txFactoryBuilder)
Creates a
EmbeddedGraknSession specific for internal use (within Engine),
using provided Grakn configuration and disabling the remote (via REST) submission of commit log. |
GraknComputer |
getGraphComputer()
Get a new or existing GraknComputer.
|
Keyspace |
keyspace() |
EmbeddedGraknTx |
open(GraknTxType transactionType) |
protected void |
submitLogs() |
String |
uri() |
public CommitLogHandler commitLogHandler()
public static EmbeddedGraknSession create(Keyspace keyspace, String engineUri)
EmbeddedGraknSession object for the remote API.
A user should not call this method directly.
See Grakn.session(String, String) for creating a GraknSession for the remote APIpublic static EmbeddedGraknSession createEngineSession(Keyspace keyspace, String engineUri, GraknConfig config, TxFactoryBuilder txFactoryBuilder)
EmbeddedGraknSession specific for internal use (within Engine),
using provided Grakn configuration and disabling the remote (via REST) submission of commit log.public EmbeddedGraknTx open(GraknTxType transactionType)
open in interface GraknSession@CheckReturnValue public GraknComputer getGraphComputer()
GraknComputerpublic void close()
throws GraknTxOperationException
close in interface GraknSessionclose in interface AutoCloseableGraknTxOperationExceptionpublic String uri()
uri in interface GraknSessionpublic Keyspace keyspace()
keyspace in interface GraknSessionpublic GraknConfig config()
GraknSession which were passed in at the time of constructionGraknSessionprotected void submitLogs()
Copyright © 2018 Grakn Labs Ltd. All rights reserved.