Skip to content

Commit

Permalink
remove pulsar-client-schema (apache#3184)
Browse files Browse the repository at this point in the history
* remove pulsar-client-schema

* shade avro dependencies in pulsar-client-kafka-shaded

* refactor api to separate module

* adding schema back

* cleaning up

* fix license issue

* fixing licenses

* cleaning up

* adding back lombok

* cleaning up
  • Loading branch information
jerrypeng authored and merlimat committed Dec 14, 2018
1 parent 23a6622 commit 5dd4b6e
Show file tree
Hide file tree
Showing 71 changed files with 269 additions and 330 deletions.
1 change: 1 addition & 0 deletions distribution/server/src/assemble/LICENSE.bin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ The Apache Software License, Version 2.0
- net.jodah-typetools-0.5.0.jar
* Apache Avro
- org.apache.avro-avro-1.8.2.jar
- org.apache.avro-avro-protobuf-1.8.2.jar
* Apache Curator
- org.apache.curator-curator-client-4.0.1.jar
- org.apache.curator-curator-framework-4.0.1.jar
Expand Down
5 changes: 0 additions & 5 deletions examples/flink-consumer-source/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@
<artifactId>flink-streaming-java_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
</dependency>
<dependency>
<groupId>org.apache.pulsar</groupId>
<artifactId>pulsar-client-schema</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.pulsar</groupId>
<artifactId>pulsar-flink</artifactId>
Expand Down
4 changes: 3 additions & 1 deletion managed-ledger-shaded/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@

<artifactSet>
<includes>
<include>org.apache.pulsar:pulsar-functions-proto</include>
<include>org.apache.pulsar:pulsar-client-original</include>
<include>org.apache.pulsar:pulsar-client-admin-original</include>
<include>org.apache.pulsar:managed-ledger-original</include>
Expand Down Expand Up @@ -130,6 +129,9 @@
<relocation>
<pattern>com.google</pattern>
<shadedPattern>org.apache.pulsar.shade.com.google</shadedPattern>
<excludes>
<exclude>com.google.protobuf.*</exclude>
</excludes>
</relocation>
<relocation>
<pattern>com.fasterxml.jackson</pattern>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ flexible messaging model and an intuitive client API.</description>
<module>pulsar-broker-common</module>
<module>pulsar-broker</module>
<module>pulsar-broker-shaded</module>
<module>pulsar-client-api</module>
<module>pulsar-client</module>
<module>pulsar-client-shaded</module>
<module>pulsar-client-schema</module>
<module>pulsar-client-admin</module>
<module>pulsar-client-admin-shaded</module>
<module>pulsar-client-tools</module>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@
import org.apache.pulsar.broker.service.Topic;
import org.apache.pulsar.broker.service.schema.SchemaCompatibilityStrategy;
import org.apache.pulsar.client.api.Producer;
import org.apache.pulsar.client.api.PulsarClient;
import org.apache.pulsar.client.api.PulsarClientException;
import org.apache.pulsar.client.api.Schema;
import org.apache.pulsar.common.naming.TopicName;
import org.apache.pulsar.common.policies.data.ClusterData;
import org.apache.pulsar.common.policies.data.TenantInfo;
import org.apache.pulsar.common.policies.data.SchemaAutoUpdateCompatibilityStrategy;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Ignore;
import org.testng.annotations.Test;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import java.util.concurrent.TimeUnit;

import org.apache.bookkeeper.mledger.AsyncCallbacks.DeleteCursorCallback;
import org.apache.bookkeeper.mledger.AsyncCallbacks.ReadEntriesCallback;
import org.apache.bookkeeper.mledger.Entry;
import org.apache.bookkeeper.mledger.ManagedCursor;
import org.apache.bookkeeper.mledger.ManagedLedgerException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,12 @@

import java.io.IOException;
import java.util.Collections;
import java.util.Date;
import java.util.Map;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import org.apache.pulsar.client.api.Producer;
import org.apache.pulsar.client.api.PulsarClient;
import org.apache.pulsar.client.api.Schema;
import org.apache.pulsar.client.api.SchemaSerializationException;
import org.apache.pulsar.client.impl.schema.JSONSchema;
Expand Down
4 changes: 3 additions & 1 deletion pulsar-client-admin-shaded/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@

<artifactSet>
<includes>
<include>org.apache.pulsar:pulsar-functions-proto</include>
<include>org.apache.pulsar:pulsar-client-original</include>
<include>org.apache.pulsar:pulsar-client-admin-original</include>
<include>org.apache.commons:commons-lang3</include>
Expand Down Expand Up @@ -118,6 +117,9 @@
<relocation>
<pattern>com.google</pattern>
<shadedPattern>org.apache.pulsar.shade.com.google</shadedPattern>
<excludes>
<exclude>com.google.protobuf.*</exclude>
</excludes>
</relocation>
<relocation>
<pattern>com.fasterxml.jackson</pattern>
Expand Down
6 changes: 0 additions & 6 deletions pulsar-client-admin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,6 @@
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>pulsar-functions-proto</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
* Admin interface for worker stats management.
*/
public interface Worker {


/**
* Get all functions stats on a worker
* @return
* @throws PulsarAdminException
* @throws PulsarAdminException
*/
List<WorkerFunctionInstanceStats> getFunctionsStats() throws PulsarAdminException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.google.protobuf.AbstractMessage.Builder;
import com.google.protobuf.util.JsonFormat;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.pulsar.client.admin.Functions;
Expand Down Expand Up @@ -373,9 +371,4 @@ public FunctionState getFunctionState(String tenant, String namespace, String fu
throw getApiException(e);
}
}


public static void mergeJson(String json, Builder builder) throws IOException {
JsonFormat.parser().merge(json, builder);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;

import javax.ws.rs.ClientErrorException;
import javax.ws.rs.ServerErrorException;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.InvocationCallback;
import javax.ws.rs.client.WebTarget;
Expand Down Expand Up @@ -77,8 +74,6 @@
import org.apache.pulsar.common.policies.data.PartitionedTopicStats;
import org.apache.pulsar.common.policies.data.PersistentTopicInternalStats;
import org.apache.pulsar.common.policies.data.TopicStats;
import org.apache.pulsar.common.policies.data.PersistentTopicStats;
import org.apache.pulsar.common.policies.data.BacklogQuota.BacklogQuotaType;
import org.apache.pulsar.common.util.Codec;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down
35 changes: 35 additions & 0 deletions pulsar-client-api/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!--
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.
-->
<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>org.apache.pulsar</groupId>
<artifactId>pulsar</artifactId>
<version>2.3.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

<artifactId>pulsar-client-api</artifactId>
<name>Pulsar Client :: API</name>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ public class Field {
* The index of the field within the record.
*/
private final int index;

}
47 changes: 46 additions & 1 deletion pulsar-client-kafka-compat/pulsar-client-kafka-shaded/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
<include>org.apache.kafka:kafka-clients</include>
<include>org.apache.pulsar:pulsar-client-kafka-original</include>
<include>org.apache.pulsar:pulsar-client-original</include>
<include>org.apache.pulsar:pulsar-client-schema</include>
<include>org.apache.commons:commons-lang3</include>
<include>commons-codec:commons-codec</include>
<include>commons-collections:commons-collections</include>
Expand Down Expand Up @@ -97,6 +96,15 @@
<include>commons-*:*</include>
<include>org.yaml:snakeyaml</include>
<include>org.objenesis:*</include>

<include>org.apache.avro:*</include>
<!-- Avro transitive dependencies-->
<include>org.codehaus.jackson:jackson-core-asl</include>
<include>org.codehaus.jackson:jackson-mapper-asl</include>
<include>com.thoughtworks.paranamer:paranamer</include>
<include>org.xerial.snappy:snappy-java</include>
<include>org.apache.commons:commons-compress</include>
<include>org.tukaani:xz</include>
</includes>
</artifactSet>
<filters>
Expand Down Expand Up @@ -183,6 +191,43 @@
<pattern>org.yaml</pattern>
<shadedPattern>org.apache.pulsar.shade.org.yaml</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache.avro</pattern>
<shadedPattern>org.apache.pulsar.shade.org.apache.avro</shadedPattern>
<excludes>
<exclude>org.apache.avro.reflect.AvroAlias</exclude>
<exclude>org.apache.avro.reflect.AvroDefault</exclude>
<exclude>org.apache.avro.reflect.AvroEncode</exclude>
<exclude>org.apache.avro.reflect.AvroIgnore</exclude>
<exclude>org.apache.avro.reflect.AvroMeta</exclude>
<exclude>org.apache.avro.reflect.AvroName</exclude>
<exclude>org.apache.avro.reflect.AvroSchema</exclude>
<exclude>org.apache.avro.reflect.Nullable</exclude>
<exclude>org.apache.avro.reflect.Stringable</exclude>
<exclude>org.apache.avro.reflect.Union</exclude>
</excludes>
</relocation>
<!--Avro transitive dependencies-->
<relocation>
<pattern>org.codehaus.jackson</pattern>
<shadedPattern>org.apache.pulsar.shade.org.codehaus.jackson</shadedPattern>
</relocation>
<relocation>
<pattern>com.thoughtworks.paranamer</pattern>
<shadedPattern>org.apache.pulsar.shade.com.thoughtworks.paranamer</shadedPattern>
</relocation>
<relocation>
<pattern>org.xerial.snappy</pattern>
<shadedPattern>org.apache.pulsar.shade.org.xerial.snappy</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache.commons</pattern>
<shadedPattern>org.apache.pulsar.shade.org.apache.commons</shadedPattern>
</relocation>
<relocation>
<pattern>org.tukaani</pattern>
<shadedPattern>org.apache.pulsar.shade.org.tukaani</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import org.apache.pulsar.client.api.ProducerBuilder;
import org.apache.pulsar.client.api.PulsarClient;
import org.apache.pulsar.client.api.PulsarClientException;
import org.apache.pulsar.client.api.SchemaSerializationException;
import org.apache.pulsar.client.api.TypedMessageBuilder;
import org.apache.pulsar.client.impl.MessageIdImpl;
import org.apache.pulsar.client.impl.TypedMessageBuilderImpl;
Expand Down
Loading

0 comments on commit 5dd4b6e

Please sign in to comment.