From 64ba24e9c6064e51140cc42d67f312ae3ca7382b Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Thu, 2 Mar 2023 18:01:56 +0100 Subject: [PATCH] Remove Namespace.populate() populate() is implementation specific and used only internally. Integrate it into the constructor. JIRA: CONTROLLER-2072 Change-Id: I6a78a506d2a7936f84dac332928848af832a21aa Signed-off-by: Robert Varga --- .../io/atomix/utils/serializer/Namespace.java | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/third-party/atomix/storage/src/main/java/io/atomix/utils/serializer/Namespace.java b/third-party/atomix/storage/src/main/java/io/atomix/utils/serializer/Namespace.java index 2343e7afd6..dcad23d9f0 100644 --- a/third-party/atomix/storage/src/main/java/io/atomix/utils/serializer/Namespace.java +++ b/third-party/atomix/storage/src/main/java/io/atomix/utils/serializer/Namespace.java @@ -108,7 +108,7 @@ public final class Namespace implements KryoFactory, KryoPool { if (!types.isEmpty()) { blocks.add(new RegistrationBlock(this.blockHeadId, types)); } - return new Namespace(blocks, classLoader, friendlyName).populate(1); + return new Namespace(blocks, classLoader, friendlyName); } /** @@ -161,20 +161,9 @@ public final class Namespace implements KryoFactory, KryoPool { this.registeredBlocks = ImmutableList.copyOf(registeredTypes); this.classLoader = classLoader; this.friendlyName = requireNonNull(friendlyName); - } - - /** - * Populates the Kryo pool. - * - * @param instances to add to the pool - * @return this - */ - public Namespace populate(int instances) { - for (int i = 0; i < instances; ++i) { - release(create()); - } - return this; + // Pre-populate with a single instance + release(create()); } /** -- 2.36.6