Skip to content

Commit

Permalink
Relocate packages (apache#21)
Browse files Browse the repository at this point in the history
* Relocate instance and spawner to be under `runtime` package
* fix the pom files and travis build
  • Loading branch information
sijie committed Mar 4, 2018
1 parent f883f16 commit 5adc066
Show file tree
Hide file tree
Showing 24 changed files with 50 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ script:
# Build Java and C++
- mvn license:check test install -DskipTests
# Only test pulsar functions
- mvn -pl :pulsar-functions clean test package
- cd pulsar-functions && mvn clean test package
2 changes: 1 addition & 1 deletion pulsar-functions/api-examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.pulsar</groupId>
<artifactId>pulsar-functions-parent</artifactId>
<artifactId>pulsar-functions</artifactId>
<version>1.22.0-incubating-SNAPSHOT</version>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion pulsar-functions/api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.pulsar</groupId>
<artifactId>pulsar-functions-parent</artifactId>
<artifactId>pulsar-functions</artifactId>
<version>1.22.0-incubating-SNAPSHOT</version>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion pulsar-functions/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.pulsar</groupId>
<artifactId>pulsar-functions-parent</artifactId>
<artifactId>pulsar-functions</artifactId>
<version>1.22.0-incubating-SNAPSHOT</version>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,12 @@
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.Lists;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import lombok.Getter;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.apache.pulsar.client.admin.PulsarAdmin;
import org.apache.pulsar.functions.fs.FunctionConfig;
import org.apache.pulsar.functions.instance.JavaInstanceConfig;
import org.apache.pulsar.functions.runtime.container.SerDe;
import org.apache.pulsar.functions.spawner.LimitsConfig;
import org.apache.pulsar.functions.spawner.Spawner;
import org.apache.pulsar.functions.runtime.spawner.LimitsConfig;
import org.apache.pulsar.functions.runtime.spawner.Spawner;

@Parameters(commandDescription = "Operations about functions")
public class CmdFunctions extends CmdBase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
package org.apache.pulsar.functions.runtime.container;

import lombok.*;
import org.apache.pulsar.functions.instance.JavaExecutionResult;
import org.apache.pulsar.functions.runtime.instance.JavaExecutionResult;

import java.io.PrintWriter;
import java.io.StringWriter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

package org.apache.pulsar.functions.runtime.container;

import org.apache.pulsar.functions.instance.JavaInstanceConfig;
import org.apache.pulsar.functions.runtime.instance.JavaInstanceConfig;

/**
* A factory to create {@link FunctionContainer}s to invoke functions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.apache.pulsar.functions.fs.FunctionConfig;
import org.apache.pulsar.functions.instance.JavaExecutionResult;
import org.apache.pulsar.functions.instance.JavaInstance;
import org.apache.pulsar.functions.instance.JavaInstanceConfig;
import org.apache.pulsar.functions.runtime.instance.JavaExecutionResult;
import org.apache.pulsar.functions.runtime.instance.JavaInstance;
import org.apache.pulsar.functions.runtime.instance.JavaInstanceConfig;
import org.apache.pulsar.functions.runtime.functioncache.FunctionCacheManager;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

package org.apache.pulsar.functions.runtime.container;

import org.apache.pulsar.functions.instance.JavaInstanceConfig;
import org.apache.pulsar.functions.runtime.instance.JavaInstanceConfig;
import org.apache.pulsar.functions.runtime.functioncache.FunctionCacheManager;
import org.apache.pulsar.functions.runtime.functioncache.FunctionCacheManagerImpl;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.pulsar.functions.instance;
package org.apache.pulsar.functions.runtime.instance;

import org.apache.pulsar.functions.api.Context;
import org.slf4j.Logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.pulsar.functions.instance;
package org.apache.pulsar.functions.runtime.instance;

import lombok.*;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.pulsar.functions.instance;
package org.apache.pulsar.functions.runtime.instance;

import net.jodah.typetools.TypeResolver;
import org.apache.pulsar.functions.api.RawRequestHandler;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.pulsar.functions.instance;
package org.apache.pulsar.functions.runtime.instance;

import lombok.Data;
import lombok.EqualsAndHashCode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/

/**
* Provides the implementation of the Instance module for Pulsar Functions.
*/
package org.apache.pulsar.functions.instance;
package org.apache.pulsar.functions.runtime.instance;
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.pulsar.functions.spawner;
package org.apache.pulsar.functions.runtime.spawner;

import lombok.*;
import org.apache.pulsar.functions.fs.FunctionConfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.pulsar.functions.spawner;
package org.apache.pulsar.functions.runtime.spawner;

import lombok.*;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@
* function. It is responsible for starting/stopping the instance and passing data to the
* instance and getting the results back.
*/
package org.apache.pulsar.functions.spawner;
package org.apache.pulsar.functions.runtime.spawner;

import java.util.UUID;
import org.apache.pulsar.functions.fs.FunctionConfig;
import org.apache.pulsar.functions.instance.JavaInstanceConfig;
import org.apache.pulsar.functions.runtime.instance.JavaInstanceConfig;
import org.apache.pulsar.functions.runtime.FunctionID;
import org.apache.pulsar.functions.runtime.container.FunctionContainer;
import org.apache.pulsar.functions.runtime.container.SerDe;
import org.apache.pulsar.functions.runtime.container.ThreadFunctionContainerFactory;
import org.apache.pulsar.functions.subscribermanager.SubscriberManager;
import org.apache.pulsar.functions.runtime.subscribermanager.SubscriberManager;

public class Spawner {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* 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.
*/
/**
* Spanwer for spawning processes, threads, docker containers to execute functions.
*/
package org.apache.pulsar.functions.runtime.spawner;
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* function. It is responsible for starting/stopping the instance and passing data to the
* instance and getting the results back.
*/
package org.apache.pulsar.functions.subscribermanager;
package org.apache.pulsar.functions.runtime.subscribermanager;

import org.apache.pulsar.client.api.*;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* function. It is responsible for starting/stopping the instance and passing data to the
* instance and getting the results back.
*/
package org.apache.pulsar.functions.subscribermanager;
package org.apache.pulsar.functions.runtime.subscribermanager;

import org.apache.pulsar.client.api.PulsarClient;
import org.apache.pulsar.functions.runtime.container.ExecutionResult;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* function. It is responsible for starting/stopping the instance and passing data to the
* instance and getting the results back.
*/
package org.apache.pulsar.functions.subscribermanager;
package org.apache.pulsar.functions.runtime.subscribermanager;

import org.apache.pulsar.client.api.*;
import org.apache.pulsar.functions.runtime.container.FunctionContainer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* function. It is responsible for starting/stopping the instance and passing data to the
* instance and getting the results back.
*/
package org.apache.pulsar.functions.subscribermanager;
package org.apache.pulsar.functions.runtime.subscribermanager;

import org.apache.pulsar.client.api.*;
import org.apache.pulsar.functions.runtime.container.FunctionContainer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@
import java.net.URL;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.function.Function;
import lombok.extern.slf4j.Slf4j;
import org.apache.pulsar.functions.fs.FunctionConfig;
import org.apache.pulsar.functions.instance.JavaInstanceConfig;
import org.apache.pulsar.functions.runtime.instance.JavaInstanceConfig;
import org.apache.pulsar.functions.runtime.FunctionID;
import org.apache.pulsar.functions.runtime.InstanceID;
import org.junit.After;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.pulsar.functions.instance;
package org.apache.pulsar.functions.runtime.instance;

import org.apache.pulsar.functions.api.Context;
import org.apache.pulsar.functions.api.RequestHandler;
Expand All @@ -30,7 +30,6 @@
import java.io.ObjectOutput;
import java.io.ObjectOutputStream;

import static com.google.common.base.Charsets.UTF_8;
import static org.testng.Assert.*;

public class JavaInstanceTest {
Expand Down

0 comments on commit 5adc066

Please sign in to comment.