public class GlobalCache extends Object
Tracks Knowledge Base Specific Variables
Caches Knowledge Base or Session specific data which is shared across transactions:
| Constructor and Description |
|---|
GlobalCache(GraknConfig config) |
| Modifier and Type | Method and Description |
|---|---|
void |
cacheLabel(Label label,
LabelId id)
Caches a label so we can map type labels to type ids.
|
void |
cacheType(Label label,
SchemaConcept type)
Caches a type so that we can retrieve ontological concepts without making a DB read.
|
Map<Label,SchemaConcept> |
getCachedTypes()
A copy of the cached schema.
|
public GlobalCache(GraknConfig config)
public void cacheType(Label label, SchemaConcept type)
label - The label of the type to cachetype - The type to cachepublic void cacheLabel(Label label, LabelId id)
label - The label of the type to cacheid - The id of the type to cachepublic Map<Label,SchemaConcept> getCachedTypes()
Copyright © 2018 Grakn Labs Ltd. All rights reserved.