Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Altas Downtime Alert #2830

Merged
merged 8 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/chart-release-dispatcher.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ jobs:
"name": "${{ github.repository }}",
"branch": "${{ steps.extract_branch.outputs.branch }}"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public ServicePolicies getPolicies(String serviceName, String pluginId, Long las
servicePolicies.setPolicyUpdateTime(new Date());

if (service != null) {
List<RangerPolicy> allPolicies = getServicePolicies(service);
List<RangerPolicy> allPolicies = getServicePolicies(service, 250);
servicePolicies.setServiceName(serviceName);
servicePolicies.setServiceId(service.getGuid());

Expand All @@ -162,7 +162,7 @@ public ServicePolicies getPolicies(String serviceName, String pluginId, Long las
AtlasEntityHeader tagService = getServiceEntity(tagServiceName);

if (tagService != null) {
allPolicies.addAll(getServicePolicies(tagService));
allPolicies.addAll(getServicePolicies(tagService, 0));

TagPolicies tagPolicies = new TagPolicies();

Expand Down Expand Up @@ -200,13 +200,13 @@ public ServicePolicies getPolicies(String serviceName, String pluginId, Long las
return servicePolicies;
}

private List<RangerPolicy> getServicePolicies(AtlasEntityHeader service) throws AtlasBaseException, IOException {
private List<RangerPolicy> getServicePolicies(AtlasEntityHeader service, int batchSize) throws AtlasBaseException, IOException {

List<RangerPolicy> servicePolicies = new ArrayList<>();

String serviceName = (String) service.getAttribute("name");
String serviceType = (String) service.getAttribute("authServiceType");
List<AtlasEntityHeader> atlasPolicies = getAtlasPolicies(serviceName);
List<AtlasEntityHeader> atlasPolicies = getAtlasPolicies(serviceName, batchSize);

if (CollectionUtils.isNotEmpty(atlasPolicies)) {
//transform policies
Expand Down Expand Up @@ -417,7 +417,7 @@ private List<RangerValiditySchedule> getPolicyValiditySchedule(AtlasEntityHeader
return ret;
}

private List<AtlasEntityHeader> getAtlasPolicies(String serviceName) throws AtlasBaseException {
private List<AtlasEntityHeader> getAtlasPolicies(String serviceName, int batchSize) throws AtlasBaseException {
AtlasPerfMetrics.MetricRecorder recorder = RequestContext.get().startMetricRecord("CachePolicyTransformerImpl."+service+".getAtlasPolicies");

List<AtlasEntityHeader> ret = new ArrayList<>();
Expand Down Expand Up @@ -460,6 +460,10 @@ private List<AtlasEntityHeader> getAtlasPolicies(String serviceName) throws Atla

int from = 0;
int size = 100;

if (batchSize > 0) {
size = batchSize;
}
boolean found = true;

do {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,10 @@ public synchronized void init(Properties props, String appType) {
List<AuditHandler> providers = new ArrayList<AuditHandler>();

for (Object propNameObj : props.keySet()) {
LOG.info("AUDIT PROPERTY: " + propNameObj.toString() + "="
+ props.getProperty(propNameObj.toString()));
if (LOG.isDebugEnabled()){
LOG.debug("AUDIT PROPERTY: " + propNameObj.toString() + "="
+ props.getProperty(propNameObj.toString()));
}
}

// Process new audit configurations
Expand Down
4 changes: 3 additions & 1 deletion common/src/main/java/org/apache/atlas/service/Services.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.apache.atlas.service;

import org.apache.atlas.annotation.AtlasService;
import org.apache.atlas.type.AtlasType;
import org.apache.commons.configuration.Configuration;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
Expand All @@ -27,6 +28,7 @@
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.inject.Inject;

import java.util.List;

import static org.apache.atlas.AtlasConstants.ATLAS_MIGRATION_MODE_FILENAME;
Expand Down Expand Up @@ -65,8 +67,8 @@ public void start() {
continue;
}

LOG.info("Starting service {}", svc.getClass().getName());

LOG.info("Starting service {}", svc.getClass().getName());
svc.start();
}
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ public class GraphTransactionAdvisor extends AbstractPointcutAdvisor {
public boolean matches(Method method, Class<?> targetClass) {
boolean annotationPresent = method.isAnnotationPresent(GraphTransaction.class);
if (annotationPresent) {
LOG.info("GraphTransaction intercept for {}.{}", targetClass.getName(), method.getName());
if (LOG.isDebugEnabled()) {
LOG.debug("GraphTransaction intercept for {}.{}", targetClass.getName(), method.getName());
}
}
return annotationPresent;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,9 @@ private void resolveIndexFieldName(AtlasGraphManagement managementSystem, AtlasA

typeRegistry.addIndexFieldName(attribute.getVertexPropertyName(), indexFieldName);

LOG.info("Property {} is mapped to index field name {}", attribute.getQualifiedName(), attribute.getIndexFieldName());
if (LOG.isDebugEnabled()){
LOG.debug("Property {} is mapped to index field name {}", attribute.getQualifiedName(), attribute.getIndexFieldName());
}
} else {
LOG.warn("resolveIndexFieldName(attribute={}): propertyKey is null for vertextPropertyName={}", attribute.getQualifiedName(), attribute.getVertexPropertyName());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ public class DTORegistry {
@Inject
public DTORegistry(Set<DataTransferObject> availableDTOs) {
for (DataTransferObject availableDTO : availableDTOs) {
LOG.info("Registering DTO: {}", availableDTO.getClass().getSimpleName());
if (LOG.isDebugEnabled()){
LOG.debug("Registering DTO: {}", availableDTO.getClass().getSimpleName());
}
registerDTO(availableDTO);
}
}
Expand Down
Loading