servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject [servicemix-bundles] branch master updated: [SM-4206] Create OSGi bundle for elasticsearch 7.4.1
Date Sat, 26 Oct 2019 06:15:43 GMT
This is an automated email from the ASF dual-hosted git repository.

jbonofre pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicemix-bundles.git


The following commit(s) were added to refs/heads/master by this push:
     new cc1a4c7  [SM-4206] Create OSGi bundle for elasticsearch 7.4.1
cc1a4c7 is described below

commit cc1a4c739ea22873406593928053413f8ef03a24
Author: Jean-Baptiste Onofré <jbonofre@apache.org>
AuthorDate: Sat Oct 26 08:15:14 2019 +0200

    [SM-4206] Create OSGi bundle for elasticsearch 7.4.1
---
 elasticsearch-7.4.1/pom.xml                        | 182 +++++++++++++++++++++
 .../org/elasticsearch/common/logging/Loggers.java  | 124 ++++++++++++++
 .../META-INF/org.apache.lucene.codecs.Codec        |   4 +
 .../org.apache.lucene.codecs.DocValuesFormat       |   3 +
 .../org.apache.lucene.codecs.PostingsFormat        |   1 +
 .../src/main/resources/OSGI-INF/bundle.info        |  17 ++
 pom.xml                                            |   1 +
 7 files changed, 332 insertions(+)

diff --git a/elasticsearch-7.4.1/pom.xml b/elasticsearch-7.4.1/pom.xml
new file mode 100644
index 0000000..ba92445
--- /dev/null
+++ b/elasticsearch-7.4.1/pom.xml
@@ -0,0 +1,182 @@
+<?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">
+
+    <!--
+
+        Licensed to the Apache Software Foundation (ASF) under one or more
+        contributor license agreements.  See the NOTICE file distributed with
+        this work for additional information regarding copyright ownership.
+        The ASF licenses this file to You 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.
+    -->
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.servicemix.bundles</groupId>
+        <artifactId>bundles-pom</artifactId>
+        <version>14</version>
+        <relativePath>../bundles-pom/pom.xml</relativePath>
+    </parent>
+
+    <groupId>org.apache.servicemix.bundles</groupId>
+    <artifactId>org.apache.servicemix.bundles.elasticsearch</artifactId>
+    <version>7.4.1_1-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+    <name>Apache ServiceMix :: Bundles :: ${pkgArtifactId}</name>
+    <description>This OSGi bundle wraps ${pkgArtifactId} ${pkgVersion} jar file.</description>
+
+    <scm>
+        <connection>scm:git:https://gitbox.apache.org/repos/asf/servicemix-bundles.git</connection>
+        <developerConnection>scm:git:https://gitbox.apache.org/repos/asf/servicemix-bundles.git</developerConnection>
+        <url>https://gitbox.apache.org/repos/asf?p=servicemix-bundles.git</url>
+  </scm>
+
+    <properties>
+        <pkgGroupId>org.elasticsearch</pkgGroupId>
+        <pkgArtifactId>elasticsearch</pkgArtifactId>
+        <pkgVersion>7.4.1</pkgVersion>
+        <servicemix.osgi.export>
+            !org.elasticsearch.client*,
+            org.elasticsearch*;version="${pkgVersion}";-split-package:=merge-first
+        </servicemix.osgi.export>
+        <servicemix.osgi.import.pkg>
+            !org.elasticsearch*,
+            !org.joda.time,
+            !org.joda.convert,
+            !org.noggit,
+            !org.locationtech.spatial4j*,
+            !com.vividsolutions.jts.geom,
+            !org.apache.lucene*,
+            !com.carrotsearch.randomizedtesting,
+            com.google.common.collect;resolution:=optional,
+            com.google.common.geometry;resolution:=optional,
+            com.fasterxml.jackson.core;version="[2.8,4)",
+            com.fasterxml.jackson.dataformat.yaml;version="[2.8,4)",
+            com.fasterxml.jackson.dataformat.smile;version="[2.8,4)",
+            com.sun.jna*;resolution:=optional,
+            com.sun.management;resolution:=optional,
+            com.ning.compress.lzf.util,
+            org.apache.logging.log4j*;version="[2.8,4)",
+            org.locationtech.jts.geom;resolution:=optional,
+            *
+        </servicemix.osgi.import.pkg>
+        <servicemix.osgi.private.pkg>
+            org.joda.time*;-split-package:=merge-first,
+            org.joda.convert*,
+            org.noggit,
+            org.apache.lucene*;-split-package:=merge-first,
+            org.tartarus.snowball*,
+            com.tdunning.math.stats,
+            com.vividsolutions.jts.geom,
+            com.carrotsearch.hppc*,
+            com.carrotsearch.randomizedtesting,
+            joptsimple*,
+            org.HdrHistogram,
+            org.locationtech.spatial4j*,
+            !META-INF.services.org.apache.lucene.codecs.Codec,
+            META-INF.services.*;-split-package:=merge-first
+        </servicemix.osgi.private.pkg>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>${pkgGroupId}</groupId>
+            <artifactId>${pkgArtifactId}</artifactId>
+            <version>${pkgVersion}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.elasticsearch.plugin</groupId>
+            <artifactId>transport-netty4-client</artifactId>
+            <version>${pkgVersion}</version>
+        </dependency>
+        <dependency>
+             <groupId>org.apache.logging.log4j</groupId>
+             <artifactId>log4j-core</artifactId>
+             <version>2.9.1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.lucene</groupId>
+            <artifactId>lucene-backward-codecs</artifactId>
+            <version>8.1.0</version>
+        </dependency>
+
+        <!-- sources -->
+        <dependency>
+            <groupId>${pkgGroupId}</groupId>
+            <artifactId>${pkgArtifactId}</artifactId>
+            <version>${pkgVersion}</version>
+            <classifier>sources</classifier>
+        </dependency>
+        <dependency>
+            <groupId>org.elasticsearch.plugin</groupId>
+            <artifactId>transport-netty4-client</artifactId>
+            <version>${pkgVersion}</version>
+            <classifier>sources</classifier>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-shade-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>shade</goal>
+                        </goals>
+                        <configuration>
+                            <artifactSet>
+                                <includes>
+                                    <include>${pkgGroupId}:${pkgArtifactId}</include>
+				    <include>org.elasticsearch.plugin:transport-netty4client</include>
+                                    <include>org.apache.lucene:*</include>
+                                </includes>
+                            </artifactSet>
+                            <filters>
+                                <filter>
+                                    <artifact>${pkgGroupId}:${pkgArtifactId}</artifact>
+                                    <includes>
+                                        <include>config/**</include>
+                                        <include>META-INF/services/**</include>
+                                        <include>plugins.txt</include>
+                                    </includes>
+                                </filter>
+                                <filter>
+                                    <artifact>org.apache.lucene:*</artifact>
+                                    <includes>
+                                        <include>META-INF/services/**</include>
+                                    </includes>
+                                </filter>
+                            </filters>
+                            <transformers>
+                                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"
/>
+                            </transformers>
+                            <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
+                            <createDependencyReducedPom>true</createDependencyReducedPom>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+              <groupId>org.apache.maven.plugins</groupId>
+              <artifactId>maven-compiler-plugin</artifactId>
+              <configuration>
+                <source>1.8</source>
+                <target>1.8</target>
+              </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
diff --git a/elasticsearch-7.4.1/src/main/java/org/elasticsearch/common/logging/Loggers.java
b/elasticsearch-7.4.1/src/main/java/org/elasticsearch/common/logging/Loggers.java
new file mode 100644
index 0000000..282beae
--- /dev/null
+++ b/elasticsearch-7.4.1/src/main/java/org/elasticsearch/common/logging/Loggers.java
@@ -0,0 +1,124 @@
+/*
+ * Licensed to Elasticsearch under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch licenses this file to you 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 org.elasticsearch.common.logging;
+
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.core.Appender;
+import org.elasticsearch.common.settings.Setting;
+import org.elasticsearch.index.Index;
+import org.elasticsearch.index.shard.ShardId;
+
+import static org.elasticsearch.common.util.CollectionUtils.asArrayList;
+
+/**
+ * A set of utilities around Logging.
+ */
+public class Loggers {
+
+    public static final String SPACE = " ";
+
+    public static final Setting<Level> LOG_DEFAULT_LEVEL_SETTING =
+            new Setting<>("logger.level", Level.INFO.name(), Level::valueOf, Setting.Property.NodeScope);
+    public static final Setting.AffixSetting<Level> LOG_LEVEL_SETTING =
+            Setting.prefixKeySetting("logger.", (key) -> new Setting<>(key, Level.INFO.name(),
Level::valueOf, Setting.Property.Dynamic,
+                    Setting.Property.NodeScope));
+
+    public static Logger getLogger(Class<?> clazz, ShardId shardId, String... prefixes)
{
+        return getLogger(clazz, shardId.getIndex(), asArrayList(Integer.toString(shardId.id()),
prefixes).toArray(new String[0]));
+    }
+
+    /**
+     * Just like {@link #getLogger(Class, ShardId, String...)} but String loggerName instead
of
+     * Class and no extra prefixes.
+     */
+    public static Logger getLogger(String loggerName, ShardId shardId) {
+        String prefix = formatPrefix(shardId.getIndexName(), Integer.toString(shardId.id()));
+        return new PrefixLogger(LogManager.getLogger(loggerName), prefix);
+    }
+
+    public static Logger getLogger(Class<?> clazz, Index index, String... prefixes)
{
+        return getLogger(clazz, asArrayList(Loggers.SPACE, index.getName(), prefixes).toArray(new
String[0]));
+    }
+
+    public static Logger getLogger(Class<?> clazz, String... prefixes) {
+        return new PrefixLogger(LogManager.getLogger(clazz), formatPrefix(prefixes));
+    }
+
+    public static Logger getLogger(Logger parentLogger, String s) {
+        Logger inner = LogManager.getLogger(parentLogger.getName() + s);
+        if (parentLogger instanceof PrefixLogger) {
+            return new PrefixLogger(inner, ((PrefixLogger)parentLogger).prefix());
+        }
+        return inner;
+    }
+
+    private static String formatPrefix(String... prefixes) {
+        String prefix = null;
+        if (prefixes != null && prefixes.length > 0) {
+            StringBuilder sb = new StringBuilder();
+            for (String prefixX : prefixes) {
+                if (prefixX != null) {
+                    if (prefixX.equals(SPACE)) {
+                        sb.append(" ");
+                    } else {
+                        sb.append("[").append(prefixX).append("]");
+                    }
+                }
+            }
+            if (sb.length() > 0) {
+                prefix = sb.toString();
+            }
+        }
+        return prefix;
+    }
+
+    /**
+     * Set the level of the logger. If the new level is null, the logger will inherit it's
level from its nearest ancestor with a non-null
+     * level.
+     */
+    public static void setLevel(Logger logger, String level) {
+        final Level l;
+        if (level == null) {
+            l = null;
+        } else {
+            l = Level.valueOf(level);
+        }
+        setLevel(logger, l);
+    }
+
+    public static void setLevel(Logger logger, Level level) {
+        // nothing to do
+    }
+
+    public static void addAppender(final Logger logger, final Appender appender) {
+        // nothing to do
+    }
+
+    public static void removeAppender(final Logger logger, final Appender appender) {
+        // nothing to do
+    }
+
+    public static Appender findAppender(final Logger logger, final Class<? extends Appender>
clazz) {
+        // nothing to do
+        return null;
+    }
+
+}
\ No newline at end of file
diff --git a/elasticsearch-7.4.1/src/main/resources/META-INF/org.apache.lucene.codecs.Codec
b/elasticsearch-7.4.1/src/main/resources/META-INF/org.apache.lucene.codecs.Codec
new file mode 100644
index 0000000..505f1c8
--- /dev/null
+++ b/elasticsearch-7.4.1/src/main/resources/META-INF/org.apache.lucene.codecs.Codec
@@ -0,0 +1,4 @@
+org.apache.lucene.codecs.lucene60.Lucene60Codec
+org.apache.lucene.codecs.lucene62.Lucene62Codec
+org.apache.lucene.codecs.lucene70.Lucene70Codec
+org.apache.lucene.codecs.lucene80.Lucene80Codec
diff --git a/elasticsearch-7.4.1/src/main/resources/META-INF/org.apache.lucene.codecs.DocValuesFormat
b/elasticsearch-7.4.1/src/main/resources/META-INF/org.apache.lucene.codecs.DocValuesFormat
new file mode 100644
index 0000000..53cebe2
--- /dev/null
+++ b/elasticsearch-7.4.1/src/main/resources/META-INF/org.apache.lucene.codecs.DocValuesFormat
@@ -0,0 +1,3 @@
+org.apache.lucene.codecs.lucene54.Lucene54DocValuesFormat
+org.apache.lucene.codecs.lucene70.Lucene70DocValuesFormat
+org.apache.lucene.codecs.lucene80.Lucene80DocValuesFormat
diff --git a/elasticsearch-7.4.1/src/main/resources/META-INF/org.apache.lucene.codecs.PostingsFormat
b/elasticsearch-7.4.1/src/main/resources/META-INF/org.apache.lucene.codecs.PostingsFormat
new file mode 100644
index 0000000..3b5682a
--- /dev/null
+++ b/elasticsearch-7.4.1/src/main/resources/META-INF/org.apache.lucene.codecs.PostingsFormat
@@ -0,0 +1 @@
+org.apache.lucene.codecs.lucene50.Lucene50PostingsFormat
diff --git a/elasticsearch-7.4.1/src/main/resources/OSGI-INF/bundle.info b/elasticsearch-7.4.1/src/main/resources/OSGI-INF/bundle.info
new file mode 100644
index 0000000..af11bfd
--- /dev/null
+++ b/elasticsearch-7.4.1/src/main/resources/OSGI-INF/bundle.info
@@ -0,0 +1,17 @@
+\u001B[1mSYNOPSIS\u001B[0m
+    ${project.description}
+
+    Original Maven URL:
+        \u001B[33mmvn:${pkgGroupId}/${pkgArtifactId}/${pkgVersion}\u001B[0m
+
+\u001B[1mDESCRIPTION\u001B[0m
+    So, we build a web site or an application and want to add search to it, and
+    then it hits us: getting search working is hard. We want our search solution
+    to be fast, we want a painless setup and a completely free search schema, we
+    want to be able to index data simply using JSON over HTTP, we want our search
+    server to be always available, we want to be able to start with one machine
+    and scale to hundreds, we want real-time search, we want simple multi-tenancy,
+    and we want a solution that is built for the cloud.
+
+\u001B[1mSEE ALSO\u001B[0m
+    \u001B[36mhttp://www.elasticsearch.org\u001B[0m
diff --git a/pom.xml b/pom.xml
index 284472d..9caf171 100644
--- a/pom.xml
+++ b/pom.xml
@@ -61,6 +61,7 @@
        <module>okio-2.4.1</module>
        <module>mybatis-3.5.3</module>
        <module>neo4j-3.5.12</module>
+       <module>elasticsearch-7.4.1</module>
     </modules>
 
 </project>


Mime
View raw message