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

LC-519: move OpenSearchIndexer to be its own plugin. #152

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ public static Indexer fromConfig(Config config, IndexerMessenger messenger, bool
// handle type class instantiation or throw exception for unknown type
if (typeName.equalsIgnoreCase("Solr")) {
return new SolrIndexer(config, messenger, bypass, metricsPrefix);
} else if (typeName.equalsIgnoreCase("OpenSearch")) {
return new OpenSearchIndexer(config, messenger, bypass, metricsPrefix);
} else if (typeName.equalsIgnoreCase("Elasticsearch")) {
return new ElasticsearchIndexer(config, messenger, bypass, metricsPrefix);
} else if (typeName.equalsIgnoreCase("CSV")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,6 @@ public void testFromInvalidTypeConfig() throws Exception {
Assert.assertTrue(exception.getMessage().contains("Unknown indexer.type configuration of:"));
}

@Test
public void testFromValidTypeConfigOpen() throws Exception {
TestMessenger messenger = new TestMessenger();
Config config = ConfigFactory.load("IndexerFactoryTest/config_valid_type_open.conf");
Indexer indexer = IndexerFactory.fromConfig(config, messenger, true, "testing");
Assert.assertTrue(indexer instanceof OpenSearchIndexer);
}

@Test
public void testFromValidTypeConfigElastic() throws Exception {
TestMessenger messenger = new TestMessenger();
Expand Down

This file was deleted.

63 changes: 63 additions & 0 deletions lucille-plugins/lucille-opensearch/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.kmwllc</groupId>
<artifactId>lucille-plugins</artifactId>
<version>0.2.4-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>lucille-opensearch</artifactId>
<packaging>jar</packaging>
<name>Lucille Plugins: Lucille OpenSearch</name>

<dependencies>
<dependency>
<groupId>com.kmwllc</groupId>
<artifactId>lucille-core</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.4.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<finalName>${project.artifactId}-plugin</finalName>
<createDependencyReducedPom>false</createDependencyReducedPom>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/LICENSE</exclude>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
<exclude>log4j2.properties</exclude>
</excludes>
</filter>
</filters>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package com.kmwllc.lucille.indexer;
package com.kmwllc.lucille.opensearch.indexer;

import com.kmwllc.lucille.core.Document;
import com.kmwllc.lucille.core.Indexer;
import com.kmwllc.lucille.core.IndexerException;
import com.kmwllc.lucille.core.KafkaDocument;
import com.kmwllc.lucille.message.IndexerMessenger;
import com.kmwllc.lucille.message.KafkaIndexerMessenger;
import com.kmwllc.lucille.util.OpenSearchUtils;
import com.kmwllc.lucille.opensearch.util.OpenSearchUtils;
import com.typesafe.config.Config;
import com.typesafe.config.ConfigFactory;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand All @@ -20,7 +18,6 @@
import org.opensearch.client.opensearch.core.bulk.BulkResponseItem;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import sun.misc.Signal;


public class OpenSearchIndexer extends Indexer {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.kmwllc.lucille.util;
package com.kmwllc.lucille.opensearch.util;

import com.kmwllc.lucille.indexer.OpenSearchIndexer;
import com.kmwllc.lucille.opensearch.indexer.OpenSearchIndexer;
import com.typesafe.config.Config;
import java.net.URI;
import java.security.KeyManagementException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.kmwllc.lucille.indexer;
package com.kmwllc.lucille.opensearch.indexer;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThrows;
Expand Down
1 change: 1 addition & 0 deletions lucille-plugins/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<module>lucille-parquet</module>
<module>lucille-tika</module>
<module>lucille-ocr</module>
<module>lucille-opensearch</module>
</modules>

<dependencies>
Expand Down
Loading