This is an automated email from the ASF dual-hosted git repository. jjramos pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git
The following commit(s) were added to refs/heads/develop by this push: new db86fae GEODE-7814: Avoid Messaging Unnecessary Allocations (#4731) db86fae is described below commit db86faec699aca67c02325bca22dcd5b913ddfed Author: Juan José Ramos <jujora...@users.noreply.github.com> AuthorDate: Thu Feb 27 09:40:13 2020 +0000 GEODE-7814: Avoid Messaging Unnecessary Allocations (#4731) Avoid unnecessary object allocations by making the attributes static. --- .../distributed/internal/DistributionMessage.java | 26 ++++++++++++---------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionMessage.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionMessage.java index f955015..bf5bfab 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionMessage.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionMessage.java @@ -71,6 +71,20 @@ public abstract class DistributionMessage private static final Logger logger = LogService.getLogger(); + @Immutable + protected static final InternalDistributedMember ALL_RECIPIENTS = null; + + @Immutable + private static final InternalDistributedMember[] ALL_RECIPIENTS_ARRAY = {null}; + + @Immutable + private static final InternalDistributedMember[] EMPTY_RECIPIENTS_ARRAY = + new InternalDistributedMember[0]; + + @Immutable + private static final List<InternalDistributedMember> ALL_RECIPIENTS_LIST = + Collections.singletonList(null); + // common flags used by operation messages /** Keep this compatible with the other GFE layer PROCESSOR_ID flags. */ protected static final short HAS_PROCESSOR_ID = 0x1; @@ -88,18 +102,6 @@ public abstract class DistributionMessage /** the unreserved flags start for child classes */ protected static final short UNRESERVED_FLAGS_START = (HAS_PROCESSOR_TYPE << 1); - private final InternalDistributedMember[] EMPTY_RECIPIENTS_ARRAY = - new InternalDistributedMember[0]; - - private final List<InternalDistributedMember> ALL_RECIPIENTS_LIST = - Collections.singletonList(null); - - private final InternalDistributedMember[] ALL_RECIPIENTS_ARRAY = - {null}; - - @Immutable - protected static final InternalDistributedMember ALL_RECIPIENTS = null; - //////////////////// Instance Fields //////////////////// /** The sender of this message */