public class AttributeDeduplicatorDaemon extends Object
EmbeddedGraknTx.commit() is invoked, it will trigger the markForDeduplication(Keyspace, String, ConceptId)
which inserts the attribute to an internal queue for deduplication.
De-duplicating attributes in the de-duplicator daemon:
The de-duplicator daemon is an always-on background thread which performs deduplication on incoming attributes.
When a new attribute is inserted, it will immediately trigger the deduplicate operation, meaning that duplicates are merged in almost real-time speed.
The daemon is started and stopped with startDeduplicationDaemon() and stopDeduplicationDaemon()
Fault tolerance:
The de-duplicator daemon is fault-tolerant and will re-process incoming attributes if Grakn crashes in the middle of a deduplication.| Constructor and Description |
|---|
AttributeDeduplicatorDaemon(GraknConfig config,
EngineGraknTxFactory txFactory)
Instantiates
AttributeDeduplicatorDaemon |
| Modifier and Type | Method and Description |
|---|---|
void |
markForDeduplication(ai.grakn.Keyspace keyspace,
String index,
ai.grakn.concept.ConceptId conceptId)
Marks an attribute for deduplication.
|
CompletableFuture<Void> |
startDeduplicationDaemon()
Starts a daemon which performs deduplication on incoming attributes in real-time.
|
void |
stopDeduplicationDaemon()
Stops the attribute uniqueness daemon
|
public AttributeDeduplicatorDaemon(GraknConfig config, EngineGraknTxFactory txFactory)
AttributeDeduplicatorDaemonconfig - a reference to an instance of GraknConfig which is initialised from a grakn.properties.txFactory - an EngineGraknTxFactory instance which provides access to write into the databasepublic void markForDeduplication(ai.grakn.Keyspace keyspace,
String index,
ai.grakn.concept.ConceptId conceptId)
keyspace - keyspace of the attributeindex - the value of the attributeconceptId - the concept id of the attributepublic CompletableFuture<Void> startDeduplicationDaemon()
RocksDbQueue queue for incoming attributes and applies
the AttributeDeduplicator.deduplicate(EngineGraknTxFactory, KeyspaceIndexPair) algorithm.public void stopDeduplicationDaemon()
Copyright © 2018 Grakn Labs Ltd. All rights reserved.