summaryrefslogtreecommitdiff
path: root/zuul/model_api.py
diff options
context:
space:
mode:
authorJames E. Blair <jim@acmegating.com>2022-03-03 15:26:52 -0800
committerJames E. Blair <jim@acmegating.com>2022-03-22 11:33:38 -0700
commit208b936530d3e35fb09f0e95ab403a5a3431eaa3 (patch)
tree51af07fedec21cae1e325d5624802b6ce533f0a5 /zuul/model_api.py
parent082ff730fef20fac8fce50d3ea237c05f52fbbf5 (diff)
downloadzuul-208b936530d3e35fb09f0e95ab403a5a3431eaa3.tar.gz
Use JobData for Build result data
The result data from a job may be quite large, which is why we offload it to a sharded ResultData object. It may also be nonexistent, which is why we just set it to null and skip the offloading in that case. The JobData class that we use for FrozenJobs has two extra optimizations: if the data size is small, we just store it inline instead of creating a small single-node shard; and if we do shard, we store a hash inline so we only refresh if necessary. Update the Build object to use JobData instances instead of ResultData for the build result data so that we can benefit from the additional optimizations. This is, surprisingly, the first time we have had to check the cluster model api within model.py, so this change also performs a slight rearrangement of the MODEL_API constant to avoid circular imports. Change-Id: I2053bd0327dfcad1d4246b158098033e188e2ed4
Diffstat (limited to 'zuul/model_api.py')
-rw-r--r--zuul/model_api.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/zuul/model_api.py b/zuul/model_api.py
new file mode 100644
index 000000000..92b782621
--- /dev/null
+++ b/zuul/model_api.py
@@ -0,0 +1,17 @@
+# Copyright 2022 Acme Gating, LLC
+#
+# Licensed 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.
+
+# When making ZK schema changes, increment this and add a record to
+# docs/developer/model-changelog.rst
+MODEL_API = 5