Skip to content

Commit 2c71b59

Browse files
committed
log: added info logs jg init
1 parent aafc251 commit 2c71b59

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraph.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ public AtlasJanusGraph() {
134134

135135
public AtlasJanusGraph(JanusGraph graphInstance, RestHighLevelClient elasticsearchClient, RestClient restClient) {
136136
//determine multi-properties once at startup
137+
LOG.info("Initializing AtlasJanusGraph constructor");
137138
JanusGraphManagement mgmt = null;
138139

139140
try {
@@ -150,6 +151,7 @@ public AtlasJanusGraph(JanusGraph graphInstance, RestHighLevelClient elasticsear
150151
if (mgmt != null) {
151152
mgmt.rollback();
152153
}
154+
LOG.info("Done initializing AtlasJanusGraph constructor");
153155
}
154156

155157
janusGraph = (StandardJanusGraph) graphInstance;

graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraphDatabase.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public static JanusGraph getGraphInstance() {
195195

196196
@VisibleForTesting
197197
static JanusGraph initJanusGraph(Configuration config) {
198-
198+
LOG.info("Initializing Janusgraph instance");
199199
org.apache.commons.configuration2.Configuration conf2 = createConfiguration2(config);
200200
try {
201201
return JanusGraphFactory.open(conf2);
@@ -208,6 +208,8 @@ static JanusGraph initJanusGraph(Configuration config) {
208208
} else {
209209
throw new RuntimeException(e);
210210
}
211+
} finally {
212+
LOG.info("Initialized JG instance");
211213
}
212214
}
213215

@@ -292,6 +294,7 @@ public static void unload() {
292294
}
293295

294296
static void validateIndexBackend(Configuration config) {
297+
LOG.info("Validating index backend");
295298
String configuredIndexBackend = config.getString(INDEX_BACKEND_CONF);
296299

297300
JanusGraphManagement managementSystem = getGraphInstance().openManagement();
@@ -303,6 +306,8 @@ static void validateIndexBackend(Configuration config) {
303306
+ " differs from earlier configured Index Backend " + currentIndexBackend + ". Aborting!");
304307
}
305308

309+
LOG.info("Done validating index backend");
310+
306311
}
307312

308313
@Override

repository/src/main/java/org/apache/atlas/repository/graph/AtlasGraphProvider.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,17 @@ public static void cleanup() {
9494
@Override
9595
@Bean(destroyMethod = "")
9696
public AtlasGraph get() throws RepositoryException{
97+
LOG.info("Getting AtlasGraphProvider");
9798
try {
9899
return getGraphInstance();
99100
} catch (Exception ex) {
100101
LOG.info("Failed to obtain graph instance, retrying " + MAX_RETRY_COUNT + " times, error: " + ex);
101102

102103
return retry();
104+
} finally {
105+
LOG.info("Done getting AtlasGraphProvider");
103106
}
107+
104108
}
105109

106110
private AtlasGraph retry() throws RepositoryException {

0 commit comments

Comments
 (0)