mirror of
https://github.com/datahub-project/datahub.git
synced 2025-10-16 19:38:26 +00:00

- 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.
40 lines
1.1 KiB
Java
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();
|
|
}
|