datahub/metadata-dao/src/main/java/com/linkedin/metadata/dao/BaseSearchWriterDAO.java
John Plaisted b9f11ae21b Add new style checks and fix issues.
- Upgrade to checkstyle 8
- Copy javadoc checks from Google
- Disable missing class and method checks for now, too many warnings. I'll have to figure out how to suppress them instead.
- Fix other issues, which are mostly missing periods at the end of sentences and lack of paragraph tags.
2020-09-11 09:15:56 -07:00

40 lines
1.1 KiB
Java

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.
*/
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();
}