-
Notifications
You must be signed in to change notification settings - Fork 303
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clients: add OPENLINEAGE_DISABLED environment variable which override…
…s config to NoopTransport Signed-off-by: Maciej Obuchowski <[email protected]>
- Loading branch information
1 parent
4873a11
commit 5531fde
Showing
11 changed files
with
118 additions
and
2 deletions.
There are no files selected for viewing
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
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
8 changes: 8 additions & 0 deletions
8
client/java/src/main/java/io/openlineage/client/Environment.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package io.openlineage.client; | ||
|
||
// This class exists because it's not possible to mock System | ||
public class Environment { | ||
public static String getEnvironmentVariable(String key) { | ||
return System.getenv(key); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
client/java/src/main/java/io/openlineage/client/transports/NoopTransport.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package io.openlineage.client.transports; | ||
|
||
import io.openlineage.client.OpenLineage; | ||
import lombok.extern.slf4j.Slf4j; | ||
|
||
@Slf4j | ||
public class NoopTransport extends Transport { | ||
public NoopTransport() { | ||
super(Type.NOOP); | ||
log.info("OpenLineage client is disabled"); | ||
} | ||
|
||
@Override | ||
public void emit(OpenLineage.RunEvent runEvent) {} | ||
} |
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# SPDX-License-Identifier: Apache-2.0. | ||
import logging | ||
|
||
from openlineage.client.run import RunEvent | ||
from openlineage.client.serde import Serde | ||
from openlineage.client.transport.transport import Transport, Config | ||
|
||
|
||
log = logging.getLogger(__name__) | ||
|
||
|
||
class NoopConfig(Config): | ||
pass | ||
|
||
|
||
class NoopTransport(Transport): | ||
kind = 'noop' | ||
config = NoopConfig | ||
|
||
def __init__(self, config: NoopConfig): | ||
log.debug("OpenLineage client is disabled. NoopTransport.") | ||
|
||
def emit(self, event: RunEvent): | ||
pass |
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
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