Jackie-Jiang commented on a change in pull request #8063: URL: https://github.com/apache/pinot/pull/8063#discussion_r791075735
########## File path: pinot-spi/src/main/java/org/apache/pinot/spi/filesystem/BasePinotFS.java ########## @@ -0,0 +1,74 @@ +/** + * 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.pinot.spi.filesystem; + +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.nio.file.Path; +import java.nio.file.Paths; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +public abstract class BasePinotFS implements PinotFS { + private static final Logger LOGGER = LoggerFactory.getLogger(PinotFS.class); + + /** + * Moves the file or directory from the src to dst. Does not keep the original file. If the dst has parent directories + * that haven't been created, this method will create all the necessary parent directories. + * Note: In Pinot we recommend the full paths of both src and dst be specified. + * For example, if a file /a/b/c is moved to a file /x/y/z, in the case of overwrite, the directory /a/b still exists, + * but will not contain the file 'c'. Instead, /x/y/z will contain the contents of 'c'. + * If src is a directory /a/b which contains two files /a/b/c and /a/b/d, and the dst is /x/y, the result would be + * that the directory /a/b under /a gets removed and dst directory contains two files which is /x/y/c and /x/y/d. + * If src is a directory /a/b needs to be moved under another directory /x/y, please specify the dst to /x/y/b. + * @param srcUri URI of the original file + * @param dstUri URI of the final file location + * @param overwrite true if we want to overwrite the dstURI, false otherwise + * @return true if move is successful + * @throws IOException on IO failure + */ + public boolean move(URI srcUri, URI dstUri, boolean overwrite) Review comment: The javadoc should be moved to the interface. Also add override to this method -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
