diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 248e787b0..626ed4c60 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: needs: Get-CI-Image-Tag strategy: matrix: - java: [11, 17] + java: [21] os: [ ubuntu-latest ] name: Build and Test security-analytics with JDK ${{ matrix.java }} on ${{ matrix.os }} runs-on: ${{ matrix.os }} @@ -73,7 +73,7 @@ jobs: WORKING_DIR: ${{ matrix.working_directory }}. strategy: matrix: - java: [11, 17] + java: [21] os: [ windows-latest, macos-latest ] include: - os: windows-latest diff --git a/.github/workflows/multi-node-test-workflow.yml b/.github/workflows/multi-node-test-workflow.yml index 6bc731ae0..c0760c0b4 100644 --- a/.github/workflows/multi-node-test-workflow.yml +++ b/.github/workflows/multi-node-test-workflow.yml @@ -19,7 +19,7 @@ jobs: needs: Get-CI-Image-Tag strategy: matrix: - java: [ 11, 17, 21 ] + java: [ 21 ] # Job name name: Build and test Security Analytics on linux # This job runs on Linux diff --git a/.github/workflows/security-test-workflow.yml b/.github/workflows/security-test-workflow.yml index ffd91de13..f7b6fd09f 100644 --- a/.github/workflows/security-test-workflow.yml +++ b/.github/workflows/security-test-workflow.yml @@ -15,7 +15,7 @@ jobs: build: strategy: matrix: - java: [ 11, 17, 21 ] + java: [ 21 ] # Job name name: Build and test SecurityAnalytics # This job runs on Linux diff --git a/src/main/java/org/opensearch/securityanalytics/correlation/index/codec/CorrelationCodecVersion.java b/src/main/java/org/opensearch/securityanalytics/correlation/index/codec/CorrelationCodecVersion.java index c6ffd8551..7f4c84eb9 100644 --- a/src/main/java/org/opensearch/securityanalytics/correlation/index/codec/CorrelationCodecVersion.java +++ b/src/main/java/org/opensearch/securityanalytics/correlation/index/codec/CorrelationCodecVersion.java @@ -4,11 +4,13 @@ */ package org.opensearch.securityanalytics.correlation.index.codec; +import org.apache.lucene.backward_codecs.lucene99.Lucene99Codec; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.codecs.lucene99.Lucene99Codec; +import org.apache.lucene.codecs.lucene912.Lucene912Codec; import org.apache.lucene.backward_codecs.lucene95.Lucene95Codec; import org.apache.lucene.codecs.perfield.PerFieldKnnVectorsFormat; import org.opensearch.index.mapper.MapperService; +import org.opensearch.securityanalytics.correlation.index.codec.correlation9120.CorrelationCodec9120; import org.opensearch.securityanalytics.correlation.index.codec.correlation950.CorrelationCodec950; import org.opensearch.securityanalytics.correlation.index.codec.correlation990.CorrelationCodec990; import org.opensearch.securityanalytics.correlation.index.codec.correlation990.PerFieldCorrelationVectorsFormat990; @@ -32,9 +34,16 @@ public enum CorrelationCodecVersion { new PerFieldCorrelationVectorsFormat990(Optional.empty()), (userCodec, mapperService) -> new CorrelationCodec990(userCodec, new PerFieldCorrelationVectorsFormat990(Optional.of(mapperService))), CorrelationCodec990::new + ), + V_9_12_0( + "CorrelationCodec9120", + new Lucene912Codec(), + new PerFieldCorrelationVectorsFormat990(Optional.empty()), + (userCodec, mapperService) -> new CorrelationCodec9120(userCodec, new PerFieldCorrelationVectorsFormat990(Optional.of(mapperService))), + CorrelationCodec9120::new ); - private static final CorrelationCodecVersion CURRENT = V_9_9_0; + private static final CorrelationCodecVersion CURRENT = V_9_12_0; private final String codecName; private final Codec defaultCodecDelegate; private final PerFieldKnnVectorsFormat perFieldKnnVectorsFormat; diff --git a/src/main/java/org/opensearch/securityanalytics/correlation/index/codec/correlation9120/CorrelationCodec9120.java b/src/main/java/org/opensearch/securityanalytics/correlation/index/codec/correlation9120/CorrelationCodec9120.java new file mode 100644 index 000000000..1aa6e6824 --- /dev/null +++ b/src/main/java/org/opensearch/securityanalytics/correlation/index/codec/correlation9120/CorrelationCodec9120.java @@ -0,0 +1,30 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ +package org.opensearch.securityanalytics.correlation.index.codec.correlation9120; + +import org.apache.lucene.codecs.Codec; +import org.apache.lucene.codecs.FilterCodec; +import org.apache.lucene.codecs.KnnVectorsFormat; +import org.apache.lucene.codecs.perfield.PerFieldKnnVectorsFormat; +import org.opensearch.securityanalytics.correlation.index.codec.CorrelationCodecVersion; + +public class CorrelationCodec9120 extends FilterCodec { + private static final CorrelationCodecVersion VERSION = CorrelationCodecVersion.V_9_12_0; + private final PerFieldKnnVectorsFormat perFieldCorrelationVectorsFormat; + + public CorrelationCodec9120() { + this(VERSION.getDefaultCodecDelegate(), VERSION.getPerFieldCorrelationVectorsFormat()); + } + + public CorrelationCodec9120(Codec delegate, PerFieldKnnVectorsFormat perFieldCorrelationVectorsFormat) { + super(VERSION.getCodecName(), delegate); + this.perFieldCorrelationVectorsFormat = perFieldCorrelationVectorsFormat; + } + + @Override + public KnnVectorsFormat knnVectorsFormat() { + return perFieldCorrelationVectorsFormat; + } +} \ No newline at end of file diff --git a/src/main/resources/META-INF/services/org.apache.lucene.codecs.Codec b/src/main/resources/META-INF/services/org.apache.lucene.codecs.Codec index e4a14ac56..f196c4a5a 100644 --- a/src/main/resources/META-INF/services/org.apache.lucene.codecs.Codec +++ b/src/main/resources/META-INF/services/org.apache.lucene.codecs.Codec @@ -1,2 +1,3 @@ org.opensearch.securityanalytics.correlation.index.codec.correlation950.CorrelationCodec950 -org.opensearch.securityanalytics.correlation.index.codec.correlation990.CorrelationCodec990 \ No newline at end of file +org.opensearch.securityanalytics.correlation.index.codec.correlation990.CorrelationCodec990 +org.opensearch.securityanalytics.correlation.index.codec.correlation9120.CorrelationCodec9120 \ No newline at end of file