GeorgeJahad commented on code in PR #3729: URL: https://github.com/apache/ozone/pull/3729#discussion_r975915757
########## hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/IOmMetadataReader.java: ########## @@ -0,0 +1,120 @@ +/** + * 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 + * <p> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p> + * 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.hadoop.ozone.om; + +import org.apache.hadoop.ozone.OzoneAcl; +import org.apache.hadoop.ozone.om.exceptions.OMException; +import org.apache.hadoop.ozone.om.helpers.OmKeyArgs; +import org.apache.hadoop.ozone.om.helpers.OmKeyInfo; +import org.apache.hadoop.ozone.om.helpers.OzoneFileStatus; +import org.apache.hadoop.ozone.security.acl.OzoneObj; + +import java.io.IOException; +import java.util.List; + +/** + * Protocol for OmMetadataReader's. + */ +public interface IOmMetadataReader { + /** + * Look up for the container of an existing key. + * + * @param args the args of the key. + * @return OmKeyInfo instance that client uses to talk to container. + */ + OmKeyInfo lookupKey(OmKeyArgs args) throws IOException; + + /** + * List the status for a file or a directory and its contents. + * + * @param args Key args + * @param recursive For a directory if true all the descendants of a + * particular directory are listed + * @param startKey Key from which listing needs to start. If startKey exists + * its status is included in the final list. + * @param numEntries Number of entries to list from the start key + * @param allowPartialPrefixes if partial prefixes should be allowed, + * this is needed in context of ListKeys + * @return list of file status + */ + List<OzoneFileStatus> listStatus(OmKeyArgs args, boolean recursive, Review Comment: Actually, after responding to @smengcl 's comment above about about the listKeys() keyPrefix, I realized that this command does work, but has to be invoked with a keyPrefix. So, instead of this: ``` ozone sh key list /vol1/bucket1/.snapshot/snap1 ``` It works like this: ``` ozone sh key list /vol1/bucket1/ -p .snapshot/snap1 ``` I admit that is not a great user interface, and should probably be fixed. But at least you can see the functionality is there. -- 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: issues-unsubscr...@ozone.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org For additional commands, e-mail: issues-h...@ozone.apache.org