Skip to content

Commit

Permalink
update to lucene 9.12 (#1349)
Browse files Browse the repository at this point in the history
* update to lucene 9.12

Signed-off-by: Subhobrata Dey <[email protected]>

* update ci due to job-scheduler update

Signed-off-by: Subhobrata Dey <[email protected]>

---------

Signed-off-by: Subhobrata Dey <[email protected]>
(cherry picked from commit 5341174)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed Oct 16, 2024
1 parent 01d9011 commit a9d233e
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 7 deletions.
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

0 comments on commit a9d233e

Please sign in to comment.