kgyrtkirk commented on code in PR #3798:
URL: https://github.com/apache/hive/pull/3798#discussion_r1259274907
##########
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/AtlasDumpTask.java:
##########
@@ -68,16 +70,23 @@ public class AtlasDumpTask extends Task<AtlasDumpWork>
implements Serializable {
private static final transient Logger LOG =
LoggerFactory.getLogger(AtlasDumpTask.class);
private static final long serialVersionUID = 1L;
private transient AtlasRestClient atlasRestClient;
+ private AtlasDumpLogger replLogger;
public AtlasDumpTask() {
super();
}
@VisibleForTesting
- AtlasDumpTask(final AtlasRestClient atlasRestClient, final HiveConf conf,
final AtlasDumpWork work) {
+ AtlasDumpTask(final AtlasRestClient atlasRestClient, final HiveConf conf,
final AtlasDumpWork work, AtlasDumpLogger replLogger) {
this.conf = conf;
this.work = work;
this.atlasRestClient = atlasRestClient;
+ this.replLogger = replLogger;
+ }
+
+ @VisibleForTesting
+ AtlasDumpTask(final AtlasRestClient atlasRestClient, final HiveConf conf,
final AtlasDumpWork work) {
Review Comment:
why keep the old constructor? it was `@VisibleForTesting` - so I think its
better to just change the signature
##########
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/AtlasDumpTask.java:
##########
@@ -129,6 +137,14 @@ public int execute() {
}
}
+ @NotNull
+ private void initializeReplLogger(AtlasReplInfo atlasReplInfo) {
+ if (this.replLogger == null){
+ this.replLogger = new AtlasDumpLogger(atlasReplInfo.getSrcDB(),
+ atlasReplInfo.getStagingDir().toString());
+ }
+ }
Review Comment:
the new field + this method causes a behaviour change: the `replLogger` will
be retained between `execute()` calls - it becomes lazy-init kinda stuff
I don't know this part - but could that cause any problem?
to 100% retain the old behavour you could rename this method to
`getReplLogger()` and return a new instance if the stored is null
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]