jojochuang commented on code in PR #10741: URL: https://github.com/apache/ozone/pull/10741#discussion_r3589613723
########## hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOFSIsDirectoryBenchmark.java: ########## @@ -0,0 +1,149 @@ +/* + * 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.hadoop.fs.ozone; + +import static org.apache.hadoop.fs.CommonConfigurationKeysPublic.FS_DEFAULT_NAME_KEY; +import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_OM_ADDRESS_KEY; + +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import org.apache.hadoop.fs.FSDataOutputStream; +import org.apache.hadoop.fs.FileSystem; +import org.apache.hadoop.fs.Path; +import org.apache.hadoop.hdds.conf.OzoneConfiguration; +import org.apache.hadoop.ozone.MiniOzoneCluster; +import org.apache.hadoop.ozone.OzoneConsts; +import org.apache.hadoop.ozone.client.ObjectStore; +import org.apache.hadoop.ozone.client.OzoneClient; +import org.apache.hadoop.ozone.om.OMConfigKeys; +import org.apache.hadoop.ozone.om.helpers.BucketLayout; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.api.Timeout; + +/** + * On-demand benchmark (not part of {@code mvn test}) for HDDS-15678. + * + * <p>Measures OFS {@link FileSystem#isFile}/{@link FileSystem#isDirectory} + * (the metadata-only head-op path added by this change) against a full + * {@link FileSystem#getFileStatus} on the same <b>file</b> path. For a file, + * the full path makes the OM contact SCM to refresh pipeline/block locations; + * the head-op path skips that round-trip. The A/B in a single run isolates the + * eliminated SCM refresh (FULL = pre-fix behaviour, HEAD = this fix). + * + * <p>To instead run a classic before/after across two builds, revert the + * {@code isDirectory}/{@code isFile} overrides in + * {@link BasicRootedOzoneFileSystem} and compare the HEAD numbers. + * + * <pre> + * mvn -pl hadoop-ozone/integration-test test \ + * -Dtest=TestOFSIsDirectoryBenchmark -DskipShade -DskipRecon \ + * -Dsurefire.failIfNoSpecifiedTests=false + * </pre> + */ +@Tag("benchmark") Review Comment: note: our precommit CI runs integration tests too, and skips only `unhealthy` tests. So we would need to update the CI to skip benchmark tests. -- 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]
