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
1 change: 1 addition & 0 deletions platform-grpc-service-framework/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ dependencies {
api("io.grpc:grpc-services")
api("org.hypertrace.core.grpcutils:grpc-client-utils:0.7.5")
api("com.typesafe:config:1.4.2")
api(project(":service-framework-spi"))

annotationProcessor("org.projectlombok:lombok:1.18.24")
compileOnly("org.projectlombok:lombok:1.18.24")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected InProcessGrpcChannelRegistry buildChannelRegistry() {
protected GrpcServiceContainerEnvironment buildContainerEnvironment(
InProcessGrpcChannelRegistry channelRegistry, HealthStatusManager healthStatusManager) {
return new ConsolidatedGrpcServiceContainerEnvironment(
channelRegistry, healthStatusManager, this.getInProcessServerName());
channelRegistry, healthStatusManager, this.getInProcessServerName(), this.getLifecycle());
}

@Override
Expand All @@ -51,7 +51,6 @@ protected Collection<GrpcPlatformServiceFactory> getServiceFactories() {
return Collections.emptySet();
}

@Deprecated
protected int getServicePort() {
return this.getAppConfig().getInt(DEFAULT_PORT_PATH);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import lombok.Getter;
import org.hypertrace.core.grpcutils.client.InProcessGrpcChannelRegistry;
import org.hypertrace.core.serviceframework.config.ConfigClientFactory;
import org.hypertrace.core.serviceframework.spi.PlatformServiceLifecycle;

@AllArgsConstructor
class ConsolidatedGrpcServiceContainerEnvironment implements GrpcServiceContainerEnvironment {
Expand All @@ -16,6 +17,8 @@ class ConsolidatedGrpcServiceContainerEnvironment implements GrpcServiceContaine

@Getter private final String inProcessChannelName;

@Getter private final PlatformServiceLifecycle lifecycle;

@Override
public void reportServiceStatus(String serviceName, ServingStatus status) {
this.healthStatusManager.setStatus(serviceName, status);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.typesafe.config.Config;
import io.grpc.health.v1.HealthCheckResponse.ServingStatus;
import org.hypertrace.core.grpcutils.client.InProcessGrpcChannelRegistry;
import org.hypertrace.core.serviceframework.spi.PlatformServiceLifecycle;

public interface GrpcServiceContainerEnvironment {
InProcessGrpcChannelRegistry getChannelRegistry();
Expand All @@ -12,4 +13,6 @@ public interface GrpcServiceContainerEnvironment {
Config getConfig(String serviceName);

String getInProcessChannelName();

PlatformServiceLifecycle getLifecycle();
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ protected List<GrpcPlatformServerDefinition> getServerDefinitions() {
protected GrpcServiceContainerEnvironment buildContainerEnvironment(
InProcessGrpcChannelRegistry channelRegistry, HealthStatusManager healthStatusManager) {
return new StandAloneGrpcServiceContainerEnvironment(
channelRegistry, healthStatusManager, this.configClient, this.getInProcessServerName());
channelRegistry,
healthStatusManager,
this.configClient,
this.getInProcessServerName(),
this.getLifecycle());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import lombok.Getter;
import org.hypertrace.core.grpcutils.client.InProcessGrpcChannelRegistry;
import org.hypertrace.core.serviceframework.config.ConfigClient;
import org.hypertrace.core.serviceframework.spi.PlatformServiceLifecycle;

@AllArgsConstructor
class StandAloneGrpcServiceContainerEnvironment implements GrpcServiceContainerEnvironment {
Expand All @@ -18,6 +19,8 @@ class StandAloneGrpcServiceContainerEnvironment implements GrpcServiceContainerE

@Getter private final String inProcessChannelName;

@Getter private final PlatformServiceLifecycle lifecycle;

@Override
public void reportServiceStatus(String serviceName, ServingStatus status) {
this.healthStatusManager.setStatus(serviceName, status);
Expand Down