Skip to content

Commit

Permalink
Rename parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
jdpgrailsdev committed Jun 15, 2022
1 parent 566baee commit 39b6691
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<AirbyteStateMessage> state,
public static StateManager createStateManager(final List<AirbyteStateMessage> initialState,
final ConfiguredAirbyteCatalog catalog,
final Supplier<AirbyteStateType> 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());
Expand All @@ -53,7 +53,7 @@ public static StateManager createStateManager(final List<AirbyteStateMessage> 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.");
Expand Down

0 comments on commit 39b6691

Please sign in to comment.