This is an automated email from the ASF dual-hosted git repository.
pingtimeout pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/polaris-tools.git
The following commit(s) were added to refs/heads/main by this push:
new 81fc01c Add missing RAT task in benchmarks (#29)
81fc01c is described below
commit 81fc01c45412ae94765b1d4f6fd59aa9ff1d9b50
Author: Pierre Laporte <[email protected]>
AuthorDate: Wed Sep 24 15:04:02 2025 +0200
Add missing RAT task in benchmarks (#29)
This commit also includes a Spotless configuration so that missing
headers are automatically added.
---
benchmarks/build.gradle.kts | 65 ++++++++++++++++++++++
.../copyright-header-scala.txt} | 11 ----
benchmarks/settings.gradle.kts | 19 +++++++
.../polaris/benchmarks/NAryTreeBuilder.scala | 1 -
.../polaris/benchmarks/RetryOnHttpCodes.scala | 1 -
.../benchmarks/actions/AuthenticationActions.scala | 1 -
.../benchmarks/actions/CatalogActions.scala | 1 -
.../benchmarks/actions/EntityProperties.scala | 1 -
.../benchmarks/actions/NamespaceActions.scala | 1 -
.../polaris/benchmarks/actions/TableActions.scala | 1 -
.../polaris/benchmarks/actions/ViewActions.scala | 1 -
.../benchmarks/parameters/BenchmarkConfig.scala | 1 -
.../parameters/ConnectionParameters.scala | 1 -
.../parameters/CreateCommitsParameters.scala | 1 -
.../parameters/CreateTreeDatasetParameters.scala | 1 -
.../benchmarks/parameters/DatasetParameters.scala | 1 -
.../parameters/ReadTreeDatasetParameters.scala | 1 -
.../ReadUpdateTreeDatasetParameters.scala | 1 -
.../WeightedWorkloadOnTreeDatasetParameters.scala | 1 -
.../benchmarks/parameters/WorkloadParameters.scala | 1 -
.../benchmarks/simulations/CreateCommits.scala | 1 -
.../benchmarks/simulations/CreateTreeDataset.scala | 1 -
.../benchmarks/simulations/ReadTreeDataset.scala | 1 -
.../simulations/ReadUpdateTreeDataset.scala | 1 -
.../WeightedWorkloadOnTreeDataset.scala | 1 -
.../polaris/benchmarks/util/CircularIterator.scala | 1 -
26 files changed, 84 insertions(+), 34 deletions(-)
diff --git a/benchmarks/build.gradle.kts b/benchmarks/build.gradle.kts
index 3f68169..aa54bd3 100644
--- a/benchmarks/build.gradle.kts
+++ b/benchmarks/build.gradle.kts
@@ -1,7 +1,29 @@
+/*
+ * 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.
+ */
+
+import org.nosphere.apache.rat.RatTask
+
plugins {
scala
id("io.gatling.gradle") version "3.13.5.2"
id("com.diffplug.spotless") version "7.0.2"
+ id("org.nosphere.apache.rat") version "0.8.1"
}
description = "Polaris Iceberg REST API performance tests"
@@ -25,5 +47,48 @@ spotless {
scala {
// Use scalafmt for Scala formatting
scalafmt("3.9.3").configFile(".scalafmt.conf")
+ // Add license header to Scala files
+
licenseHeaderFile(rootProject.file("codestyle/copyright-header-scala.txt"),
"package ")
}
}
+
+tasks.named<RatTask>("rat").configure {
+ // Gradle
+ excludes.add("**/build/**")
+ excludes.add("gradle/wrapper/gradle-wrapper*")
+ excludes.add(".gradle")
+
+ excludes.add("LICENSE")
+ excludes.add("DISCLAIMER")
+ excludes.add("NOTICE")
+
+ // Git & GitHub
+ excludes.add(".git")
+ excludes.add(".github/pull_request_template.md")
+
+ // Misc build artifacts
+ excludes.add("**/.keep")
+ excludes.add("logs/**")
+ excludes.add("**/*.lock")
+
+ // Configuration files that cannot have headers
+ excludes.add("**/*.conf") // Gatling and HOCON config files
+ excludes.add("**/*.properties") // Gradle wrapper properties
+
+ // Binary files
+ excludes.add("**/*.jar")
+ excludes.add("**/*.zip")
+ excludes.add("**/*.tar.gz")
+ excludes.add("**/*.tgz")
+ excludes.add("**/*.class")
+
+ // IntelliJ
+ excludes.add(".idea")
+ excludes.add("**/*.iml")
+ excludes.add("**/*.iws")
+
+ // Rat can't scan binary images
+ excludes.add("**/*.png")
+ excludes.add("**/*.svg")
+ excludes.add("**/*.puml")
+}
diff --git
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/actions/EntityProperties.scala
b/benchmarks/codestyle/copyright-header-scala.txt
similarity index 73%
copy from
benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/actions/EntityProperties.scala
copy to benchmarks/codestyle/copyright-header-scala.txt
index 962651d..042f3ce 100644
---
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/actions/EntityProperties.scala
+++ b/benchmarks/codestyle/copyright-header-scala.txt
@@ -16,14 +16,3 @@
* specific language governing permissions and limitations
* under the License.
*/
-
-package org.apache.polaris.benchmarks.actions
-
-import play.api.libs.json.Json
-
-object EntityProperties {
- def filterMapByPrefix(json: String, prefix: String): Map[String, String] =
- Json.parse(json).as[Map[String, String]].filter { case (k, _) =>
- k.startsWith(prefix)
- }
-}
diff --git a/benchmarks/settings.gradle.kts b/benchmarks/settings.gradle.kts
index 912ad48..45b9df4 100644
--- a/benchmarks/settings.gradle.kts
+++ b/benchmarks/settings.gradle.kts
@@ -1 +1,20 @@
+/*
+ * 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.
+ */
+
rootProject.name = "Apache Polaris Benchmarks"
diff --git
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/NAryTreeBuilder.scala
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/NAryTreeBuilder.scala
index 582b5de..6e00f14 100644
---
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/NAryTreeBuilder.scala
+++
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/NAryTreeBuilder.scala
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.polaris.benchmarks
/**
diff --git
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/RetryOnHttpCodes.scala
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/RetryOnHttpCodes.scala
index 9365615..0d64786 100644
---
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/RetryOnHttpCodes.scala
+++
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/RetryOnHttpCodes.scala
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.polaris.benchmarks
import io.gatling.core.Predef._
diff --git
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/actions/AuthenticationActions.scala
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/actions/AuthenticationActions.scala
index 83143cd..8c8b04e 100644
---
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/actions/AuthenticationActions.scala
+++
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/actions/AuthenticationActions.scala
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.polaris.benchmarks.actions
import io.gatling.core.Predef._
diff --git
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/actions/CatalogActions.scala
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/actions/CatalogActions.scala
index 0584868..1062b4d 100644
---
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/actions/CatalogActions.scala
+++
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/actions/CatalogActions.scala
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.polaris.benchmarks.actions
import io.gatling.core.Predef._
diff --git
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/actions/EntityProperties.scala
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/actions/EntityProperties.scala
index 962651d..0c5d476 100644
---
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/actions/EntityProperties.scala
+++
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/actions/EntityProperties.scala
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.polaris.benchmarks.actions
import play.api.libs.json.Json
diff --git
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/actions/NamespaceActions.scala
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/actions/NamespaceActions.scala
index 1fedc70..275cf68 100644
---
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/actions/NamespaceActions.scala
+++
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/actions/NamespaceActions.scala
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.polaris.benchmarks.actions
import io.gatling.core.Predef._
diff --git
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/actions/TableActions.scala
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/actions/TableActions.scala
index 67e0ac0..28e4b5b 100644
---
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/actions/TableActions.scala
+++
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/actions/TableActions.scala
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.polaris.benchmarks.actions
import io.gatling.core.Predef._
diff --git
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/actions/ViewActions.scala
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/actions/ViewActions.scala
index 99ff175..15f6b9e 100644
---
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/actions/ViewActions.scala
+++
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/actions/ViewActions.scala
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.polaris.benchmarks.actions
import io.gatling.core.Predef._
diff --git
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/parameters/BenchmarkConfig.scala
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/parameters/BenchmarkConfig.scala
index 241e20c..1674127 100644
---
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/parameters/BenchmarkConfig.scala
+++
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/parameters/BenchmarkConfig.scala
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.polaris.benchmarks.parameters
import com.typesafe.config.{Config, ConfigFactory}
diff --git
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/parameters/ConnectionParameters.scala
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/parameters/ConnectionParameters.scala
index 67c8cc1..f227ca8 100644
---
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/parameters/ConnectionParameters.scala
+++
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/parameters/ConnectionParameters.scala
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.polaris.benchmarks.parameters
/**
diff --git
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/parameters/CreateCommitsParameters.scala
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/parameters/CreateCommitsParameters.scala
index 995a0fe..51cf48f 100644
---
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/parameters/CreateCommitsParameters.scala
+++
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/parameters/CreateCommitsParameters.scala
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.polaris.benchmarks.parameters
/**
diff --git
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/parameters/CreateTreeDatasetParameters.scala
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/parameters/CreateTreeDatasetParameters.scala
index 68a72ad..289b5a7 100644
---
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/parameters/CreateTreeDatasetParameters.scala
+++
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/parameters/CreateTreeDatasetParameters.scala
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.polaris.benchmarks.parameters
/**
diff --git
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/parameters/DatasetParameters.scala
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/parameters/DatasetParameters.scala
index 94f6cb0..c933724 100644
---
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/parameters/DatasetParameters.scala
+++
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/parameters/DatasetParameters.scala
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.polaris.benchmarks.parameters
import org.apache.polaris.benchmarks.NAryTreeBuilder
diff --git
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/parameters/ReadTreeDatasetParameters.scala
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/parameters/ReadTreeDatasetParameters.scala
index 82c1aa0..46594c1 100644
---
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/parameters/ReadTreeDatasetParameters.scala
+++
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/parameters/ReadTreeDatasetParameters.scala
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.polaris.benchmarks.parameters
/**
diff --git
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/parameters/ReadUpdateTreeDatasetParameters.scala
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/parameters/ReadUpdateTreeDatasetParameters.scala
index 40d4c7d..23a67e0 100644
---
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/parameters/ReadUpdateTreeDatasetParameters.scala
+++
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/parameters/ReadUpdateTreeDatasetParameters.scala
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.polaris.benchmarks.parameters
/**
diff --git
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/parameters/WeightedWorkloadOnTreeDatasetParameters.scala
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/parameters/WeightedWorkloadOnTreeDatasetParameters.scala
index 46f9857..49999b3 100644
---
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/parameters/WeightedWorkloadOnTreeDatasetParameters.scala
+++
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/parameters/WeightedWorkloadOnTreeDatasetParameters.scala
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.polaris.benchmarks.parameters
import com.typesafe.config.Config
diff --git
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/parameters/WorkloadParameters.scala
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/parameters/WorkloadParameters.scala
index dc8027c..0ee9690 100644
---
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/parameters/WorkloadParameters.scala
+++
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/parameters/WorkloadParameters.scala
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.polaris.benchmarks.parameters
case class WorkloadParameters(
diff --git
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/simulations/CreateCommits.scala
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/simulations/CreateCommits.scala
index cd8e7c9..6f1749c 100644
---
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/simulations/CreateCommits.scala
+++
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/simulations/CreateCommits.scala
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.polaris.benchmarks.simulations
import io.gatling.core.Predef._
diff --git
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/simulations/CreateTreeDataset.scala
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/simulations/CreateTreeDataset.scala
index 3c26623..ae04756 100644
---
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/simulations/CreateTreeDataset.scala
+++
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/simulations/CreateTreeDataset.scala
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.polaris.benchmarks.simulations
import io.gatling.core.Predef._
diff --git
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/simulations/ReadTreeDataset.scala
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/simulations/ReadTreeDataset.scala
index 6c04cb6..44a0077 100644
---
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/simulations/ReadTreeDataset.scala
+++
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/simulations/ReadTreeDataset.scala
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.polaris.benchmarks.simulations
import io.gatling.core.Predef._
diff --git
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/simulations/ReadUpdateTreeDataset.scala
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/simulations/ReadUpdateTreeDataset.scala
index 2304920..1827c0c 100644
---
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/simulations/ReadUpdateTreeDataset.scala
+++
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/simulations/ReadUpdateTreeDataset.scala
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.polaris.benchmarks.simulations
import io.gatling.core.Predef._
diff --git
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/simulations/WeightedWorkloadOnTreeDataset.scala
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/simulations/WeightedWorkloadOnTreeDataset.scala
index baed863..f6e8dc1 100644
---
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/simulations/WeightedWorkloadOnTreeDataset.scala
+++
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/simulations/WeightedWorkloadOnTreeDataset.scala
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.polaris.benchmarks.simulations
import io.gatling.core.Predef._
diff --git
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/util/CircularIterator.scala
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/util/CircularIterator.scala
index a766d26..18335c3 100644
---
a/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/util/CircularIterator.scala
+++
b/benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/util/CircularIterator.scala
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.polaris.benchmarks.util
class CircularIterator[T](builder: () => Iterator[T]) extends Iterator[T] {