Skip to content

Commit 8f45b51

Browse files
Configurable StorageConfigInfo for Polaris benchmark (#20)
* initial commit * triple quotes * remove hardcoded FIlE check * readme --------- Co-authored-by: Eric Maynard <[email protected]>
1 parent 9c3f19b commit 8f45b51

File tree

5 files changed

+13
-7
lines changed

5 files changed

+13
-7
lines changed

benchmarks/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ The data set size can be adjusted as well. Each namespace is associated with an
232232

233233
The diagram below shows sample catalog, namespace and table definition given the following properties:
234234

235+
- storage-config-info: `{"storageType": "FILE"}`
235236
- Default base location: `file:///tmp/polaris`
236237
- Number of namespace properties: `100`
237238
- Number of columns per table: `999`

benchmarks/src/gatling/resources/benchmark-defaults.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ auth {
3737

3838
# Dataset tree structure configuration
3939
dataset.tree {
40+
# JSON to supply as a StorageConfigInfo when creating a catalog
41+
# Default: {"storageType": "FILE"}
42+
storage-config-info = """{"storageType": "FILE"}"""
43+
4044
# Number of catalogs to create. Only the first catalog (C_0) will contain the test dataset.
4145
# Default: 1
4246
num-catalogs = 1

benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/actions/CatalogActions.scala

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ case class CatalogActions(
6262
val catalogName = s"C_$i"
6363
Map(
6464
"catalogName" -> catalogName,
65-
"defaultBaseLocation" -> s"${dp.defaultBaseLocation}/$catalogName"
65+
"defaultBaseLocation" -> s"${dp.defaultBaseLocation}/$catalogName",
66+
"storageConfigInfo" -> dp.storageConfigInfo
6667
)
6768
}
6869
.take(dp.numCatalogs)
@@ -90,9 +91,7 @@ case class CatalogActions(
9091
| "properties": {
9192
| "default-base-location": "#{defaultBaseLocation}"
9293
| },
93-
| "storageConfigInfo": {
94-
| "storageType": "FILE"
95-
| }
94+
| "storageConfigInfo": #{storageConfigInfo}
9695
| }
9796
|}""".stripMargin
9897
)
@@ -117,7 +116,6 @@ case class CatalogActions(
117116
.check(jsonPath("$.type").is("INTERNAL"))
118117
.check(jsonPath("$.name").is("#{catalogName}"))
119118
.check(jsonPath("$.properties.default-base-location").is("#{defaultBaseLocation}"))
120-
.check(jsonPath("$.storageConfigInfo.storageType").is("FILE"))
121119
.check(jsonPath("$.storageConfigInfo.allowedLocations[0]").is("#{defaultBaseLocation}"))
122120
)
123121

benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/parameters/BenchmarkConfig.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ object BenchmarkConfig {
7373
dataset.getInt("views-per-namespace"),
7474
dataset.getInt("max-views"),
7575
dataset.getInt("columns-per-view"),
76-
dataset.getInt("view-properties")
76+
dataset.getInt("view-properties"),
77+
dataset.getString("storage-config-info")
7778
)
7879

7980
BenchmarkConfig(connectionParams, workloadParams, datasetParams)

benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/parameters/DatasetParameters.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import org.apache.polaris.benchmarks.NAryTreeBuilder
3737
* @param numViewsMax The maximum number of views to create. If set to -1, all views are created.
3838
* @param numColumnsPerView The number of columns per view to create.
3939
* @param numViewProperties The number of view properties to create.
40+
* @param storageConfigInfo The JSON to supply when creating a new StorageConfigInfo for a catalog.
4041
*/
4142
case class DatasetParameters(
4243
numCatalogs: Int,
@@ -51,7 +52,8 @@ case class DatasetParameters(
5152
numViewsPerNs: Int,
5253
numViewsMax: Int,
5354
numColumnsPerView: Int,
54-
numViewProperties: Int
55+
numViewProperties: Int,
56+
storageConfigInfo: String
5557
) {
5658
val nAryTree: NAryTreeBuilder = NAryTreeBuilder(nsWidth, nsDepth)
5759
private val maxPossibleTables = nAryTree.numberOfLastLevelElements * numTablesPerNs

0 commit comments

Comments
 (0)