public class EmbeddedGraknSession extends Object implements GraknSession
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() |
GraknConfig |
config()
The config options of this
GraknSession which were passed in at the time of construction |
static EmbeddedGraknSession |
createEngineSession(Keyspace keyspace) |
static EmbeddedGraknSession |
createEngineSession(Keyspace keyspace,
GraknConfig config) |
static EmbeddedGraknSession |
createEngineSession(Keyspace keyspace,
GraknConfig config,
TxFactoryBuilder txFactoryBuilder)
Creates a
EmbeddedGraknSession specific for internal use (within Engine),
using provided Grakn configuration |
GraknComputer |
getGraphComputer()
Get a new or existing GraknComputer.
|
static EmbeddedGraknSession |
inMemory(Keyspace keyspace) |
static EmbeddedGraknSession |
inMemory(String keyspace) |
Keyspace |
keyspace() |
EmbeddedGraknTx |
transaction(GraknTxType transactionType) |
public static EmbeddedGraknSession createEngineSession(Keyspace keyspace, GraknConfig config, TxFactoryBuilder txFactoryBuilder)
EmbeddedGraknSession specific for internal use (within Engine),
using provided Grakn configurationpublic static EmbeddedGraknSession createEngineSession(Keyspace keyspace, GraknConfig config)
public static EmbeddedGraknSession createEngineSession(Keyspace keyspace)
public static EmbeddedGraknSession inMemory(Keyspace keyspace)
public static EmbeddedGraknSession inMemory(String keyspace)
public EmbeddedGraknTx transaction(GraknTxType transactionType)
transaction in interface GraknSession@CheckReturnValue public GraknComputer getGraphComputer()
GraknComputerpublic void close()
throws GraknTxOperationException
close in interface GraknSessionclose in interface AutoCloseableGraknTxOperationExceptionpublic Keyspace keyspace()
keyspace in interface GraknSessionpublic GraknConfig config()
GraknSession which were passed in at the time of constructionGraknSessionCopyright © 2018 Grakn Labs Ltd. All rights reserved.