You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/12/03 12:03:06 UTC

[GitHub] [pulsar] zymap opened a new pull request #8817: (WIP) Package management client command

zymap opened a new pull request #8817:
URL: https://github.com/apache/pulsar/pull/8817


   <!--
   ### Contribution Checklist
     
     - Name the pull request in the form "[Issue XYZ][component] Title of the pull request", where *XYZ* should be replaced by the actual issue number.
       Skip *Issue XYZ* if there is no associated github issue for this pull request.
       Skip *component* if you are unsure about which is the best component. E.g. `[docs] Fix typo in produce method`.
   
     - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
     
     - Each pull request should address only one issue, not mix up code from multiple issues.
     
     - Each commit in the pull request has a meaningful commit message
   
     - Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
   
   **(The sections below can be removed for hotfixes of typos)**
   -->
   
   *(If this PR fixes a github issue, please add `Fixes #<xyz>`.)*
   
   Fixes #<xyz>
   
   *(or if this PR is one task of a github issue, please add `Master Issue: #<xyz>` to link to the master issue.)*
   
   Master Issue: #<xyz>
   
   ### Motivation
   
   
   *Explain here the context, and why you're making that change. What is the problem you're trying to solve.*
   
   ### Modifications
   
   *Describe the modifications you've done.*
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   *(Please pick either of the following options)*
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   *(or)*
   
   This change is already covered by existing tests, such as *(please describe tests)*.
   
   *(or)*
   
   This change added tests and can be verified as follows:
   
   *(example:)*
     - *Added integration tests for end-to-end deployment with large payloads (10MB)*
     - *Extended integration test for recovery after broker failure*
   
   ### Does this pull request potentially affect one of the following parts:
   
   *If `yes` was chosen, please highlight the changes*
   
     - Dependencies (does it add or upgrade a dependency): (yes / no)
     - The public API: (yes / no)
     - The schema: (yes / no / don't know)
     - The default values of configurations: (yes / no)
     - The wire protocol: (yes / no)
     - The rest endpoints: (yes / no)
     - The admin cli options: (yes / no)
     - Anything that affects deployment: (yes / no / don't know)
   
   ### Documentation
   
     - Does this pull request introduce a new feature? (yes / no)
     - If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
     - If a feature is not applicable for documentation, explain why?
     - If a feature is not documented yet in this PR, please create a followup issue for adding the documentation
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] zymap commented on pull request #8817: Package management client command

Posted by GitBox <gi...@apache.org>.
zymap commented on pull request #8817:
URL: https://github.com/apache/pulsar/pull/8817#issuecomment-739914966


   /pulsarbot run-failure-checks


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] zymap commented on pull request #8817: Package management client command

Posted by GitBox <gi...@apache.org>.
zymap commented on pull request #8817:
URL: https://github.com/apache/pulsar/pull/8817#issuecomment-739937252


   /pulsarbot run-failure-checks


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] zymap commented on a change in pull request #8817: (WIP) Package management client command

Posted by GitBox <gi...@apache.org>.
zymap commented on a change in pull request #8817:
URL: https://github.com/apache/pulsar/pull/8817#discussion_r537444270



##########
File path: pulsar-client-admin/pom.xml
##########
@@ -95,6 +95,14 @@
       <groupId>com.google.code.gson</groupId>
       <artifactId>gson</artifactId>
     </dependency>
+
+    <!-- packages management service related dependencies (begin) -->

Review comment:
       sure

##########
File path: pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/Packages.java
##########
@@ -0,0 +1,167 @@
+/**
+ * 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.pulsar.client.admin;
+
+import org.apache.pulsar.packages.management.core.common.PackageMetadata;
+
+import java.util.List;
+import java.util.concurrent.CompletableFuture;
+
+/**
+ * Administration operations of the packages management service.
+ */
+public interface Packages {
+    /**
+     * Get a package metadata information.
+     *
+     * @param packageName
+     *          the package name of the package metadata you want to find
+     * @return the package metadata information
+     */
+    PackageMetadata getMetadata(String packageName) throws PulsarAdminException;
+
+    /**
+     * Get a package metadata information asynchronously.
+     *
+     * @param packageName
+     *          the package name of the package metadata you want to find
+     * @return  the package metadata information
+     */
+    CompletableFuture<PackageMetadata> getMetadataAsync(String packageName);
+
+    /**
+     * Update a package metadata information.
+     *
+     * @param packageName
+     *          the package name of the package metadata you want to update
+     * @param metadata
+     *          the updated metadata information
+     */
+    void updateMetadata(String packageName, PackageMetadata metadata) throws PulsarAdminException;
+
+    /**
+     * Update a package metadata information asynchronously.
+     *
+     * @param packageName
+     *          the package name of the package metadata you want to update
+     * @param metadata
+     *          the updated metadata information
+     * @return nothing
+     */
+    CompletableFuture<Void> updateMetadataAsync(String packageName, PackageMetadata metadata);
+
+    /**
+     * Upload a package to the package management service.
+     *
+     * @param packageName
+     *          the package name of the upload file
+     * @param path
+     *          the upload file path
+     */
+    void upload(PackageMetadata metadata, String packageName, String path) throws PulsarAdminException;

Review comment:
       Yes. It should be an absolute location. 
   I will change that with another PR. Because that is another PR that has been merged.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] eolivelli commented on a change in pull request #8817: (WIP) Package management client command

Posted by GitBox <gi...@apache.org>.
eolivelli commented on a change in pull request #8817:
URL: https://github.com/apache/pulsar/pull/8817#discussion_r535957181



##########
File path: pulsar-client-admin/pom.xml
##########
@@ -95,6 +95,14 @@
       <groupId>com.google.code.gson</groupId>
       <artifactId>gson</artifactId>
     </dependency>
+
+    <!-- packages management service related dependencies (begin) -->

Review comment:
       AFAIK we are not used to adding this kind of "sections", please remove

##########
File path: pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/Packages.java
##########
@@ -0,0 +1,167 @@
+/**
+ * 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.pulsar.client.admin;
+
+import org.apache.pulsar.packages.management.core.common.PackageMetadata;
+
+import java.util.List;
+import java.util.concurrent.CompletableFuture;
+
+/**
+ * Administration operations of the packages management service.
+ */
+public interface Packages {
+    /**
+     * Get a package metadata information.
+     *
+     * @param packageName
+     *          the package name of the package metadata you want to find
+     * @return the package metadata information
+     */
+    PackageMetadata getMetadata(String packageName) throws PulsarAdminException;
+
+    /**
+     * Get a package metadata information asynchronously.
+     *
+     * @param packageName
+     *          the package name of the package metadata you want to find
+     * @return  the package metadata information
+     */
+    CompletableFuture<PackageMetadata> getMetadataAsync(String packageName);
+
+    /**
+     * Update a package metadata information.
+     *
+     * @param packageName
+     *          the package name of the package metadata you want to update
+     * @param metadata
+     *          the updated metadata information
+     */
+    void updateMetadata(String packageName, PackageMetadata metadata) throws PulsarAdminException;
+
+    /**
+     * Update a package metadata information asynchronously.
+     *
+     * @param packageName
+     *          the package name of the package metadata you want to update
+     * @param metadata
+     *          the updated metadata information
+     * @return nothing
+     */
+    CompletableFuture<Void> updateMetadataAsync(String packageName, PackageMetadata metadata);
+
+    /**
+     * Upload a package to the package management service.
+     *
+     * @param packageName
+     *          the package name of the upload file
+     * @param path
+     *          the upload file path
+     */
+    void upload(PackageMetadata metadata, String packageName, String path) throws PulsarAdminException;

Review comment:
       can you please tell what is this path ?
   is it an absolute location on disk ?
   in this case we should use the Java NIO Path object and not a raw String




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] codelipenghui merged pull request #8817: Package management client command

Posted by GitBox <gi...@apache.org>.
codelipenghui merged pull request #8817:
URL: https://github.com/apache/pulsar/pull/8817


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org