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/04 09:30:11 UTC

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

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