Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 2.x] update to lucene 9.12 #1357

Merged
merged 1 commit into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/multi-node-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/security-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
}
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
org.opensearch.securityanalytics.correlation.index.codec.correlation950.CorrelationCodec950
org.opensearch.securityanalytics.correlation.index.codec.correlation990.CorrelationCodec990
org.opensearch.securityanalytics.correlation.index.codec.correlation990.CorrelationCodec990
org.opensearch.securityanalytics.correlation.index.codec.correlation9120.CorrelationCodec9120
Loading