/** * If the current member is primary for this bucket return true, otherwise, give some time for the * current member to become primary and then return whether it is a primary (true/false). */ public boolean isPrimaryWithWait() { if (this.isPrimary()) { return true; } // wait for the current member to become primary holder InternalDistributedMember primary = waitForNewPrimary(); if (primary != null) { return true; } return false; }
/** * Blocks until there is a known primary and return that member, but only if there are real bucket * regions that exist. If there are no real bucket regions within the distribution config's * member-timeout setting * 3 (time required to eject a member) + 15000, then this returns null. * * kbanks: reworked this method to avoid JIT issue #40639 * * @return the member who is primary for this bucket */ public InternalDistributedMember getPrimary() { InternalDistributedMember primary = getExistingPrimary(); if (primary == null) { primary = waitForNewPrimary(); } return primary; }