Package org.apache.hadoop.ozone.om
Class OmSnapshotLocalDataYaml.YamlFactory
java.lang.Object
org.apache.commons.pool2.BaseObject
org.apache.commons.pool2.BasePooledObjectFactory<org.yaml.snakeyaml.Yaml>
org.apache.hadoop.ozone.om.OmSnapshotLocalDataYaml.YamlFactory
- All Implemented Interfaces:
org.apache.commons.pool2.PooledObjectFactory<org.yaml.snakeyaml.Yaml>
- Enclosing class:
OmSnapshotLocalDataYaml
public static class OmSnapshotLocalDataYaml.YamlFactory
extends org.apache.commons.pool2.BasePooledObjectFactory<org.yaml.snakeyaml.Yaml>
Factory class for constructing and pooling instances of the Yaml object.
This class extends BasePooledObjectFactory to support object pooling,
minimizing the expense of repeatedly creating and destroying Yaml instances.
The Yaml instances created by this factory are customized to use a specific
set of property and serialization/deserialization configurations.
- BeanAccess is configured to access fields directly, allowing manipulation
of private fields in objects.
- The PropertyUtils allows read-only properties to be accessed.
- Custom Representer and Constructor classes tailored to the OmSnapshotLocalData
data structure are employed to customize how objects are represented in YAML.
This class provides thread-safe pooling and management of Yaml instances,
ensuring efficient resource usage in high-concurrency environments.
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.commons.pool2.BasePooledObjectFactory
activateObject, destroyObject, makeObject, passivateObject, validateObjectMethods inherited from class org.apache.commons.pool2.BaseObject
toString, toStringAppendFieldsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.commons.pool2.PooledObjectFactory
destroyObject
-
Constructor Details
-
YamlFactory
public YamlFactory()
-
-
Method Details
-
create
public org.yaml.snakeyaml.Yaml create()- Specified by:
createin classorg.apache.commons.pool2.BasePooledObjectFactory<org.yaml.snakeyaml.Yaml>
-
wrap
public org.apache.commons.pool2.PooledObject<org.yaml.snakeyaml.Yaml> wrap(org.yaml.snakeyaml.Yaml yaml) - Specified by:
wrapin classorg.apache.commons.pool2.BasePooledObjectFactory<org.yaml.snakeyaml.Yaml>
-