Class MultiTenantRequestContext
java.lang.Object
org.apache.kafka.common.requests.RequestContext
io.confluent.kafka.multitenant.MultiTenantRequestContext
- All Implemented Interfaces:
org.apache.kafka.server.authorizer.AuthorizableRequestContext
public class MultiTenantRequestContext
extends org.apache.kafka.common.requests.RequestContext
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.kafka.common.requests.RequestContext
org.apache.kafka.common.requests.RequestContext.ResponseSend -
Field Summary
Fields inherited from class org.apache.kafka.common.requests.RequestContext
authenticationContext, clientAddress, clientInformation, clientPort, connectionId, fromPrivilegedListener, header, k2RequestContext, listenerName, principal, principalSerde, produceConsumeAuditLogTracker, securityProtocol, shouldLogForConnection, sniHostName -
Constructor Summary
ConstructorsConstructorDescriptionMultiTenantRequestContext(org.apache.kafka.common.requests.RequestHeader header, String connectionId, long requestId, InetAddress clientAddress, Optional<Integer> clientPort, io.confluent.kafka.multitenant.MultiTenantPrincipal principal, org.apache.kafka.common.network.ListenerName listenerName, org.apache.kafka.common.security.auth.SecurityProtocol securityProtocol, org.apache.kafka.common.network.ClientInformation clientInformation, org.apache.kafka.common.security.authenticator.PathAwareSniHostName sniHostName, org.apache.kafka.common.utils.Time time, org.apache.kafka.common.metrics.Metrics metrics, TenantMetrics tenantMetrics, HotPartitionManager hotPartitionManager, MultiTenantInterceptorConfig config, Optional<org.apache.kafka.server.link.ClusterLinkSourceMetrics> clusterLinkSourceMetrics, boolean isPrivilegedListener, Optional<org.apache.kafka.common.security.auth.KafkaPrincipalSerde> principalSerde, org.apache.kafka.common.security.auth.AuthenticationContext authenticationContext, org.apache.kafka.common.network.ProduceConsumeAuditLogTracker produceConsumeAuditLogTracker, boolean isProxyModeLocal, org.apache.kafka.common.network.BrokerFqdnBuilder.FQDNPropertiesFromPPV2 fqdnPropertiesFromPpv2, String networkType, boolean shouldLogForConnection) MultiTenantRequestContext(org.apache.kafka.common.requests.RequestHeader header, String connectionId, long requestId, InetAddress clientAddress, Optional<Integer> clientPort, io.confluent.kafka.multitenant.MultiTenantPrincipal principal, org.apache.kafka.common.network.ListenerName listenerName, org.apache.kafka.common.security.auth.SecurityProtocol securityProtocol, org.apache.kafka.common.network.ClientInformation clientInformation, org.apache.kafka.common.security.authenticator.PathAwareSniHostName sniHostName, org.apache.kafka.common.utils.Time time, org.apache.kafka.common.metrics.Metrics metrics, TenantMetrics tenantMetrics, HotPartitionManager hotPartitionManager, MultiTenantInterceptorConfig config, Optional<org.apache.kafka.server.link.ClusterLinkSourceMetrics> clusterLinkSourceMetrics, boolean isPrivilegedListener, Optional<org.apache.kafka.common.security.auth.KafkaPrincipalSerde> principalSerde, org.apache.kafka.common.security.auth.AuthenticationContext authenticationContext, org.apache.kafka.common.network.ProduceConsumeAuditLogTracker produceConsumeAuditLogTracker, boolean isProxyModeLocal, org.apache.kafka.common.network.BrokerFqdnBuilder.FQDNPropertiesFromPPV2 fqdnPropertiesFromPpv2, String networkType, boolean shouldLogForConnection, org.apache.kafka.common.metrics.internals.ConfluentMetricsContextProvider confluentMetricsContextProvider, Optional<kafka.server.ClientRequestRateQuotaManager> requestRateQuotaManager) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.kafka.common.requests.RequestContext.ResponseSendbuildResponseSend(org.apache.kafka.common.requests.AbstractResponse body) org.apache.kafka.common.requests.AbstractResponseintercept(org.apache.kafka.common.requests.AbstractRequest request, int throttleTimeMs) booleanbooleanstatic booleanisSupportedFFFClient(org.apache.kafka.common.requests.FetchRequest request, boolean fetchFromFollowerRequireLeaderEpochEnabled) TheIS_SUPPORTED_FFF_CLIENTtag is set tofalseif client tries to use FetchFromFollower from KIP-392, but hasn't addedCurrentLeaderEpochto theFetchRequestthat is introduced in KIP-320.org.apache.kafka.common.requests.AbstractResponseparsedResponse(org.apache.kafka.common.requests.AbstractResponse response, short version) org.apache.kafka.common.requests.RequestAndSizeparseRequest(org.apache.kafka.common.protocol.Readable readable) booleanstatic org.apache.kafka.common.acl.AclBindingFiltertransformAclFilter(String tenantPrefix, String prefixedWildcard, org.apache.kafka.common.acl.AclBindingFilter aclFilter) booleanMethods inherited from class org.apache.kafka.common.requests.RequestContext
allBrokerZones, apiKey, apiVersion, brokerToGatewayZoneMapping, buildResponseEnvelopePayload, clientAddress, clientId, connectionId, controllerRequestPrincipal, correlationId, fqdnPropertiesFromPpv2, getClientAddress, getPrincipal, getPrincipalSerde, isProxyModeLocal, kafkaRequestId, listenerName, maybeEnableClusterLinkTenant, parseRequest, principal, quotaPrincipal, requestType, requestVersion, securityProtocol, sessionId, setAllBrokerZones, setBrokerToGatewayZoneMapping, sniHostName, toStringMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.kafka.server.authorizer.AuthorizableRequestContext
clientAddressAsString
-
Constructor Details
-
MultiTenantRequestContext
public MultiTenantRequestContext(org.apache.kafka.common.requests.RequestHeader header, String connectionId, long requestId, InetAddress clientAddress, Optional<Integer> clientPort, io.confluent.kafka.multitenant.MultiTenantPrincipal principal, org.apache.kafka.common.network.ListenerName listenerName, org.apache.kafka.common.security.auth.SecurityProtocol securityProtocol, org.apache.kafka.common.network.ClientInformation clientInformation, org.apache.kafka.common.security.authenticator.PathAwareSniHostName sniHostName, org.apache.kafka.common.utils.Time time, org.apache.kafka.common.metrics.Metrics metrics, TenantMetrics tenantMetrics, HotPartitionManager hotPartitionManager, MultiTenantInterceptorConfig config, Optional<org.apache.kafka.server.link.ClusterLinkSourceMetrics> clusterLinkSourceMetrics, boolean isPrivilegedListener, Optional<org.apache.kafka.common.security.auth.KafkaPrincipalSerde> principalSerde, org.apache.kafka.common.security.auth.AuthenticationContext authenticationContext, org.apache.kafka.common.network.ProduceConsumeAuditLogTracker produceConsumeAuditLogTracker, boolean isProxyModeLocal, org.apache.kafka.common.network.BrokerFqdnBuilder.FQDNPropertiesFromPPV2 fqdnPropertiesFromPpv2, String networkType, boolean shouldLogForConnection) -
MultiTenantRequestContext
public MultiTenantRequestContext(org.apache.kafka.common.requests.RequestHeader header, String connectionId, long requestId, InetAddress clientAddress, Optional<Integer> clientPort, io.confluent.kafka.multitenant.MultiTenantPrincipal principal, org.apache.kafka.common.network.ListenerName listenerName, org.apache.kafka.common.security.auth.SecurityProtocol securityProtocol, org.apache.kafka.common.network.ClientInformation clientInformation, org.apache.kafka.common.security.authenticator.PathAwareSniHostName sniHostName, org.apache.kafka.common.utils.Time time, org.apache.kafka.common.metrics.Metrics metrics, TenantMetrics tenantMetrics, HotPartitionManager hotPartitionManager, MultiTenantInterceptorConfig config, Optional<org.apache.kafka.server.link.ClusterLinkSourceMetrics> clusterLinkSourceMetrics, boolean isPrivilegedListener, Optional<org.apache.kafka.common.security.auth.KafkaPrincipalSerde> principalSerde, org.apache.kafka.common.security.auth.AuthenticationContext authenticationContext, org.apache.kafka.common.network.ProduceConsumeAuditLogTracker produceConsumeAuditLogTracker, boolean isProxyModeLocal, org.apache.kafka.common.network.BrokerFqdnBuilder.FQDNPropertiesFromPPV2 fqdnPropertiesFromPpv2, String networkType, boolean shouldLogForConnection, org.apache.kafka.common.metrics.internals.ConfluentMetricsContextProvider confluentMetricsContextProvider, Optional<kafka.server.ClientRequestRateQuotaManager> requestRateQuotaManager)
-
-
Method Details
-
tenantPrefix
-
isPpv2EndpointSchemeEnabled
public boolean isPpv2EndpointSchemeEnabled()- Overrides:
isPpv2EndpointSchemeEnabledin classorg.apache.kafka.common.requests.RequestContext
-
isPpv2EndpointSchemeMapBrokerToGatewayZoneEnabled
public boolean isPpv2EndpointSchemeMapBrokerToGatewayZoneEnabled()- Overrides:
isPpv2EndpointSchemeMapBrokerToGatewayZoneEnabledin classorg.apache.kafka.common.requests.RequestContext
-
parseRequest
public org.apache.kafka.common.requests.RequestAndSize parseRequest(org.apache.kafka.common.protocol.Readable readable) - Overrides:
parseRequestin classorg.apache.kafka.common.requests.RequestContext
-
shouldIntercept
public boolean shouldIntercept()- Overrides:
shouldInterceptin classorg.apache.kafka.common.requests.RequestContext
-
intercept
public org.apache.kafka.common.requests.AbstractResponse intercept(org.apache.kafka.common.requests.AbstractRequest request, int throttleTimeMs) - Overrides:
interceptin classorg.apache.kafka.common.requests.RequestContext
-
buildResponseSend
public org.apache.kafka.common.requests.RequestContext.ResponseSend buildResponseSend(org.apache.kafka.common.requests.AbstractResponse body) - Overrides:
buildResponseSendin classorg.apache.kafka.common.requests.RequestContext
-
transformed
public boolean transformed()- Overrides:
transformedin classorg.apache.kafka.common.requests.RequestContext
-
parsedResponse
public org.apache.kafka.common.requests.AbstractResponse parsedResponse(org.apache.kafka.common.requests.AbstractResponse response, short version) - Overrides:
parsedResponsein classorg.apache.kafka.common.requests.RequestContext
-
transformAclFilter
-
isSupportedFFFClient
public static boolean isSupportedFFFClient(org.apache.kafka.common.requests.FetchRequest request, boolean fetchFromFollowerRequireLeaderEpochEnabled) TheIS_SUPPORTED_FFF_CLIENTtag is set tofalseif client tries to use FetchFromFollower from KIP-392, but hasn't addedCurrentLeaderEpochto theFetchRequestthat is introduced in KIP-320. This function assumes that if client implements KIP-320, then it sets validcurrentLeaderEpochto all partitions in aFetchRequest. This function follows the logic ofFetchParams::isSupportedFFFClient. IfFetchParams::isSupportedFFFClientchanges, modify this function accordingly.- See Also:
-
metricsRequestContext
-