-
Notifications
You must be signed in to change notification settings - Fork 369
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LC-195: Introduce an 8.0 Compatibility Setting to Streamline Future M…
…igrations (#1172) ome customers are onboarding on 7.0 which will bring changes to the KCQL statement. For 8.0 there will be a new property to address faster seeks on the source. By incorporating this property now, users can seamlessly integrate it into their workflows, preempting the need for a subsequent migration to the upcoming version 8.0. Co-authored-by: stheppi <[email protected]>
- Loading branch information
Showing
3 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
...scala/io/lenses/streamreactor/connect/cloud/common/config/kcqlprops/KeyNamerVersion.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright 2017-2024 Lenses.io Ltd | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.lenses.streamreactor.connect.cloud.common.config.kcqlprops | ||
|
||
import enumeratum.Enum | ||
import enumeratum.EnumEntry | ||
import io.lenses.streamreactor.connect.cloud.common.config.kcqlprops.PropsKeyEnum.KeyNameFormatVersion | ||
import io.lenses.streamreactor.connect.config.kcqlprops.KcqlProperties | ||
|
||
sealed trait KeyNamerVersion extends EnumEntry | ||
|
||
object KeyNamerVersion extends Enum[KeyNamerVersion] { | ||
|
||
case object V0 extends KeyNamerVersion | ||
|
||
case object V1 extends KeyNamerVersion | ||
|
||
def apply( | ||
props: KcqlProperties[PropsKeyEntry, PropsKeyEnum.type], | ||
default: KeyNamerVersion, | ||
): KeyNamerVersion = fromProps(props).getOrElse(default) | ||
|
||
private def fromProps(props: KcqlProperties[PropsKeyEntry, PropsKeyEnum.type]): Option[KeyNamerVersion] = | ||
props.getOptionalInt(KeyNameFormatVersion).collect { | ||
case 0 => V0 | ||
case 1 => V1 | ||
} | ||
|
||
override def values: IndexedSeq[KeyNamerVersion] = findValues | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters