Skip to content

Commit

Permalink
DS-1746 Self review code
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhilbonte21 committed Sep 6, 2024
1 parent 900db32 commit 9b702f4
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class IndexSearchParams extends SearchParams {
* */
private boolean allowDeletedRelations;
private boolean accessControlExclusive;
private boolean requestRelationshipAttrsForSearch;
private boolean includeRelationshipAttributes;

@Override
public String getQuery() {
Expand Down Expand Up @@ -80,12 +80,12 @@ public void setRelationAttributes(Set<String> relationAttributes) {
this.relationAttributes = relationAttributes;
}

public boolean isRequestRelationshipAttrsForSearch() {
return requestRelationshipAttrsForSearch;
public boolean isIncludeRelationshipAttributes() {
return includeRelationshipAttributes;
}

public void setRequestRelationshipAttrsForSearch(boolean requestRelationshipAttrsForSearch) {
this.requestRelationshipAttrsForSearch = requestRelationshipAttrsForSearch;
public void setIncludeRelationshipAttributes(boolean includeRelationshipAttributes) {
this.includeRelationshipAttributes = includeRelationshipAttributes;
}

@Override
Expand All @@ -97,7 +97,7 @@ public String toString() {
", queryString='" + queryString + '\'' +
", allowDeletedRelations=" + allowDeletedRelations +
", accessControlExclusive=" + accessControlExclusive +
", requestRelationshipAttrsForSearch=" + requestRelationshipAttrsForSearch +
", includeRelationshipAttributes=" + includeRelationshipAttributes +
", utmTags="+ getUtmTags() +
'}';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ static class RequestMetadata {
private Set<String> utmTags;
private boolean saveSearchLog;

private String persona;

public String getSearchInput() {
return searchInput;
}
Expand All @@ -193,6 +195,14 @@ public void setUtmTags(Set<String> utmTags) {
public void setSaveSearchLog(boolean saveSearchLog) {
this.saveSearchLog = saveSearchLog;
}

public String getPersona() {
return persona;
}

public void setPersona(String persona) {
this.persona = persona;
}
}

@JsonIgnoreProperties(ignoreUnknown=true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
import org.apache.atlas.repository.userprofile.UserProfileService;
import org.apache.atlas.repository.util.AccessControlUtils;
import org.apache.atlas.searchlog.ESSearchLogger;
import org.apache.atlas.service.FeatureFlagStore;
import org.apache.atlas.stats.StatsClient;
import org.apache.atlas.type.*;
import org.apache.atlas.type.AtlasBuiltInTypes.AtlasObjectIdType;
Expand Down Expand Up @@ -976,7 +975,7 @@ public AtlasSearchResult directIndexSearch(SearchParams searchParams) throws Atl
IndexSearchParams params = (IndexSearchParams) searchParams;
RequestContext.get().setRelationAttrsForSearch(params.getRelationAttributes());
RequestContext.get().setAllowDeletedRelationsIndexsearch(params.isAllowDeletedRelations());
RequestContext.get().setRequestRelationshipAttrsForSearch(params.isRequestRelationshipAttrsForSearch());
RequestContext.get().setIncludeRelationshipAttributes(params.isIncludeRelationshipAttributes());

AtlasSearchResult ret = new AtlasSearchResult();
AtlasIndexQuery indexQuery;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1660,7 +1660,7 @@ private AtlasObjectId mapVertexToObjectId(AtlasVertex entityVertex, String edgeL
}
}

if (RequestContext.get().isRequestRelationshipAttrsForSearch()) {
if (RequestContext.get().isIncludeRelationshipAttributes()) {
String relationshipTypeName = GraphHelper.getTypeName(edge);
boolean isRelationshipAttribute = typeRegistry.getRelationshipDefByName(relationshipTypeName) != null;
if (isRelationshipAttribute) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ public void run() {
TASK_LOG.info("Task not scheduled as it was not found");
return;
}
RequestContext.get().setTraceId(task.getGuid());

TASK_LOG.info("Task guid = "+task.getGuid());
taskVertex = registry.getVertex(task.getGuid());
Expand Down
12 changes: 6 additions & 6 deletions server-api/src/main/java/org/apache/atlas/RequestContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public class RequestContext {
private boolean allowDeletedRelationsIndexsearch = false;
private boolean includeMeanings = true;
private boolean includeClassifications = true;
private boolean requestRelationshipAttrsForSearch;
private boolean includeRelationshipAttributes;

private boolean includeClassificationNames = false;
private String currentTypePatchAction = "";
Expand Down Expand Up @@ -154,7 +154,7 @@ public void clearCache() {
this.onlyCAUpdateEntities.clear();
this.onlyBAUpdateEntities.clear();
this.relationAttrsForSearch.clear();
this.requestRelationshipAttrsForSearch = false;
this.includeRelationshipAttributes = false;
this.queuedTasks.clear();
this.newElementsCreatedMap.clear();
this.removedElementsMap.clear();
Expand Down Expand Up @@ -208,12 +208,12 @@ public void setRelationAttrsForSearch(Set<String> relationAttrsForSearch) {
}
}

public boolean isRequestRelationshipAttrsForSearch() {
return requestRelationshipAttrsForSearch;
public boolean isIncludeRelationshipAttributes() {
return includeRelationshipAttributes;
}

public void setRequestRelationshipAttrsForSearch(boolean requestRelationshipAttrsForSearch) {
this.requestRelationshipAttrsForSearch = requestRelationshipAttrsForSearch;
public void setIncludeRelationshipAttributes(boolean includeRelationshipAttributes) {
this.includeRelationshipAttributes = includeRelationshipAttributes;
}

public Map<String, List<Object>> getRemovedElementsMap() {
Expand Down

0 comments on commit 9b702f4

Please sign in to comment.