Package io.kroxylicious.proxy.config
Record Class VirtualCluster
java.lang.Object
java.lang.Record
io.kroxylicious.proxy.config.VirtualCluster
- Record Components:
name- virtual cluster nametargetCluster- inline target cluster definition (mutually exclusive withtarget)target- reference to a named cluster or router (mutually exclusive withtargetCluster)gateways- virtual cluster gatewayslogNetwork- if true, network will be loggedlogFrames- if true, kafka rpcs will be loggedfilters- filters applied to requestssubjectBuilder- subject builder configuration (optional)topicNameCache- topic-name cache configuration (optional)drainTimeout- maximum time to wait for in-flight requests to complete during graceful connection draining for this cluster
public record VirtualCluster(String name, TargetCluster targetCluster, RouteTarget target, List<VirtualClusterGateway> gateways, boolean logNetwork, boolean logFrames, List<String> filters, TransportSubjectBuilderConfig subjectBuilder, CacheConfiguration topicNameCache, Duration drainTimeout)
extends Record
A virtual cluster.
-
Constructor Summary
ConstructorsConstructorDescriptionVirtualCluster(String name, TargetCluster targetCluster, RouteTarget target, List<VirtualClusterGateway> gateways, boolean logNetwork, boolean logFrames, List<String> filters, TransportSubjectBuilderConfig subjectBuilder, CacheConfiguration topicNameCache, Duration drainTimeout) Creates an instance of aVirtualClusterrecord class.VirtualCluster(String name, TargetCluster targetCluster, List<VirtualClusterGateway> gateways, boolean logNetwork, boolean logFrames, List<String> filters) -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedrainTimeoutrecord component.final booleanIndicates whether some other object is "equal to" this one.filters()Returns the value of thefiltersrecord component.gateways()Returns the value of thegatewaysrecord component.final inthashCode()Returns a hash code value for this object.booleanReturns the value of thelogFramesrecord component.booleanReturns the value of thelogNetworkrecord component.name()Returns the value of thenamerecord component.router()booleansameAs(VirtualCluster other) Returnstrueif this cluster's deployment-time configuration is semantically identical toother's.Returns the value of thesubjectBuilderrecord component.target()Returns the value of thetargetrecord component.Deprecated, for removal: This API element is subject to removal in a future version.Returns the value of thetopicNameCacherecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
VirtualCluster
public VirtualCluster(String name, @Deprecated(since="0.22.0",forRemoval=true) @Nullable TargetCluster targetCluster, @Nullable RouteTarget target, List<VirtualClusterGateway> gateways, boolean logNetwork, boolean logFrames, @Nullable List<String> filters, @Nullable TransportSubjectBuilderConfig subjectBuilder, @Nullable CacheConfiguration topicNameCache, @Nullable Duration drainTimeout) Creates an instance of aVirtualClusterrecord class.- Parameters:
name- the value for thenamerecord componenttargetCluster- the value for thetargetClusterrecord componenttarget- the value for thetargetrecord componentgateways- the value for thegatewaysrecord componentlogNetwork- the value for thelogNetworkrecord componentlogFrames- the value for thelogFramesrecord componentfilters- the value for thefiltersrecord componentsubjectBuilder- the value for thesubjectBuilderrecord componenttopicNameCache- the value for thetopicNameCacherecord componentdrainTimeout- the value for thedrainTimeoutrecord component
-
VirtualCluster
public VirtualCluster(String name, TargetCluster targetCluster, List<VirtualClusterGateway> gateways, boolean logNetwork, boolean logFrames, @Nullable List<String> filters)
-
-
Method Details
-
router
-
namedTargetCluster
-
sameAs
Returnstrueif this cluster's deployment-time configuration is semantically identical toother's. Used by the configuration change-detection pipeline (seeVirtualClusterChangeDetector) to decide whether a virtual cluster needs to be restarted across areconfigure().Implementation uses the record's auto-generated
equals(Object)after canonicalising gateway order —gatewaysis a name-keyed semantic set, so reordering YAML entries is a no-op and must not produce a false positive. All other components (including any added in the future) are compared by the record's auto-equals, so this method extends automatically. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
targetCluster
Deprecated, for removal: This API element is subject to removal in a future version.Returns the value of thetargetClusterrecord component.- Returns:
- the value of the
targetClusterrecord component
-
target
Returns the value of thetargetrecord component.- Returns:
- the value of the
targetrecord component
-
gateways
Returns the value of thegatewaysrecord component.- Returns:
- the value of the
gatewaysrecord component
-
logNetwork
public boolean logNetwork()Returns the value of thelogNetworkrecord component.- Returns:
- the value of the
logNetworkrecord component
-
logFrames
public boolean logFrames()Returns the value of thelogFramesrecord component.- Returns:
- the value of the
logFramesrecord component
-
filters
Returns the value of thefiltersrecord component.- Returns:
- the value of the
filtersrecord component
-
subjectBuilder
Returns the value of thesubjectBuilderrecord component.- Returns:
- the value of the
subjectBuilderrecord component
-
topicNameCache
Returns the value of thetopicNameCacherecord component.- Returns:
- the value of the
topicNameCacherecord component
-
drainTimeout
Returns the value of thedrainTimeoutrecord component.- Returns:
- the value of the
drainTimeoutrecord component
-