forked from apache/pulsar
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[tiered storage] Use NAR plugin to package offloaders (apache#2393)
### Motivation Offloader typically involves a new storage system, which usually involves dependencies that might be conflicting with the dependencies of Pulsar. We want to package offloader implementations as what we did for connectors, so people can decide which offloader to use and only include it. People would also become easier to write its offloader if needed. ### Changes - Update `tiered-storage/jcloud` to package it using nifi-nar plugin. - Add bunch of utils in managed-ledger to locate offloader nar packages and load `LedgerOffloaderFactory` from corresponding NAR package. - Add a new distribution module to package offloaders into one distribution, as what we did for connectors. - Update pulsar-all image to include offloaders ### NOTES This change doesn't get rid of jcloud-shaded. because jcloud is using `ServiceLoad` and Guice injection. It makes things very tricky on class loading. Not attempt to address the problem any time soon. We can pin `jcloud-shaded` version as what we did for `protobuf-shaded` in next release.
- Loading branch information
Showing
17 changed files
with
474 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<!-- | ||
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/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.apache.pulsar</groupId> | ||
<artifactId>distribution</artifactId> | ||
<version>2.2.0-incubating-SNAPSHOT</version> | ||
<relativePath>..</relativePath> | ||
</parent> | ||
|
||
<artifactId>pulsar-offloader-distribution</artifactId> | ||
<packaging>pom</packaging> | ||
<name>Pulsar :: Distribution :: Offloader</name> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.apache.pulsar</groupId> | ||
<artifactId>managed-ledger-original</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-assembly-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>distro-assembly</id> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>single</goal> | ||
</goals> | ||
<configuration> | ||
<attach>true</attach> | ||
<tarLongFileMode>posix</tarLongFileMode> | ||
<finalName>apache-pulsar-offloaders-${project.version}</finalName> | ||
<descriptors> | ||
<descriptor>src/assemble/offloaders.xml</descriptor> | ||
</descriptors> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
Please refer to http://pulsar.incubator.apache.org/ for access to documentation. | ||
|
||
This package contains Pulsar offloader archives. Each archive | ||
contains: | ||
|
||
* the offloader code plus all the dependencies | ||
|
||
* META-INF/DEPEDENCIES file with licensing information for all transitive | ||
dependencies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<!-- | ||
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. | ||
--> | ||
<assembly | ||
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd"> | ||
<id>bin</id> | ||
<formats> | ||
<format>tar.gz</format> | ||
</formats> | ||
<includeBaseDirectory>true</includeBaseDirectory> | ||
<files> | ||
<file> | ||
<source>${basedir}/../../DISCLAIMER</source> | ||
<outputDirectory>.</outputDirectory> | ||
<fileMode>644</fileMode> | ||
</file> | ||
<file> | ||
<source>${basedir}/../../LICENSE</source> | ||
<outputDirectory>.</outputDirectory> | ||
<fileMode>644</fileMode> | ||
</file> | ||
<file> | ||
<source>${basedir}/src/assemble/README</source> | ||
<destName>README</destName> | ||
<outputDirectory>.</outputDirectory> | ||
<fileMode>644</fileMode> | ||
</file> | ||
|
||
<file> | ||
<source>${basedir}/../../tiered-storage/jcloud/target/tiered-storage-jcloud-${project.version}.nar</source> | ||
<outputDirectory>offloaders</outputDirectory> | ||
<fileMode>644</fileMode> | ||
</file> | ||
</files> | ||
</assembly> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,5 +36,6 @@ | |
<modules> | ||
<module>server</module> | ||
<module>io</module> | ||
<module>offloaders</module> | ||
</modules> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/offload/OffloaderDefinition.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** | ||
* 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. | ||
*/ | ||
package org.apache.bookkeeper.mledger.offload; | ||
|
||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
/** | ||
* Definition of an offloader NAR package. | ||
*/ | ||
@Data | ||
@NoArgsConstructor | ||
public class OffloaderDefinition { | ||
|
||
/** | ||
* The name of the offloader type. | ||
*/ | ||
private String name; | ||
|
||
/** | ||
* Description to be used for user help. | ||
*/ | ||
private String description; | ||
|
||
/** | ||
* The class name for the offloader factory implementation. | ||
*/ | ||
private String offloaderFactoryClass; | ||
|
||
} |
Oops, something went wrong.