Skip to content

Commit

Permalink
Add log lines
Browse files Browse the repository at this point in the history
  • Loading branch information
ektavarma10 committed Nov 29, 2023
1 parent e0bc2b3 commit e855ebf
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import org.apache.atlas.plugin.service.RangerBasePlugin;
import org.apache.atlas.plugin.util.RangerPerfTracer;

import java.awt.*;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
Expand Down Expand Up @@ -660,6 +661,8 @@ private boolean isAccessAllowed(AtlasEntityAccessRequest request, RangerAtlasAud
if (LOG.isDebugEnabled()) {
LOG.debug("==> isAccessAllowed(" + request + ")");
}
long startTime = System.currentTimeMillis();
LOG.info("start isAccessAllowed : " + startTime);
boolean ret = false;

try {
Expand All @@ -672,6 +675,7 @@ private boolean isAccessAllowed(AtlasEntityAccessRequest request, RangerAtlasAud
List<CompletableFuture<Boolean>> completableFutures = new ArrayList<>();

// check authorization for each classification
LOG.info("start check authrization for each classification: " + (System.currentTimeMillis() - startTime));
for (AtlasClassification classificationToAuthorize : request.getEntityClassifications()) {

RangerAccessRequestImpl rangerRequest = createRangerAccessRequest(request, classificationToAuthorize, rangerTagForEval);
Expand All @@ -681,6 +685,8 @@ private boolean isAccessAllowed(AtlasEntityAccessRequest request, RangerAtlasAud

// wait for all threads to complete their execution
CompletableFuture.allOf(completableFutures.toArray(new CompletableFuture[0])).join();
LOG.info("end check authorization for each classification: " + (System.currentTimeMillis() - startTime));


// if all checkAccess calls return true, then ret is true, else it is false
ret = completableFutures
Expand Down Expand Up @@ -917,11 +923,13 @@ private void checkAccessAndScrub(AtlasEntityHeader entity, AtlasSearchResultScru
entityAccessRequest.setClientIPAddress(request.getClientIPAddress());
entityAccessRequest.setForwardedAddresses(request.getForwardedAddresses());
entityAccessRequest.setRemoteIPAddress(request.getRemoteIPAddress());

long startTime = System.currentTimeMillis();
boolean isEntityAccessAllowed = isScrubAuditEnabled ? isAccessAllowed(entityAccessRequest) : isAccessAllowed(entityAccessRequest, null);
LOG.info("isEntityAccessAllowed: " + (System.currentTimeMillis() - startTime));
if (!isEntityAccessAllowed) {
scrubEntityHeader(entity, request.getTypeRegistry());
}
LOG.info("scrubEntityHeader completed" + (System.currentTimeMillis() - startTime));
}
}

Expand Down

0 comments on commit e855ebf

Please sign in to comment.