Skip to content

Conversation

@ggivo
Copy link
Contributor

@ggivo ggivo commented Sep 24, 2025

Rename maintenance notification configuration properties

Summary

Renames configuration classes and properties for better clarity and consistency in maintenance notification handling.
Consistent Naming: Aligns with Redis maintenance notifications terminology

Changes Made

1. MaintenanceEventsOptions → MaintNotificationsConfig

  • Renamed main configuration class from MaintenanceEventsOptions to MaintNotificationsConfig
  • Updated method names:
    • supportMaintenanceEvents()enableMaintNotifications()
    • supportsMaintenanceEvents()maintNotificationsEnabled()
    • getMaintenanceEventsOptions()getMaintNotificationsConfig()
  • Updated builder method: supportMaintenanceEvents()maintNotificationsConfig()

2. AddressType → EndpointType

  • Renamed enum AddressType to EndpointType for better semantic clarity
  • Renamed related classes and methods:
    • AddressTypeSourceEndpointTypeSource
    • getAddressType()getEndpointType()
    • fixedAddressType()endpointType()
    • autoResolveAddressType()autoResolveEndpointType()
  • Updated internal implementation classes:
    • FixedAddressTypeSourceFixedEndpointTypeSource
    • AutoresolveAddressTypeSourceAutoresolveEndpointTypeSource

Example after rename

RedisClient redisClient = RedisClient.create("redis://localhost:6379");
        MaintNotificationsConfig maintNotificationsConfig = MaintNotificationsConfig.builder()
                .enableMaintNotifications()
                // .autoResolveEndpointType() // default is autResolve
                .endpointType(EndpointType.INTERNAL_IP)
                .build();

        TimeoutOptions timeoutOptions = TimeoutOptions.builder()
                .relaxedTimeoutsDuringMaintenance( Duration.ofSeconds(10))
                .build();

        ClientOptions clientOptions = ClientOptions.builder()
                .maintNotificationsConfig(maintNotificationsConfig)
                .timeoutOptions(timeoutOptions)
                .build();

        redisClient.setOptions(clientOptions);

        // or
        ClientOptions clientOptions = ClientOptions.builder()
                .maintNotificationsConfig(MaintNotificationsConfig.enabled(EndpointType.INTERNAL_IP))
                .build();

        redisClient.setOptions(clientOptions);

        // or
        ClientOptions clientOptions = ClientOptions.builder()
                .maintNotificationsConfig(MaintNotificationsConfig.enabled())
                .build();

        redisClient.setOptions(clientOptions);

Backward Compatibility

This is a breaking change that requires applications to update their maintenance notification configuration to use the new property names. There is no GA release of the Maintenance Notifications feature, meaning it should not be a concern

  • You have read the contribution guidelines.
  • You have created a feature request first to discuss your contribution intent. Please reference the feature request ticket number in the pull request.
  • You applied code formatting rules using the mvn formatter:format target. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.

Rename configuration class and properties for maintenance notifications:
- MaintenanceEventsOptions → MaintNotificationsConfig
- supportMaintenanceEvents() → enableMaintNotifications()
- supportsMaintenanceEvents() → maintNotificationsEnabled()
- getMaintenanceEventsOptions() → getMaintNotificationsConfig()

Updates all references across codebase and tests.
Rename maintenance notification address types to endpoint types:
- AddressType → EndpointType enum
- AddressTypeSource → EndpointTypeSource class
- getAddressType() → getEndpointType() method
- fixedAddressType() → endpointType() builder method
- autoResolveAddressType() → autoResolveEndpointType() method
@ggivo ggivo requested a review from Copilot September 24, 2025 11:03
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR renames configuration classes and properties for maintenance notifications to improve clarity and consistency. The changes align the naming with Redis maintenance notifications terminology while maintaining the same functionality.

  • Renames MaintenanceEventsOptions to MaintNotificationsConfig for better semantic clarity
  • Changes AddressType enum and related classes to EndpointType for more accurate terminology
  • Updates all method names to use the new naming conventions (e.g., supportMaintenanceEvents()maintNotificationsConfig())

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/test/java/io/lettuce/scenario/RelaxedTimeoutConfigurationTest.java Updates test to use new MaintNotificationsConfig class and method names
src/test/java/io/lettuce/core/tracing/BraveTracingIntegrationTests.java Updates tracing tests to use new configuration class and method names
src/test/java/io/lettuce/core/RedisHandshakeUnitTests.java Updates handshake unit tests with new class names and method signatures
src/test/java/io/lettuce/core/MaintenanceEventsOptionsUnitTests.java Removes old unit test file for MaintenanceEventsOptions
src/test/java/io/lettuce/core/MaintNotificationsConfigUnitTests.java Adds new unit test file for MaintNotificationsConfig
src/main/java/io/lettuce/core/protocol/RebindState.java Updates JavaDoc reference to new method name
src/main/java/io/lettuce/core/protocol/MaintenanceAwareExpiryWriter.java Updates JavaDoc references to new configuration method
src/main/java/io/lettuce/core/protocol/MaintenanceAwareConnectionWatchdog.java Updates JavaDoc reference to new configuration method
src/main/java/io/lettuce/core/protocol/MaintenanceAwareComponent.java Updates JavaDoc reference to new configuration method
src/main/java/io/lettuce/core/protocol/CommandHandler.java Adds missing braces and debug check for rebind logging
src/main/java/io/lettuce/core/protocol/CommandExpiryWriter.java Updates method call to use new configuration method name
src/main/java/io/lettuce/core/TimeoutOptions.java Updates JavaDoc references to new configuration method
src/main/java/io/lettuce/core/RedisHandshake.java Updates class to use new EndpointTypeSource and method names
src/main/java/io/lettuce/core/MaintenanceEventsOptions.java Removes old configuration class
src/main/java/io/lettuce/core/MaintNotificationsConfig.java Adds new configuration class with updated naming
src/main/java/io/lettuce/core/ConnectionBuilder.java Updates to use new configuration method name
src/main/java/io/lettuce/core/ClientOptions.java Updates to use new configuration class and method names
src/main/java/io/lettuce/core/AbstractRedisClient.java Updates to use new configuration class and removes unused imports

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

ggivo added a commit to redis-developer/lettuce-test-app that referenced this pull request Sep 24, 2025
  - maintenanceEventsConfig -> maintNotificationsConfig
  - movingEndpointAddressType -> endpointType

  corresponding lettuce-core change
  redis/lettuce#3450
ggivo added a commit to redis-developer/lettuce-test-app that referenced this pull request Sep 25, 2025
runner-config.yaml is not changed to not break existing test configuration
Code is updated to use updated builder names from
corresponding lettuce-core change redis/lettuce#3450
@ggivo
Copy link
Contributor Author

ggivo commented Sep 26, 2025

run scenario tests

1 similar comment
@uglide
Copy link
Collaborator

uglide commented Sep 26, 2025

run scenario tests

Copy link
Collaborator

@uglide uglide left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@uglide
Copy link
Collaborator

uglide commented Sep 26, 2025

Testcase Errors Failures Skipped Total
io.lettuce.scenario.MaintenanceNotificationTest 5 0 0 5
io.lettuce.scenario.FaultInjectionClientUnitTest 0 0 0 10
io.lettuce.scenario.ConnectionInterruptionReactiveTest 0 1 0 4
io.lettuce.scenario.RelaxedTimeoutConfigurationTest 5 0 1 6

---- Details for maintainers

@ggivo
Copy link
Contributor Author

ggivo commented Sep 26, 2025

run scenario tests

@uglide
Copy link
Collaborator

uglide commented Sep 26, 2025

Testcase Errors Failures Skipped Total
io.lettuce.scenario.MaintenanceNotificationTest 5 0 0 5
io.lettuce.scenario.FaultInjectionClientUnitTest 0 0 0 10
io.lettuce.scenario.ConnectionInterruptionReactiveTest 0 1 0 4
io.lettuce.scenario.RelaxedTimeoutConfigurationTest 5 0 1 6

---- Details for maintainers

@uglide
Copy link
Collaborator

uglide commented Sep 26, 2025

Testcase Errors Failures Skipped Total
io.lettuce.scenario.MaintenanceNotificationTest 5 0 0 5
io.lettuce.scenario.FaultInjectionClientUnitTest 0 0 0 10
io.lettuce.scenario.ConnectionInterruptionReactiveTest 0 0 0 4
io.lettuce.scenario.RelaxedTimeoutConfigurationTest 5 0 1 6

---- Details for maintainers

@uglide
Copy link
Collaborator

uglide commented Sep 26, 2025

Testcase Errors Failures Skipped Total
io.lettuce.scenario.MaintenanceNotificationTest 5 0 0 5
io.lettuce.scenario.FaultInjectionClientUnitTest 0 0 0 10
io.lettuce.scenario.ConnectionInterruptionReactiveTest 0 1 0 4
io.lettuce.scenario.RelaxedTimeoutConfigurationTest 5 0 1 6

---- Details for maintainers

@uglide
Copy link
Collaborator

uglide commented Sep 26, 2025

Testcase Errors Failures Skipped Total
io.lettuce.scenario.MaintenanceNotificationTest 5 0 0 5
io.lettuce.scenario.FaultInjectionClientUnitTest 0 0 0 10
io.lettuce.scenario.ConnectionInterruptionReactiveTest 0 2 0 4
io.lettuce.scenario.RelaxedTimeoutConfigurationTest 5 0 1 6

---- Details for maintainers

@ggivo ggivo merged commit 379fdf4 into main Sep 26, 2025
11 checks passed
@ggivo ggivo deleted the hu-maintenance-notification-settings-rename branch September 26, 2025 14:20
@ggivo ggivo added the type: feature A new feature label Oct 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feature A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants