Skip to content

Commit

Permalink
Revert "PLT-2782 | Janus optimisation"
Browse files Browse the repository at this point in the history
  • Loading branch information
aarshi0301 authored Dec 2, 2024
1 parent f6321f0 commit 3feca05
Show file tree
Hide file tree
Showing 7 changed files with 180 additions and 181 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,6 @@ private void setPolicyItems(RangerPolicy rangerPolicy, AtlasEntityHeader atlasPo

List<String> users = (List<String>) atlasPolicy.getAttribute("policyUsers");
List<String> groups = (List<String>) atlasPolicy.getAttribute("policyGroups");

List<String> roles = (List<String>) atlasPolicy.getAttribute("policyRoles");

List<RangerPolicyItemAccess> accesses = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,24 +50,6 @@ public void recordMetric(MetricRecorder recorder) {
}
}

public void recordMetricWithInvocations(MetricRecorder recorder, long count) {
if (recorder != null) {
final String name = recorder.name;
final long timeTaken = recorder.getElapsedTime();

Metric metric = metrics.get(name);

if (metric == null) {
metric = new Metric(name);

metrics.put(name, metric);
}

metric.invocations += count;
metric.totalTimeMSecs += timeTaken;
}
}

public void clear() {
metrics.clear();
}
Expand Down Expand Up @@ -147,6 +129,7 @@ public String getName() {
public long getInvocations() {
return invocations;
}

public void setTotalTimeMSecs(long totalTimeMSecs) {
this.totalTimeMSecs = totalTimeMSecs;
}
Expand Down
4 changes: 1 addition & 3 deletions intg/src/main/java/org/apache/atlas/AtlasConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,7 @@ public enum AtlasConfiguration {
ATLAS_INDEXSEARCH_QUERY_SIZE_MAX_LIMIT("atlas.indexsearch.query.size.max.limit", 100000),
ATLAS_INDEXSEARCH_LIMIT_UTM_TAGS("atlas.indexsearch.limit.ignore.utm.tags", ""),
ATLAS_INDEXSEARCH_ENABLE_API_LIMIT("atlas.indexsearch.enable.api.limit", false),
ATLAS_INDEXSEARCH_ENABLE_JANUS_OPTIMISATION("atlas.indexsearch.enable.janus.optimization", false),
ATLAS_INDEXSEARCH_ENABLE_FETCHING_NON_PRIMITIVE_ATTRIBUTES("atlas.indexsearch.enable.fetching.non.primitive.attributes", false),
ATLAS_INDEXSEARCH_ATTRIBUTES_MIN_LIMIT("atlas.indexsearch.attributes.min.limit", 8),

ATLAS_MAINTENANCE_MODE("atlas.maintenance.mode", false),

ATLAS_UD_RELATIONSHIPS_MAX_COUNT("atlas.ud.relationship.max.count", 100);
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,6 @@ public final class AccessControlUtils {
public static final String ATTR_PERSONA_USERS = "personaUsers";
public static final String ATTR_PERSONA_GROUPS = "personaGroups";

public static final String ATTR_SERVICE_SERVICE_TYPE = "authServiceType";
public static final String ATTR_SERVICE_TAG_SERVICE = "tagService";
public static final String ATTR_SERVICE_IS_ENABLED = "authServiceIsEnabled";
public static final String ATTR_SERVICE_LAST_SYNC = "authServicePolicyLastSync";

public static final String ATTR_PURPOSE_CLASSIFICATIONS = "purposeClassifications";

public static final String ATTR_POLICY_TYPE = "policyType";
Expand Down
7 changes: 0 additions & 7 deletions server-api/src/main/java/org/apache/atlas/RequestContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -657,13 +657,6 @@ public void endMetricRecord(MetricRecorder recorder) {
}
}

public void endMetricRecordWithInvocations(MetricRecorder recorder, long invocationCount) {
if (metrics != null && recorder != null) {
metrics.recordMetricWithInvocations(recorder, invocationCount);
}
}


public void recordEntityGuidUpdate(AtlasEntity entity, String guidInRequest) {
recordEntityGuidUpdate(new EntityGuidPair(entity, guidInRequest));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,6 @@ public AtlasSearchResult indexSearch(@Context HttpServletRequest servletRequest,
perf = AtlasPerfTracer.getPerfTracer(PERF_LOG, "DiscoveryREST.indexSearch(" + parameters + ")");
}

RequestContext.get().endMetricRecordWithInvocations(RequestContext.get().startMetricRecord("dslSize"), parameters.getQuerySize());
RequestContext.get().endMetricRecordWithInvocations(RequestContext.get().startMetricRecord("attributeSize"), parameters.getAttributes().size());
if (AtlasConfiguration.ATLAS_INDEXSEARCH_ENABLE_API_LIMIT.getBoolean() && parameters.getQuerySize() > AtlasConfiguration.ATLAS_INDEXSEARCH_QUERY_SIZE_MAX_LIMIT.getLong()) {
if(CollectionUtils.isEmpty(parameters.getUtmTags())) {
throw new AtlasBaseException(AtlasErrorCode.INVALID_DSL_QUERY_SIZE, String.valueOf(AtlasConfiguration.ATLAS_INDEXSEARCH_QUERY_SIZE_MAX_LIMIT.getLong()));
Expand Down

0 comments on commit 3feca05

Please sign in to comment.