Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
8044ca48
Commit
8044ca48
authored
8 years ago
by
Madhan Neethiraj
Committed by
Suma Shivaprasad
8 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-1162: shutdown hooks to register with ShutdownHookManager, instead of System.Runtime
parent
96f2306f
master
No related merge requests found
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
9 deletions
+27
-9
FalconHook.java
...rc/main/java/org/apache/atlas/falcon/hook/FalconHook.java
+8
-2
HiveHook.java
...ge/src/main/java/org/apache/atlas/hive/hook/HiveHook.java
+7
-2
AtlasConstants.java
common/src/main/java/org/apache/atlas/AtlasConstants.java
+1
-0
AtlasHook.java
...cation/src/main/java/org/apache/atlas/hook/AtlasHook.java
+2
-2
release-log.txt
release-log.txt
+1
-0
Atlas.java
webapp/src/main/java/org/apache/atlas/Atlas.java
+8
-3
No files found.
addons/falcon-bridge/src/main/java/org/apache/atlas/falcon/hook/FalconHook.java
View file @
8044ca48
...
...
@@ -21,6 +21,7 @@ package org.apache.atlas.falcon.hook;
import
com.google.common.util.concurrent.ThreadFactoryBuilder
;
import
com.google.inject.Guice
;
import
com.google.inject.Injector
;
import
org.apache.atlas.AtlasConstants
;
import
org.apache.atlas.falcon.bridge.FalconBridge
;
import
org.apache.atlas.falcon.event.FalconEvent
;
import
org.apache.atlas.falcon.publisher.FalconEventPublisher
;
...
...
@@ -32,6 +33,7 @@ import org.apache.atlas.typesystem.Referenceable;
import
org.apache.falcon.entity.store.ConfigurationStore
;
import
org.apache.falcon.entity.v0.feed.Feed
;
import
org.apache.falcon.entity.v0.process.Process
;
import
org.apache.hadoop.util.ShutdownHookManager
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -90,19 +92,23 @@ public class FalconHook extends AtlasHook implements FalconEventPublisher {
new
LinkedBlockingQueue
<
Runnable
>(
queueSize
),
new
ThreadFactoryBuilder
().
setNameFormat
(
"Atlas Logger %d"
).
build
());
Runtime
.
getRuntime
().
addShutdownHook
(
new
Thread
()
{
ShutdownHookManager
.
get
().
addShutdownHook
(
new
Thread
()
{
@Override
public
void
run
()
{
try
{
LOG
.
info
(
"==> Shutdown of Atlas Falcon Hook"
);
executor
.
shutdown
();
executor
.
awaitTermination
(
WAIT_TIME
,
TimeUnit
.
SECONDS
);
executor
=
null
;
}
catch
(
InterruptedException
ie
)
{
LOG
.
info
(
"Interrupt received in shutdown."
);
}
finally
{
LOG
.
info
(
"<== Shutdown of Atlas Falcon Hook"
);
}
// shutdown client
}
});
}
,
AtlasConstants
.
ATLAS_SHUTDOWN_HOOK_PRIORITY
);
STORE
=
ConfigurationStore
.
get
();
...
...
This diff is collapsed.
Click to expand it.
addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/HiveHook.java
View file @
8044ca48
...
...
@@ -50,6 +50,7 @@ import org.apache.hadoop.hive.ql.metadata.Partition;
import
org.apache.hadoop.hive.ql.metadata.Table
;
import
org.apache.hadoop.hive.ql.plan.HiveOperation
;
import
org.apache.hadoop.security.UserGroupInformation
;
import
org.apache.hadoop.util.ShutdownHookManager
;
import
org.json.JSONObject
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -122,19 +123,23 @@ public class HiveHook extends AtlasHook implements ExecuteWithHookContext {
new
LinkedBlockingQueue
<
Runnable
>(
queueSize
),
new
ThreadFactoryBuilder
().
setNameFormat
(
"Atlas Logger %d"
).
build
());
Runtime
.
getRuntime
().
addShutdownHook
(
new
Thread
()
{
ShutdownHookManager
.
get
().
addShutdownHook
(
new
Thread
()
{
@Override
public
void
run
()
{
try
{
LOG
.
info
(
"==> Shutdown of Atlas Hive Hook"
);
executor
.
shutdown
();
executor
.
awaitTermination
(
WAIT_TIME
,
TimeUnit
.
SECONDS
);
executor
=
null
;
}
catch
(
InterruptedException
ie
)
{
LOG
.
info
(
"Interrupt received in shutdown."
);
}
finally
{
LOG
.
info
(
"<== Shutdown of Atlas Hive Hook"
);
}
// shutdown client
}
});
}
,
AtlasConstants
.
ATLAS_SHUTDOWN_HOOK_PRIORITY
);
}
setupOperationMap
();
...
...
This diff is collapsed.
Click to expand it.
common/src/main/java/org/apache/atlas/AtlasConstants.java
View file @
8044ca48
...
...
@@ -32,5 +32,6 @@ public final class AtlasConstants {
public
static
final
String
DEFAULT_APP_PORT_STR
=
"21000"
;
public
static
final
String
ATLAS_REST_ADDRESS_KEY
=
"atlas.rest.address"
;
public
static
final
String
DEFAULT_ATLAS_REST_ADDRESS
=
"http://localhost:21000"
;
public
static
final
int
ATLAS_SHUTDOWN_HOOK_PRIORITY
=
30
;
}
This diff is collapsed.
Click to expand it.
notification/src/main/java/org/apache/atlas/hook/AtlasHook.java
View file @
8044ca48
...
...
@@ -131,9 +131,9 @@ public abstract class AtlasHook {
}
catch
(
Exception
e
)
{
numRetries
++;
if
(
numRetries
<
maxRetries
)
{
LOG
.
error
(
"
Notification send retry failed"
);
LOG
.
error
(
"
Failed to send notification - attempt #"
+
numRetries
+
"; error="
+
e
.
getMessage
()
);
try
{
LOG
.
info
(
"Sleeping for {} ms before retry"
,
notificationRetryInterval
);
LOG
.
debug
(
"Sleeping for {} ms before retry"
,
notificationRetryInterval
);
Thread
.
sleep
(
notificationRetryInterval
);
}
catch
(
InterruptedException
ie
){
LOG
.
error
(
"Notification hook thread sleep interrupted"
);
...
...
This diff is collapsed.
Click to expand it.
release-log.txt
View file @
8044ca48
...
...
@@ -10,6 +10,7 @@ ATLAS-1060 Add composite indexes for exact match performance improvements for al
ATLAS-1127 Modify creation and modification timestamps to Date instead of Long(sumasai)
ALL CHANGES:
ATLAS-1162 Register shutdown hooks with Hadoop's ShutdownHookManager, instead of directly with Java Runtime (mneethiraj via sumasai)
ATLAS-1098 Atlas allows creation of tag with name "isa" which causes exceptions during search (apoorvnaik via kevalbhatt)
ATLAS-1160 Update Atlas hive hook to read configuration from atlas-application.properties instead of hive-site.xml (mneethiraj via kevalbhatt)
ATLAS-1154 Errors in Eclipse with web.xml (davidrad via dkantor)
...
...
This diff is collapsed.
Click to expand it.
webapp/src/main/java/org/apache/atlas/Atlas.java
View file @
8044ca48
...
...
@@ -30,6 +30,7 @@ import org.apache.commons.cli.ParseException;
import
org.apache.commons.configuration.Configuration
;
import
org.apache.commons.configuration.PropertiesConfiguration
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.hadoop.util.ShutdownHookManager
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -52,16 +53,20 @@ public final class Atlas {
private
static
EmbeddedServer
server
;
static
{
Runtime
.
getRuntime
().
addShutdownHook
(
new
Thread
()
{
ShutdownHookManager
.
get
().
addShutdownHook
(
new
Thread
()
{
@Override
public
void
run
()
{
try
{
LOG
.
info
(
"==> Shutdown of Atlas"
);
shutdown
();
}
catch
(
Exception
e
)
{
LOG
.
debug
(
"Failed to shutdown"
,
e
);
LOG
.
error
(
"Failed to shutdown"
,
e
);
}
finally
{
LOG
.
info
(
"<== Shutdown of Atlas"
);
}
}
});
}
,
AtlasConstants
.
ATLAS_SHUTDOWN_HOOK_PRIORITY
);
}
private
static
void
shutdown
()
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment