@Override public Set<InternalDistributedMember> getAllOtherMembers() { Set<InternalDistributedMember> result = new HashSet<>(getDistributionManagerIdsIncludingAdmin()); result.remove(getDistributionManagerId()); return result; }
/** * Returns a private-memory list containing the identities of all the other known distribution * managers not including me. */ @Override public Set<InternalDistributedMember> getOtherDistributionManagerIds() { // We return a modified copy of the list, so // collect the old list and copy under the lock. Set<InternalDistributedMember> result = new HashSet<>(getDistributionManagerIds()); InternalDistributedMember me = getDistributionManagerId(); result.remove(me); // It's okay for my own id to not be in the list of all ids yet. return result; }
void setRedundancyZone(InternalDistributedMember member, String redundancyZone) { if (redundancyZone != null && !redundancyZone.equals("")) { this.redundancyZones.put(member, redundancyZone); } if (member != getDistributionManagerId()) { String relationship = areInSameZone(getDistributionManagerId(), member) ? "" : "not "; Object[] logArgs = new Object[] {member, relationship}; logger.info("Member {} is {} equivalent or in the same redundancy zone.", logArgs); } }
@Override public Set<InternalDistributedMember> getOtherNormalDistributionManagerIds() { // We return a modified copy of the list, so // collect the old list and copy under the lock. Set<InternalDistributedMember> result = new HashSet<>(getNormalDistributionManagerIds()); InternalDistributedMember me = getDistributionManagerId(); result.remove(me); // It's okay for my own id to not be in the list of all ids yet. return result; }
@Override public Set<InternalDistributedMember> getMembersInThisZone() { return getMembersInSameZone(getDistributionManagerId()); }
public SerialAckedMessage() { super(); InternalDistributedSystem ds = InternalDistributedSystem.getAnyInstance(); if (ds != null) { // this constructor is used in serialization as well as when sending to others this.originDm = (ClusterDistributionManager) ds.getDistributionManager(); this.id = this.originDm.getDistributionManagerId(); } }
public HighPriorityAckedMessage() { super(); InternalDistributedSystem ds = InternalDistributedSystem.getAnyInstance(); if (ds != null) { this.originDm = (ClusterDistributionManager) ds.getDistributionManager(); } if (this.originDm != null) { this.id = this.originDm.getDistributionManagerId(); } }
throw new InterruptedException(); recipients = new HashSet(recipients); DistributedMember me = originDm.getDistributionManagerId(); if (recipients.contains(me)) { recipients.remove(me);
/** * send the message and wait for replies * * @param recipients the destination manager ids * @param multicast whether to use multicast or unicast * @throws InterruptedException if the operation is interrupted (as by shutdown) * @throws ReplyException if an exception was sent back by another manager */ public void send(Set recipients, boolean multicast) throws InterruptedException, ReplyException { if (Thread.interrupted()) { throw new InterruptedException(); } this.op = operationType.DRAIN_POOL; Set recips = new HashSet(recipients); DistributedMember me = originDm.getDistributionManagerId(); if (recips.contains(me)) { recips.remove(me); } rp = new ReplyProcessor21(originDm, recips); processorId = rp.getProcessorId(); setRecipients(recips); setMulticast(multicast); originDm.putOutgoing(this); rp.waitForReplies(); }
this.useNative = useNative; Set recips = new HashSet(recipients); DistributedMember me = originDm.getDistributionManagerId(); if (recips.contains(me)) { recips.remove(me);
when(distributionManager.getDistributionManagerId()).thenReturn(member); when(distributionManager.getConfig()).thenReturn(config); when(distributionManager.getSystem()).thenReturn(system);
/** * Asserts that distributionManagerType is LOCAL, GEMFIRE, or ADMIN_ONLY. Also asserts that the * distributionManagerId (jgroups DistributedMember) has a VmKind that matches. */ private void assertDistributionManagerType() { // Assert that dmType is one of the three DM types... int theDmType = getDMType(); switch (theDmType) { case NORMAL_DM_TYPE: case LONER_DM_TYPE: case ADMIN_ONLY_DM_TYPE: case LOCATOR_DM_TYPE: break; default: Assert.assertTrue(false, "unknown distribution manager type"); } // Assert InternalDistributedMember VmKind matches this DistributionManagerType... final InternalDistributedMember theId = getDistributionManagerId(); final int vmKind = theId.getVmKind(); if (theDmType != vmKind) { Assert.assertTrue(false, "InternalDistributedMember has a vmKind of " + vmKind + " instead of " + theDmType); } }
InternalDistributedMember theId = this.getDistributionManagerId(); m.setDistributionManagerId(theId); Set<InternalDistributedMember> allOthers = new HashSet<>(getViewMembers()); allOthers.remove(getDistributionManagerId()); m.setRecipients(allOthers); logger.trace("{} Sending {} to {}", this.getDistributionManagerId(), m, m.getRecipientsDescription());
@Test public void testProcessWithWaitForCurrentOperationsThatTimesOut() { InternalDistributedMember relayRecipient = mock(InternalDistributedMember.class); ClusterDistributionManager dm = mock(ClusterDistributionManager.class); InternalCache gfc = mock(InternalCache.class); DistributedRegion region = mock(DistributedRegion.class); CacheDistributionAdvisor distributionAdvisor = mock(CacheDistributionAdvisor.class); when(dm.getDistributionManagerId()).thenReturn(relayRecipient); when(dm.getExistingCache()).thenReturn(gfc); when(region.isInitialized()).thenReturn(true); when(region.getDistributionAdvisor()).thenReturn(distributionAdvisor); when(gfc.getRegionByPathForProcessing(any())).thenReturn(region); doThrow(new GemFireIOException("expected in fatal log message")).when(distributionAdvisor) .waitForCurrentOperations(); StateMarkerMessage message = new StateMarkerMessage(); message.relayRecipient = relayRecipient; message.process(dm); verify(dm, times(1)).putOutgoing(any()); } }
@Override protected boolean operateOnPartitionedRegion(ClusterDistributionManager dm, PartitionedRegion r, long startTime) throws CacheException, ForceReattemptException { PartitionedRegionDataStore ds = r.getDataStore(); final long size; if (ds != null) { size = ds.getBucketSize(bucketId); } else { // sender thought this member had a data store, but it doesn't throw new ForceReattemptException(String.format("no datastore in %s", dm.getDistributionManagerId())); } r.getPrStats().endPartitionMessagesProcessing(startTime); BucketSizeReplyMessage.send(getSender(), getProcessorId(), dm, size); return false; }
if (isSingleFlushTo) { ga.sendingMember = dm.getDistributionManagerId(); } else { ga.sendingMember = getSender(); logger.trace(LogMarker.STATE_FLUSH_OP_VERBOSE, "Sending {}", ga); if (requestingMember.equals(dm.getDistributionManagerId())) { ga.dmProcess(dm); } else {
dm.getDistributionManagerId()), rde); } catch (VirtualMachineError err) { SystemFailure.initiateFailure(err);
new ReplyException(new ForceReattemptException( String.format("%s : could not find partitioned region with Id %s", dm.getDistributionManagerId(), Integer.valueOf(regionId)))), dm, r != null && r.isInternalRegion());
MessageLogger.logMessage(this, getSender(), dm.getDistributionManagerId());
event.setLocalFilterInfo(this.filterInfo.getFilterInfo(dm.getDistributionManagerId()));