diff --git a/airbyte-integrations/connectors/source-relational-db/src/main/java/io/airbyte/integrations/source/relationaldb/state/StateManagerFactory.java b/airbyte-integrations/connectors/source-relational-db/src/main/java/io/airbyte/integrations/source/relationaldb/state/StateManagerFactory.java index 8ed39cc44606..ac2b26e317ee 100644 --- a/airbyte-integrations/connectors/source-relational-db/src/main/java/io/airbyte/integrations/source/relationaldb/state/StateManagerFactory.java +++ b/airbyte-integrations/connectors/source-relational-db/src/main/java/io/airbyte/integrations/source/relationaldb/state/StateManagerFactory.java @@ -31,18 +31,18 @@ private StateManagerFactory() {} * Creates a {@link StateManager} based on the provided state object and catalog. This method will handle the * conversion of the provided state to match the requested state manager based on the provided {@link AirbyteStateType}. * - * @param state The deserialized state. + * @param initialState The deserialized initial state that will be provided to the selected {@link StateManager}. * @param catalog The {@link ConfiguredAirbyteCatalog} for the connector that will utilize the state * manager. * @param stateTypeSupplier {@link Supplier} that provides the {@link AirbyteStateType} that will be * used to select the correct state manager. * @return A newly created {@link StateManager} implementation based on the provided state. */ - public static StateManager createStateManager(final List state, + public static StateManager createStateManager(final List initialState, final ConfiguredAirbyteCatalog catalog, final Supplier stateTypeSupplier) { - if (state != null && !state.isEmpty()) { - final AirbyteStateMessage airbyteStateMessage = state.get(0); + if (initialState != null && !initialState.isEmpty()) { + final AirbyteStateMessage airbyteStateMessage = initialState.get(0); switch (stateTypeSupplier.get()) { case LEGACY: LOGGER.info("Legacy state manager selected to manage state object with type {}.", airbyteStateMessage.getStateType()); @@ -53,7 +53,7 @@ public static StateManager createStateManager(final List st case STREAM: default: LOGGER.info("Stream state manager selected to manage state object with type {}.", airbyteStateMessage.getStateType()); - return new StreamStateManager(generateStreamState(state), catalog); + return new StreamStateManager(generateStreamState(initialState), catalog); } } else { throw new IllegalArgumentException("Failed to create state manager due to empty state list.");