Skip to content

Commit

Permalink
Move pulsar functions dependency version to root pom and remove dupli…
Browse files Browse the repository at this point in the history
…cated license headers (#1324)



This addresses some comments in pulsar functions PR #1314
  • Loading branch information
sijie committed Mar 5, 2018
1 parent fb97446 commit 585ea13
Show file tree
Hide file tree
Showing 20 changed files with 55 additions and 525 deletions.
37 changes: 37 additions & 0 deletions pom.xml
Expand Up @@ -129,6 +129,12 @@ flexible messaging model and an intuitive client API.</description>
<jackson.version>2.8.4</jackson.version>
<puppycrawl.checkstyle.version>6.19</puppycrawl.checkstyle.version>
<dockerfile-maven.version>1.3.7</dockerfile-maven.version>
<typetools.version>0.5.0</typetools.version>
<protobuf3.version>3.5.1</protobuf3.version>
<grpc.version>1.5.0</grpc.version>
<protoc-gen-grpc-java.version>1.0.0</protoc-gen-grpc-java.version>
<gson.version>2.8.2</gson.version>
<sketches.version>0.6.0</sketches.version>

<!-- test dependencies -->
<disruptor.version>3.4.0</disruptor.version>
Expand Down Expand Up @@ -619,6 +625,37 @@ flexible messaging model and an intuitive client API.</description>
<version>${bouncycastle.version}</version>
</dependency>

<dependency>
<groupId>net.jodah</groupId>
<artifactId>typetools</artifactId>
<version>${typetools.version}</version>
</dependency>

<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-all</artifactId>
<version>${grpc.version}</version>
</dependency>

<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>${gson.version}</version>
</dependency>

<dependency>
<groupId>com.yahoo.datasketches</groupId>
<artifactId>sketches-core</artifactId>
<version>${sketches.version}</version>
</dependency>

<!-- use shaded dependency util pulsar bump zookeeper version to 3.5 -->
<dependency>
<groupId>org.apache.distributedlog</groupId>
<artifactId>distributedlog-core-shaded</artifactId>
<version>${bookkeeper.version}</version>
</dependency>

<!-- test dependencies -->
<dependency>
<groupId>com.lmax</groupId>
Expand Down
1 change: 0 additions & 1 deletion pulsar-client/pom.xml
Expand Up @@ -62,7 +62,6 @@
<dependency>
<groupId>com.yahoo.datasketches</groupId>
<artifactId>sketches-core</artifactId>
<version>0.6.0 </version>
</dependency>

<dependency>
Expand Down
1 change: 0 additions & 1 deletion pulsar-functions/api-java/pom.xml
Expand Up @@ -40,7 +40,6 @@
<dependency>
<groupId>net.jodah</groupId>
<artifactId>typetools</artifactId>
<version>0.5.0</version>
<scope>test</scope>
</dependency>

Expand Down
6 changes: 0 additions & 6 deletions pulsar-functions/cli/pom.xml
Expand Up @@ -53,12 +53,6 @@
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>pulsar-client-tools-shaded</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
Expand Down
Expand Up @@ -451,7 +451,7 @@ void runCmd() throws Exception {
throw new RuntimeException("Missing arguments");
}

String serviceUrl = ((PulsarFunctionsAdmin) admin).getClientConf().getConfigurationData().getServiceUrl();
String serviceUrl = ((PulsarFunctionsAdmin) admin).getClientConf().getServiceUrl();
if (brokerServiceUrl != null) {
serviceUrl = brokerServiceUrl;
}
Expand Down
Expand Up @@ -28,6 +28,7 @@
import java.util.Arrays;
import java.util.Properties;
import org.apache.pulsar.client.api.ClientConfiguration;
import org.apache.pulsar.client.impl.conf.ClientConfigurationData;

/**
* TODO: merge this into {@link PulsarAdminTool}.
Expand Down Expand Up @@ -73,7 +74,7 @@ public static void main(String[] args) throws Exception {
isLocalRun = "localrun" == args[cmdPos].toLowerCase();
}

BiFunction<URL, ClientConfiguration, ? extends PulsarAdmin> adminFactory;
BiFunction<URL, ClientConfigurationData, ? extends PulsarAdmin> adminFactory;
if (isLocalRun) {
// bypass constructing admin client
adminFactory = (url, config) -> null;
Expand Down
Expand Up @@ -21,6 +21,7 @@
import org.apache.pulsar.client.admin.internal.FunctionsImpl;
import org.apache.pulsar.client.api.*;

import org.apache.pulsar.client.impl.conf.ClientConfigurationData;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -34,7 +35,7 @@ public class PulsarFunctionsAdmin extends PulsarAdmin {
private static final Logger LOG = LoggerFactory.getLogger(PulsarFunctionsAdmin.class);

private final Functions functions;
private final ClientConfiguration clientConf;
private final ClientConfigurationData clientConf;

/**
* Construct a new Pulsar Admin client object.
Expand All @@ -46,13 +47,13 @@ public class PulsarFunctionsAdmin extends PulsarAdmin {
* @param pulsarConfig
* the ClientConfiguration object to be used to talk with Pulsar
*/
public PulsarFunctionsAdmin(URL serviceUrl, ClientConfiguration pulsarConfig) throws PulsarClientException {
public PulsarFunctionsAdmin(URL serviceUrl, ClientConfigurationData pulsarConfig) throws PulsarClientException {
super(serviceUrl, pulsarConfig);
this.functions = new FunctionsImpl(web, auth);
this.clientConf = pulsarConfig;
}

public ClientConfiguration getClientConf() {
public ClientConfigurationData getClientConf() {
return clientConf;
}

Expand Down
Expand Up @@ -54,6 +54,7 @@
import org.apache.pulsar.client.admin.Functions;
import org.apache.pulsar.client.admin.PulsarFunctionsAdmin;
import org.apache.pulsar.client.api.ClientConfiguration;
import org.apache.pulsar.client.impl.conf.ClientConfigurationData;
import org.apache.pulsar.functions.api.Context;
import org.apache.pulsar.functions.api.PulsarFunction;
import org.apache.pulsar.functions.api.utils.DefaultSerDe;
Expand Down Expand Up @@ -104,7 +105,7 @@ public void setup() throws Exception {
this.functions = mock(Functions.class);
when(admin.functions()).thenReturn(functions);
when(admin.getServiceUrl()).thenReturn(URI.create("http://localhost:1234").toURL());
when(admin.getClientConf()).thenReturn(new ClientConfiguration());
when(admin.getClientConf()).thenReturn(new ClientConfigurationData());
this.cmd = new CmdFunctions(admin);

// mock reflections
Expand Down
139 changes: 6 additions & 133 deletions pulsar-functions/instance/pom.xml
Expand Up @@ -51,154 +51,22 @@
<artifactId>log4j-core</artifactId>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>pulsar-client-tools-shaded</artifactId>
<version>${project.version}</version>
<!-- exclude shaded dependencies to avoid conflicts -->
<exclusions>
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</exclusion>
<exclusion>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</exclusion>
<exclusion>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
</exclusion>
<exclusion>
<groupId>org.asynchttpclient</groupId>
<artifactId>async-http-client</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-codec-http</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</exclusion>
<exclusion>
<groupId>net.jpountz.lz4</groupId>
<artifactId>lz4</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcomponents-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcomponents-client</artifactId>
</exclusion>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
<exclusion>
<groupId>com.yahoo.datasketches</groupId>
<artifactId>sketches-core</artifactId>
</exclusion>
</exclusions>
</dependency>

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

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

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

<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
<version>${jackson.version}</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson.version}</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>

<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>${gson.version}</version>
</dependency>


<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>3.5.1</version>
</dependency>

<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-all</artifactId>
<version>1.5.0</version>
</dependency>

<!-- update this when bookkeeper produces a snapshot version -->
<dependency>
<groupId>org.apache.bookkeeper</groupId>
<artifactId>stream-storage-java-client</artifactId>
<version>0.6.0</version>
</dependency>

<dependency>
<groupId>net.jodah</groupId>
<artifactId>typetools</artifactId>
<version>0.5.0</version>
</dependency>

<dependency>
<groupId>com.yahoo.datasketches</groupId>
<artifactId>sketches-core</artifactId>
<version>0.6.0 </version>
</dependency>

<dependency>
Expand All @@ -211,6 +79,11 @@
<artifactId>jcommander</artifactId>
</dependency>

<dependency>
<groupId>net.jodah</groupId>
<artifactId>typetools</artifactId>
</dependency>

</dependencies>

<!-- current the stream storage artifacts are hosted at streamlio. will give rid of this once it is proposed to merge to bookkeeper -->
Expand Down
17 changes: 0 additions & 17 deletions pulsar-functions/instance/src/main/python/contextimpl.py
Expand Up @@ -20,23 +20,6 @@

# -*- encoding: utf-8 -*-

# 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.
#
"""contextimpl.py: ContextImpl class that implements the Context interface
"""

Expand Down
17 changes: 0 additions & 17 deletions pulsar-functions/instance/src/main/python/log.py
Expand Up @@ -20,23 +20,6 @@

# -*- encoding: utf-8 -*-

# 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.
#
''' log.py '''
import logging
from logging.handlers import RotatingFileHandler
Expand Down
17 changes: 0 additions & 17 deletions pulsar-functions/instance/src/main/python/python_instance.py
Expand Up @@ -20,23 +20,6 @@

# -*- encoding: utf-8 -*-

# 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.
#
"""python_instance.py: Python Instance for running python functions
"""
import os
Expand Down

0 comments on commit 585ea13

Please sign in to comment.