-
Notifications
You must be signed in to change notification settings - Fork 4.8k
HIVE-29713 : maintain properties package, update JEXL dependency to JEXL 3.7.0 #6592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
henrib
wants to merge
3
commits into
apache:master
Choose a base branch
from
henrib:HIVE-29713
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 83 additions & 0 deletions
83
...astore-common/src/main/java/org/apache/hadoop/hive/metastore/properties/package-info.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| /* | ||
| * 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. | ||
| */ | ||
|
|
||
| /** | ||
| * Type-safe, schema-driven property management for Hive metastore objects (clusters, databases, tables). | ||
| * | ||
| * <p>This package allows declaring, validating, and persisting custom properties with runtime type | ||
| * checking and serialization support.</p> | ||
| * | ||
| * <h2>Core Components</h2> | ||
| * | ||
| * <h3>{@link org.apache.hadoop.hive.metastore.properties.PropertySchema}</h3> | ||
| * <p>Defines the blueprint for what properties can be set on a metastore object.</p> | ||
| * <ul> | ||
| * <li>Declares allowed properties and their types (STRING, INTEGER, BOOLEAN, DATE, JSON, etc.)</li> | ||
| * <li>Manages default values for properties</li> | ||
| * <li>Tracks schema version — incremented when properties are added or removed</li> | ||
| * <li>Generates a digest (UUID) for schema identity and caching</li> | ||
| * </ul> | ||
| * | ||
| * <h3>{@link org.apache.hadoop.hive.metastore.properties.PropertyType}</h3> | ||
| * <p>Abstract type system for property values with parsing, formatting, and binary serialization. | ||
| * Built-in types: {@code STRING}, {@code BOOLEAN}, {@code INTEGER}, {@code LONG}, {@code DOUBLE}, | ||
| * {@code DATETIME} (ISO8601/UTC), {@code JSON} (Gson-backed). Custom types can be registered via | ||
| * {@link org.apache.hadoop.hive.metastore.properties.PropertyType#register(PropertyType)}.</p> | ||
| * | ||
| * <h3>{@link org.apache.hadoop.hive.metastore.properties.PropertyMap}</h3> | ||
| * <p>Holds the actual property values for a specific metastore object instance, validated against | ||
| * a {@code PropertySchema}. Uses copy-on-write semantics gated by a dirty flag for thread-safe, | ||
| * efficient sharing.</p> | ||
| * | ||
| * <h3>{@link org.apache.hadoop.hive.metastore.properties.PropertyManager}</h3> | ||
| * <p>High-level per-session manager that ties schemas into one namespace and drives transactional | ||
| * reads and writes. Tracks dirty maps to batch persistence store updates. Integrates with JEXL | ||
| * for dynamic property expressions.</p> | ||
| * | ||
| * <h3>{@link org.apache.hadoop.hive.metastore.properties.PropertyStore}</h3> | ||
| * <p>Persistence layer for loading and saving property maps to the metastore database. | ||
| * Can be wrapped by {@link org.apache.hadoop.hive.metastore.properties.CachingPropertyStore} | ||
| * for performance.</p> | ||
| * | ||
| * <h2>Workflow Example</h2> | ||
| * <pre>{@code | ||
| * // Define a schema (typically done at startup) | ||
| * PropertySchema tableSchema = new PropertySchema("table-schema", 1, new TreeMap<>()); | ||
| * tableSchema.declareProperty("owner", PropertyType.STRING, "admin"); | ||
| * tableSchema.declareProperty("is_external", PropertyType.BOOLEAN, false); | ||
| * tableSchema.declareProperty("created_time", PropertyType.DATETIME); | ||
| * | ||
| * // Create a property map for an object, set values, and persist | ||
| * PropertyMap tableProps = manager.newPropertyMap(tableSchema); | ||
| * tableProps.put("owner", "alice"); | ||
| * tableProps.put("is_external", true); | ||
| * manager.persistProperties(tableProps); | ||
| * }</pre> | ||
| * | ||
| * <h2>Design Patterns</h2> | ||
| * <ul> | ||
| * <li><b>Thread safety</b>: schemas use {@code AtomicInteger} version counters; maps use | ||
| * copy-on-write with dirty flags; digest computation is double-checked locked.</li> | ||
| * <li><b>Serialization</b>: a custom {@link org.apache.hadoop.hive.metastore.properties.SerializationProxy} | ||
| * handles transient fields safely; both {@code DataInput}/{@code DataOutput} and Java object | ||
| * serialization are supported.</li> | ||
| * <li><b>Schema versioning</b>: version and digest UUID allow detecting schema changes and | ||
| * support schema evolution without breaking existing data.</li> | ||
| * </ul> | ||
| */ | ||
| package org.apache.hadoop.hive.metastore.properties; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.