public class EngineCacheStandAlone extends Object
Engine's internal Concept ID cache
This is a cache which houses Vertex ids. It keeps these ids
so that we can lookup the vertices in need of postprocessing directly.
We cannot relay on ConceptIds because the indexed lookup maybe faulty with
vertices in need of post processing.
This stand alone version keeps everything in memory when running a single engine.
| Modifier and Type | Method and Description |
|---|---|
void |
addJobCasting(String keyspace,
String castingIndex,
ConceptId castingId) |
void |
addJobInstanceCount(String keyspace,
TypeLabel name,
long instanceCount) |
void |
addJobResource(String keyspace,
String resourceIndex,
ConceptId resourceId) |
void |
clearAllJobs(String keyspace)
Removes all jobs from the keyspace
|
void |
clearJobSetCastings(String keyspace,
String conceptIndex)
Deletes the job set only if there are no pending jobs
|
void |
clearJobSetResources(String keyspace,
String conceptIndex)
Deletes the job set only if there are no pending jobs
|
void |
deleteJobCasting(String keyspace,
String castingIndex,
ConceptId castingId) |
void |
deleteJobInstanceCount(String keyspace,
TypeLabel name) |
void |
deleteJobResource(String keyspace,
String resourceIndex,
ConceptId resourceId) |
static EngineCacheStandAlone |
getCache() |
Map<String,Set<ConceptId>> |
getCastingJobs(String keyspace) |
Map<TypeLabel,Long> |
getInstanceCountJobs(String keyspace) |
Set<String> |
getKeyspaces() |
long |
getLastTimeJobAdded() |
long |
getNumCastingJobs(String keyspace) |
long |
getNumJobs(String keyspace) |
long |
getNumResourceJobs(String keyspace) |
Map<String,Set<ConceptId>> |
getResourceJobs(String keyspace) |
public static EngineCacheStandAlone getCache()
public Set<String> getKeyspaces()
public long getLastTimeJobAdded()
public Map<String,Set<ConceptId>> getCastingJobs(String keyspace)
keyspace - The keyspace of a specific graph.public void addJobCasting(String keyspace, String castingIndex, ConceptId castingId)
keyspace - The keyspace of the conceptscastingIndex - The unique index value which should be enforced.castingId - The casting ID which needs post processingpublic void deleteJobCasting(String keyspace, String castingIndex, ConceptId castingId)
keyspace - The keyspace of the conceptscastingIndex - The unique index value which should be enforced.castingId - The casting Id which no longer needs post processing.public Map<String,Set<ConceptId>> getResourceJobs(String keyspace)
keyspace - The keyspace of a specific graph.public void addJobResource(String keyspace, String resourceIndex, ConceptId resourceId)
keyspace - The keyspace of the conceptsresourceIndex - The unique index value which should be enforced.resourceId - The resource Id which needs post processingpublic void deleteJobResource(String keyspace, String resourceIndex, ConceptId resourceId)
keyspace - The keyspace of the conceptsresourceIndex - The unique index value which should be enforced.resourceId - The resourceId which no longer needs post prcoessingpublic void clearJobSetResources(String keyspace, String conceptIndex)
ConceptCachekeyspace - The keyspace of the conceptsconceptIndex - The unique index value which has been enforced.public void clearJobSetCastings(String keyspace, String conceptIndex)
ConceptCachekeyspace - The keyspace of the conceptsconceptIndex - The unique index value has been enforced.public void clearAllJobs(String keyspace)
ConceptCachekeyspace - The keyspace to purge of all jobspublic Map<TypeLabel,Long> getInstanceCountJobs(String keyspace)
keyspace - The keyspace of a specific graph.public void addJobInstanceCount(String keyspace, TypeLabel name, long instanceCount)
keyspace - The keyspace of the conceptsname - The name of the type with new or removed instancesinstanceCount - The number of new or removed instancespublic void deleteJobInstanceCount(String keyspace, TypeLabel name)
keyspace - The keyspace of the conceptsname - The name of the type with new or removed instancespublic long getNumJobs(String keyspace)
getNumJobs in interface ConceptCachekeyspace - The keyspace of a specific graph.public long getNumCastingJobs(String keyspace)
getNumCastingJobs in interface ConceptCachekeyspace - The keyspace of a specific graph.public long getNumResourceJobs(String keyspace)
getNumResourceJobs in interface ConceptCachekeyspace - The keyspace of a specific graph.Copyright © 2017 Grakn Labs Ltd. All rights reserved.