-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[5889] Bmoric/add application name [2/3] #7267
Changes from all commits
3b1a65a
dd8a123
20964f0
bd4a7ff
ee6b7e9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* Copyright (c) 2021 Airbyte, Inc., all rights reserved. | ||
*/ | ||
|
||
package io.airbyte.workers; | ||
|
||
public interface Application { | ||
|
||
default String getApplicationName() { | ||
// This value should only be used in the U-Test, it is an empty string instead of airbyte-test in | ||
// order to avoid displaying airbyte-test in prod | ||
return ""; | ||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,4 +82,9 @@ public void cancel() { | |
} | ||
} | ||
|
||
@Override | ||
public String getApplicationName() { | ||
return "normalization-worker"; | ||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -271,4 +271,9 @@ public void cancel() { | |
|
||
} | ||
|
||
@Override | ||
public String getApplicationName() { | ||
return "sync-worker"; | ||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,10 +5,11 @@ | |
package io.airbyte.workers.protocols; | ||
|
||
import io.airbyte.config.State; | ||
import io.airbyte.workers.Application; | ||
import java.util.Optional; | ||
import java.util.function.Consumer; | ||
|
||
public interface MessageTracker<T> extends Consumer<T> { | ||
public interface MessageTracker<T> extends Consumer<T>, Application { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this doesn't seem right. Message Tracker isn't an Application. I wonder if the way to track name is wrong or just the naming of this interface. WDYT? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that we need make sure that I properly understand how granular we want to log. My initial thought was that we have a different prefix within the same application (a different prefix per step). So if we want to go in this direction we will probably need to rename the interface. If not I should remove the Application interface and move this method to the worker interface. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree the iface name should change. Will follow up offline, but I'm am not understanding the granularity we are going for right now. The issue is focused on distinguishing source, destination, and platform logs from each other. This PR is focused on distinguishing worker logs from each other, and I'm a little less clear on why that is valuable. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I sync up offline with Michel on that. I will abandon the interface and this review for something more suited to what is needed. |
||
|
||
@Override | ||
void accept(T message); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By convention, we do not usually use a
default
in an interface if the default implementation is for testing only. The reason for this is that with this default, it is easy for a developer to make a mistake using this interface because the compiler won't warn them that they need to override method. If they fail to do that, then test code will accidentally run in production. Instead we would usually structure it something like this, so that the compiler complains if the developer makes a mistake.