Skip to content

Commit

Permalink
Cleaned up comments and added descriptions for functions
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkoh94 committed Nov 7, 2023
1 parent 64fea48 commit 19b80dc
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ public interface EntitySearchService {
*/
void upsertDocument(@Nonnull String entityName, @Nonnull String document, @Nonnull String docId);

/**
*
* @param document the document to update into update index
* @param docId the ID of the document
*/
void createUpdateDocument(@Nonnull String document, @Nonnull String docId);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public void upsertDocument(@Nonnull String entityName, @Nonnull String document,
esWriteDAO.upsertDocument(entityName, document, docId);
}

@Override
public void createUpdateDocument(@Nonnull String document, @Nonnull String docId) {
log.debug(String.format("Creating Update document document: %s, docId %s", document, docId));
esWriteDAO.createUpdateDocument(document, docId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ public void upsertDocument(@Nonnull String entityName, @Nonnull String document,
bulkProcessor.add(updateRequest);
}

/**
* Creates a request to insert new document into datahub_update_event index
*
* @param document the document to insert
* @param docId the ID of the document
*/
public void createUpdateDocument(@Nonnull String document, @Nonnull String docId) {
final String indexName = indexConvention.getIndexName("datahub_update_event");
final IndexRequest indexRequest = new IndexRequest(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ public Optional<String> transformAspect(
return Optional.of(searchDocument.toString());
}

//TODO: Transform event into a JSON-like string to upsert into search
public String transformEvent(MetadataChangeLog event) {
final ObjectNode searchDocument = JsonNodeFactory.instance.objectNode();
searchDocument.put("urn", event.getEntityUrn().toString());
Expand Down

0 comments on commit 19b80dc

Please sign in to comment.