Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import io.airlift.units.MinDuration;
import jakarta.validation.constraints.NotNull;

import java.net.URI;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand All @@ -32,22 +33,22 @@

public class OpenLineageClientHttpTransportConfig
{
private String url;
private URI url;
private String endpoint;
private Optional<String> apiKey = Optional.empty();
private Duration timeout = new Duration(5000, TimeUnit.MILLISECONDS);
private Map<String, String> headers = new HashMap<>();
private Map<String, String> urlParams = new HashMap<>();

@NotNull
public String getUrl()
public URI getUrl()
{
return url;
}

@Config("openlineage-event-listener.transport.url")
@ConfigDescription("URL of receiving server. Explicitly set the scheme https:// to use symmetric encryption")
public OpenLineageClientHttpTransportConfig setUrl(String url)
public OpenLineageClientHttpTransportConfig setUrl(URI url)
{
this.url = url;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@

public interface OpenLineageTransport
{
Transport buildTransport()
throws Exception;
Transport buildTransport();
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
public class OpenLineageHttpTransport
implements OpenLineageTransport
{
private final String url;
private final URI url;
private final String endpoint;
private final int timeout;
private final ApiKeyTokenProvider apiKey;
Expand Down Expand Up @@ -64,11 +64,10 @@ public OpenLineageHttpTransport(OpenLineageClientHttpTransportConfig config)

@Override
public HttpTransport buildTransport()
throws Exception
{
return new HttpTransport(
new HttpConfig(
new URI(this.url),
this.url,
this.endpoint,
null,
this.timeout,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import io.trino.plugin.openlineage.config.http.OpenLineageClientHttpTransportConfig;
import org.junit.jupiter.api.Test;

import java.net.URI;
import java.util.Map;

import static io.airlift.configuration.testing.ConfigAssertions.assertFullMapping;
Expand All @@ -41,6 +42,7 @@ void testDefaults()

@Test
void testExplicitPropertyMappings()
throws Exception
{
Map<String, String> properties = ImmutableMap.<String, String>builder()
.put("openlineage-event-listener.transport.url", "http://testurl")
Expand All @@ -53,7 +55,7 @@ void testExplicitPropertyMappings()
.buildOrThrow();

OpenLineageClientHttpTransportConfig expected = new OpenLineageClientHttpTransportConfig()
.setUrl("http://testurl")
.setUrl(new URI("http://testurl"))
.setEndpoint("/test/endpoint")
.setApiKey("dummy")
.setTimeout(Duration.valueOf("30s"))
Expand Down