Skip to content

Commit

Permalink
ATLAS-4971: falcon-bridge, falcon-bridge-shim modules: update for cod… (
Browse files Browse the repository at this point in the history
#296)

(cherry picked from commit 0901f6d)
  • Loading branch information
sheetalshah1007 authored and mneethiraj committed Feb 20, 2025
1 parent 8a6e915 commit c423f29
Show file tree
Hide file tree
Showing 19 changed files with 592 additions and 614 deletions.
4 changes: 4 additions & 0 deletions addons/falcon-bridge-shim/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
<name>Apache Atlas Falcon Bridge Shim</name>
<description>Apache Atlas Falcon Bridge Shim Module</description>

<properties>
<checkstyle.failOnViolation>true</checkstyle.failOnViolation>
<checkstyle.skip>false</checkstyle.skip>
</properties>
<dependencies>
<!-- Logging -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand All @@ -18,7 +18,6 @@

package org.apache.atlas.falcon.service;


import org.apache.atlas.plugin.classloader.AtlasPluginClassLoader;
import org.apache.falcon.FalconException;
import org.apache.falcon.entity.store.ConfigurationStore;
Expand All @@ -34,22 +33,20 @@
public class AtlasService implements FalconService, ConfigurationChangeListener {
private static final Logger LOG = LoggerFactory.getLogger(AtlasService.class);

private static final String ATLAS_PLUGIN_TYPE = "falcon";
private static final String ATLAS_PLUGIN_TYPE = "falcon";
private static final String ATLAS_FALCON_HOOK_IMPL_CLASSNAME = "org.apache.atlas.falcon.service.AtlasService";

private AtlasPluginClassLoader atlasPluginClassLoader = null;
private FalconService falconServiceImpl = null;
private ConfigurationChangeListener configChangeListenerImpl = null;
private AtlasPluginClassLoader atlasPluginClassLoader;
private FalconService falconServiceImpl;
private ConfigurationChangeListener configChangeListenerImpl;

public AtlasService() {
this.initialize();
}

@Override
public String getName() {
if (LOG.isDebugEnabled()) {
LOG.debug("==> AtlasService.getName()");
}
LOG.debug("==> AtlasService.getName()");

String ret = null;

Expand All @@ -60,18 +57,14 @@ public String getName() {
deactivatePluginClassLoader();
}

if (LOG.isDebugEnabled()) {
LOG.debug("<== AtlasService.getName()");
}
LOG.debug("<== AtlasService.getName()");

return ret;
}

@Override
public void init() throws FalconException {
if (LOG.isDebugEnabled()) {
LOG.debug("==> AtlasService.init()");
}
LOG.debug("==> AtlasService.init()");

try {
activatePluginClassLoader();
Expand All @@ -83,16 +76,12 @@ public void init() throws FalconException {
deactivatePluginClassLoader();
}

if (LOG.isDebugEnabled()) {
LOG.debug("<== AtlasService.init()");
}
LOG.debug("<== AtlasService.init()");
}

@Override
public void destroy() throws FalconException {
if (LOG.isDebugEnabled()) {
LOG.debug("==> AtlasService.destroy()");
}
LOG.debug("==> AtlasService.destroy()");

try {
activatePluginClassLoader();
Expand All @@ -104,16 +93,12 @@ public void destroy() throws FalconException {
deactivatePluginClassLoader();
}

if (LOG.isDebugEnabled()) {
LOG.debug("<== AtlasService.destroy()");
}
LOG.debug("<== AtlasService.destroy()");
}

@Override
public void onAdd(Entity entity) throws FalconException {
if (LOG.isDebugEnabled()) {
LOG.debug("==> AtlasService.onAdd({})", entity);
}
LOG.debug("==> AtlasService.onAdd({})", entity);

try {
activatePluginClassLoader();
Expand All @@ -122,16 +107,12 @@ public void onAdd(Entity entity) throws FalconException {
deactivatePluginClassLoader();
}

if (LOG.isDebugEnabled()) {
LOG.debug("<== AtlasService.onAdd({})", entity);
}
LOG.debug("<== AtlasService.onAdd({})", entity);
}

@Override
public void onRemove(Entity entity) throws FalconException {
if (LOG.isDebugEnabled()) {
LOG.debug("==> AtlasService.onRemove({})", entity);
}
LOG.debug("==> AtlasService.onRemove({})", entity);

try {
activatePluginClassLoader();
Expand All @@ -140,16 +121,12 @@ public void onRemove(Entity entity) throws FalconException {
deactivatePluginClassLoader();
}

if (LOG.isDebugEnabled()) {
LOG.debug("<== AtlasService.onRemove({})", entity);
}
LOG.debug("<== AtlasService.onRemove({})", entity);
}

@Override
public void onChange(Entity entity, Entity entity1) throws FalconException {
if (LOG.isDebugEnabled()) {
LOG.debug("==> AtlasService.onChange({}, {})", entity, entity1);
}
LOG.debug("==> AtlasService.onChange({}, {})", entity, entity1);

try {
activatePluginClassLoader();
Expand All @@ -158,16 +135,12 @@ public void onChange(Entity entity, Entity entity1) throws FalconException {
deactivatePluginClassLoader();
}

if (LOG.isDebugEnabled()) {
LOG.debug("<== AtlasService.onChange({}, {})", entity, entity1);
}
LOG.debug("<== AtlasService.onChange({}, {})", entity, entity1);
}

@Override
public void onReload(Entity entity) throws FalconException {
if (LOG.isDebugEnabled()) {
LOG.debug("==> AtlasService.onReload({})", entity);
}
LOG.debug("==> AtlasService.onReload({})", entity);

try {
activatePluginClassLoader();
Expand All @@ -176,15 +149,11 @@ public void onReload(Entity entity) throws FalconException {
deactivatePluginClassLoader();
}

if (LOG.isDebugEnabled()) {
LOG.debug("<== AtlasService.onReload({})", entity);
}
LOG.debug("<== AtlasService.onReload({})", entity);
}

private void initialize() {
if (LOG.isDebugEnabled()) {
LOG.debug("==> AtlasService.initialize()");
}
LOG.debug("==> AtlasService.initialize()");

try {
atlasPluginClassLoader = AtlasPluginClassLoader.getInstance(ATLAS_PLUGIN_TYPE, this.getClass());
Expand All @@ -195,17 +164,15 @@ private void initialize() {

Object atlasService = cls.newInstance();

falconServiceImpl = (FalconService) atlasService;
falconServiceImpl = (FalconService) atlasService;
configChangeListenerImpl = (ConfigurationChangeListener) atlasService;
} catch (Exception excp) {
LOG.error("Error instantiating Atlas hook implementation", excp);
} finally {
deactivatePluginClassLoader();
}

if (LOG.isDebugEnabled()) {
LOG.debug("<== AtlasService.initialize()");
}
LOG.debug("<== AtlasService.initialize()");
}

private void activatePluginClassLoader() {
Expand Down
5 changes: 5 additions & 0 deletions addons/falcon-bridge/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@
<name>Apache Atlas Falcon Bridge</name>
<description>Apache Atlas Falcon Bridge Module</description>

<properties>
<checkstyle.failOnViolation>true</checkstyle.failOnViolation>
<checkstyle.skip>false</checkstyle.skip>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.atlas</groupId>
Expand Down
Loading

0 comments on commit c423f29

Please sign in to comment.