M - T - public class SystemKeyspace<M extends GraknGraph,T extends org.apache.tinkerpop.gremlin.structure.Graph> extends Object
Manages the system keyspace.
Used to populate the system ontology the first time the system keyspace is created.
Used to populate the system keyspace with all newly create keyspaces as a user opens them. We have no way to determining whether a keyspace with a given name already exists or not. We maintain the list in our Grakn system keyspace. An element is added to that list when there is an attempt to create a graph from a factory bound to the keyspace name. The list is simply the instances of the system entity type 'keyspace'. Nothing is ever removed from that list. The set of known keyspaces is maintained in a static map so we don't connect to the system keyspace every time a factory produces a new graph. That means that we can't have several different factories (e.g. Titan and in-memory Tinkerpop) at the same time sharing keyspace names. We can't identify the factory builder by engineUrl and config because we don't know what's inside the config, which is residing remotely at the engine!
| Modifier and Type | Field and Description |
|---|---|
static String |
KEYSPACE_ENTITY |
static String |
KEYSPACE_RESOURCE |
protected org.slf4j.Logger |
LOG |
static String |
SYSTEM_GRAPH_NAME |
static String |
SYSTEM_ONTOLOGY_FILE |
| Constructor and Description |
|---|
SystemKeyspace(String engineUrl,
String config) |
| Modifier and Type | Method and Description |
|---|---|
SystemKeyspace<M,T> |
keyspaceOpened(String keyspace)
Notify that we just opened a keyspace with the same engineUrl & config.
|
void |
loadSystemOntology()
Load the system ontology into a newly created system keyspace.
|
public static final String SYSTEM_GRAPH_NAME
public static final String SYSTEM_ONTOLOGY_FILE
public static final String KEYSPACE_ENTITY
public static final String KEYSPACE_RESOURCE
protected final org.slf4j.Logger LOG
public SystemKeyspace<M,T> keyspaceOpened(String keyspace)
public void loadSystemOntology()
Copyright © 2016 Grakn Labs Ltd. All rights reserved.