Skip to content

Commit

Permalink
Moved PipedAsyncWritableChannel to closed source and re-use restServe…
Browse files Browse the repository at this point in the history
…rRouterFactory (#2929)

This change:

1. Moves PipedAsyncWritableChannel to AmbryLI
2. Reuses restServerRouterFactory instead of boolean to switch between routers
  • Loading branch information
Arun-LinkedIn authored Oct 25, 2024
1 parent 62c6485 commit 25a09cf
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 950 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ public class RestServerConfig {
public static final String CONFIG_PREFIX = "rest.server.";
public static final String ENABLE_ADDED_CHANNEL_HANDLERS = CONFIG_PREFIX + "enable.added.channel.handlers";
public static final String ENABLE_STRUCTURED_LOGGING = CONFIG_PREFIX + "enable.structured.logging";
public static final String ENABLE_COMPOSITE_ROUTER = CONFIG_PREFIX + "enable.composite.router";
private static final String PIPED_ASYNC_CHANNEL_SECONDARY_TIMEOUT_MS =
CONFIG_PREFIX + "piped.async.channel.secondary.timeout.ms";

/**
* The RestRequestServiceFactory that needs to be used by the RestServer
Expand Down Expand Up @@ -76,14 +73,6 @@ public class RestServerConfig {
@Default("com.github.ambry.router.NonBlockingRouterFactory")
public final String restServerRouterFactory;

/**
* The CompositeRouterFactory that needs to be used by the RestServer
* for bootstrapping the CompositeRouter.
*/
@Config("rest.server.composite.router.factory")
@Default("")
public final String restServerCompositeRouterFactory;

/**
* Request Headers that needs to be logged as part of public access log entries
*/
Expand Down Expand Up @@ -119,20 +108,6 @@ public class RestServerConfig {
@Default("false")
public final boolean restServerEnableAddedChannelHandlers;

/**
* Timeout when writing to secondary reader via PipedAsyncWritableChannel.
*/
@Config(PIPED_ASYNC_CHANNEL_SECONDARY_TIMEOUT_MS)
@Default("100")
public final int restServerPipedAsyncChannelSecondaryTimeoutMs;

/**
* Set true to enable composite router in RestServer.
*/
@Config(ENABLE_COMPOSITE_ROUTER)
@Default("false")
public final boolean restServerEnableCompositeRouter;

public RestServerConfig(VerifiableProperties verifiableProperties) {
restServerRestRequestServiceFactory = verifiableProperties.getString("rest.server.rest.request.service.factory");
restServerNioServerFactory =
Expand All @@ -146,7 +121,6 @@ public RestServerConfig(VerifiableProperties verifiableProperties) {
verifiableProperties.getIntInRange("rest.server.response.handler.scaling.unit.count", 5, 0, Integer.MAX_VALUE);
restServerAccountServiceFactory = verifiableProperties.getString("rest.server.account.service.factory",
"com.github.ambry.account.InMemoryUnknownAccountServiceFactory");
restServerCompositeRouterFactory = verifiableProperties.getString("rest.server.composite.router.factory", "");
restServerRouterFactory = verifiableProperties.getString("rest.server.router.factory",
"com.github.ambry.router.NonBlockingRouterFactory");
restServerPublicAccessLogRequestHeaders =
Expand All @@ -157,8 +131,5 @@ public RestServerConfig(VerifiableProperties verifiableProperties) {
restServerEnableStructuredLogging = verifiableProperties.getBoolean(ENABLE_STRUCTURED_LOGGING, false);
restServerHealthCheckUri = verifiableProperties.getString("rest.server.health.check.uri", "/healthCheck");
restServerEnableAddedChannelHandlers = verifiableProperties.getBoolean(ENABLE_ADDED_CHANNEL_HANDLERS, false);
restServerEnableCompositeRouter = verifiableProperties.getBoolean(ENABLE_COMPOSITE_ROUTER, false);
restServerPipedAsyncChannelSecondaryTimeoutMs =
verifiableProperties.getInt(PIPED_ASYNC_CHANNEL_SECONDARY_TIMEOUT_MS, 100);
}
}
Loading

0 comments on commit 25a09cf

Please sign in to comment.