This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>com.datorama.oss</groupId> | |
<artifactId>timbermill-client</artifactId> | |
<version>2.0.4</version> | |
</dependency> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>com.datorama.oss</groupId> | |
<artifactId>timbermill-client</artifactId> | |
<version>2.0.4</version> | |
</dependency> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@TimberLog(name = "main_application") | |
public static void main(String[] args) { | |
TimberLogger.logContext("userId", userId); | |
isUserAuthorized(userId); | |
String sql = getSqlQuery(args); | |
List<String> result = runSql(sql); | |
} | |
@TimberLog(name = "is_user_authorized") | |
private static void isUserAuthorized(String userId){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@TimberLog(name = "main_application") | |
public static void main(String[] args) { | |
isUserAuthorized(userId); | |
String sql = getSqlQuery(args); | |
List<String> result = runSql(sql); | |
} | |
@TimberLog(name = "is_user_authorized") | |
private static void isUserAuthorized(String userId){ | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean auth(String token, String timbermillParentId){ | |
TimberLogger.start("authenticate", timbermillParentId, LogParams.create().string("token", token)); | |
try { | |
... | |
TimberLogger.logString("isAuthorized", isAuthorized); | |
return isAuthorized; | |
} catch (Throwable t){ | |
TimberLogger.error(t); | |
throw t; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public List<String> query(String query, String timbermillParentId) throws InterruptedException { | |
String id = TimberLogger.start("query", timbermillParentId, LogParams.create().text("sql", query)); | |
try { | |
authorize(id); | |
List<String> list = runSql(query); | |
TimberLogger.success(); | |
return list; | |
} catch (Throwable t){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean transformAndPersist(List<String> result, String outputDir, String timbermillParentId) { | |
String id = TimberLogger.start("transform_and_persist", timbermillParentId); | |
try{ | |
authorize(id); | |
runTransformation(result); | |
boolean isSuccess = persistToDisk(outputDir); | |
TimberLogger.success(); | |
return isSuccess; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public List<String> query(String query, String timbermillParentId) throws InterruptedException { | |
String id = TimberLogger.start("query", timbermillParentId, LogParams.create().text("sql", query)); | |
try { | |
authorized(id); | |
List<String> list = runSql(query); | |
TimberLogger.success(); | |
return list; | |
} catch (Throwable t){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@TimberLog(name = "etl_invocation") | |
public boolean runEtl(String userId, String query, String outputDir) { | |
TimberLogger.logContext("userId", userId); | |
String timbermillId = TimberLogger.getCurrentTaskId(); | |
List<String> result = callQueryService(query, timbermillId); | |
boolean isSuccess = callTransformationService(result, outputDir, timbermillId); | |
return isSuccess; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean transform(String outputDir, String timbermillParentId) throws InterruptedException { | |
String id = TimberLogger.start("transform", timbermillParentId, LogParams.create().text("outputhDir", outputDir)); | |
boolean isAuthorized = authorized(id); | |
runTransformation(); | |
boolean isSuccess = persistToDisk(outputDir); | |
TimberLogger.success(); | |
return isSuccess; | |
} |
NewerOlder