datahub/metadata-dao/src/main/java/com/linkedin/metadata/dao/BaseSearchWriterDAO.java

40 lines
1.1 KiB
Java
Raw Normal View History

Update metadata-models to head! (#1811) metadata-models 80.0.0 -> 90.0.13: 90.0.13: Roll forward: Fix the open source build by avoiding URN method that isn't part of the open source URN. 90.0.2: Refactor listUrnsFromIndex method 90.0.0: Start distinguishing between [] aspects vs null aspects input param 89.0.4: Fix the open source build by avoiding URN method that isn't part of the open source URN. 89.0.2: fix some test case name 89.0.0: META-12686: Made the MXE_v5 topics become strictly ACL'ed to avoid the wildcard write ACL as "MetadataXEvent.+" 88.0.6: change DAO to take Storage Config as input 88.0.3: Add a comment on lack of avro generation for MXEv5 + add MXEv5 to the pegasus validation task. 87.0.15: META-12651: Integrate the metadata-models-ext with metadata-models 87.0.13: add StorageConfig to Local DAO 87.0.3: Treat empty aspect vs optional aspect same until all clients are migrated 87.0.2: Treat empty aspect vs optional aspect differently 87.0.1: META-12533: Skip processing unregistered aspect specific MAE. 83.0.6: action method to return list of urns from strong consistent index 83.0.4: Change input param type for batch backfill 83.0.3: Implement batch backfill 83.0.1: Implement support for OR filter in browse query 82.0.10: Throw UnsupportedOperationException for unsupported condition types in search filter 82.0.6: Implement local secondary backfilling index as part of backfill method 82.0.5: [strongly consistent index] implement getUrns method 82.0.4: Add indexing urn fields to the local secondary index 82.0.0: Render Delta fiels in the MCE_v5. 81.0.1: Add pegasus to avro conversion for FMCE 80.0.4: add get all support for BaseSingleAspectEntitySimpleKeyResource 80.0.2: Add a BaseSearchWriterDAO with an ESBulkWriterDAO implementation. 80.0.1: META-12254: Produce aspect specific MAE with always emit option 80.0.0: Convert getNodesInTraversedPath to getSubgraph to return complete view of the subgraph (nodes+edges)
2020-08-19 16:06:29 -07:00
package com.linkedin.metadata.dao;
import com.linkedin.data.template.RecordTemplate;
import com.linkedin.metadata.validator.DocumentValidator;
import javax.annotation.Nonnull;
/**
* A base class for all Search Writer DAOs.
*
* <p>Search Writer DAO is a standardized interface to update a search index.
Update metadata-models to head! (#1811) metadata-models 80.0.0 -> 90.0.13: 90.0.13: Roll forward: Fix the open source build by avoiding URN method that isn't part of the open source URN. 90.0.2: Refactor listUrnsFromIndex method 90.0.0: Start distinguishing between [] aspects vs null aspects input param 89.0.4: Fix the open source build by avoiding URN method that isn't part of the open source URN. 89.0.2: fix some test case name 89.0.0: META-12686: Made the MXE_v5 topics become strictly ACL'ed to avoid the wildcard write ACL as "MetadataXEvent.+" 88.0.6: change DAO to take Storage Config as input 88.0.3: Add a comment on lack of avro generation for MXEv5 + add MXEv5 to the pegasus validation task. 87.0.15: META-12651: Integrate the metadata-models-ext with metadata-models 87.0.13: add StorageConfig to Local DAO 87.0.3: Treat empty aspect vs optional aspect same until all clients are migrated 87.0.2: Treat empty aspect vs optional aspect differently 87.0.1: META-12533: Skip processing unregistered aspect specific MAE. 83.0.6: action method to return list of urns from strong consistent index 83.0.4: Change input param type for batch backfill 83.0.3: Implement batch backfill 83.0.1: Implement support for OR filter in browse query 82.0.10: Throw UnsupportedOperationException for unsupported condition types in search filter 82.0.6: Implement local secondary backfilling index as part of backfill method 82.0.5: [strongly consistent index] implement getUrns method 82.0.4: Add indexing urn fields to the local secondary index 82.0.0: Render Delta fiels in the MCE_v5. 81.0.1: Add pegasus to avro conversion for FMCE 80.0.4: add get all support for BaseSingleAspectEntitySimpleKeyResource 80.0.2: Add a BaseSearchWriterDAO with an ESBulkWriterDAO implementation. 80.0.1: META-12254: Produce aspect specific MAE with always emit option 80.0.0: Convert getNodesInTraversedPath to getSubgraph to return complete view of the subgraph (nodes+edges)
2020-08-19 16:06:29 -07:00
*/
public abstract class BaseSearchWriterDAO<DOCUMENT extends RecordTemplate> {
protected final Class<DOCUMENT> _documentClass;
public BaseSearchWriterDAO(@Nonnull Class<DOCUMENT> documentClass) {
DocumentValidator.validateDocumentSchema(documentClass);
_documentClass = documentClass;
}
/**
* Updates or inserts the given search document.
*
* @param document the document to update / insert
* @param docId the ID of the document
*/
public abstract void upsertDocument(@Nonnull DOCUMENT document, @Nonnull String docId);
/**
* Deletes the document with the given document ID from the index.
*/
public abstract void deleteDocument(@Nonnull String docId);
/**
* Closes this writer, releasing any associated resources.
*/
public abstract void close();
}