当前位置: 首页>>代码示例>>Java>>正文


Java DistributedMember.equals方法代码示例

本文整理汇总了Java中org.apache.geode.distributed.DistributedMember.equals方法的典型用法代码示例。如果您正苦于以下问题:Java DistributedMember.equals方法的具体用法?Java DistributedMember.equals怎么用?Java DistributedMember.equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.geode.distributed.DistributedMember的用法示例。


在下文中一共展示了DistributedMember.equals方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: fromData

import org.apache.geode.distributed.DistributedMember; //导入方法依赖的package包/类
/** DataSerializable methods */
public void fromData(DataInput in) throws IOException, ClassNotFoundException {
  DistributedMember myID = null;
  GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
  if (cache != null) {
    myID = cache.getMyId();
  }
  int size = in.readInt();
  for (int i = 0; i < size; i++) {
    InternalDistributedMember member = InternalDistributedMember.readEssentialData(in);
    FilterInfo fInfo = new FilterInfo();
    InternalDataSerializer.invokeFromData(fInfo, in);
    // we only need to retain the recipient's entry
    if (myID == null || myID.equals(member)) {
      this.serverFilterInfo.put(member, fInfo);
    }
  }
}
 
开发者ID:ampool,项目名称:monarch,代码行数:19,代码来源:FilterRoutingInfo.java

示例2: fromDataPre_GFE_7_1_0_0

import org.apache.geode.distributed.DistributedMember; //导入方法依赖的package包/类
public void fromDataPre_GFE_7_1_0_0(DataInput in) throws IOException, ClassNotFoundException {
  DistributedMember myID = null;
  GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
  if (cache != null) {
    myID = cache.getMyId();
  }
  int size = in.readInt();
  for (int i = 0; i < size; i++) {
    InternalDistributedMember member = new InternalDistributedMember();
    InternalDataSerializer.invokeFromData(member, in);
    FilterInfo fInfo = new FilterInfo();
    InternalDataSerializer.invokeFromData(fInfo, in);
    // we only need to retain the recipient's entry
    if (myID == null || myID.equals(member)) {
      this.serverFilterInfo.put(member, fInfo);
    }
  }
}
 
开发者ID:ampool,项目名称:monarch,代码行数:19,代码来源:FilterRoutingInfo.java

示例3: basicGetTXEntry

import org.apache.geode.distributed.DistributedMember; //导入方法依赖的package包/类
@Override
protected RegionEntry basicGetTXEntry(KeyInfo keyInfo) {
  int bucketId = keyInfo.getBucketId();
  if (bucketId == KeyInfo.UNKNOWN_BUCKET) {
    bucketId = PartitionedRegionHelper.getHashKey(this, null, keyInfo.getKey(),
        keyInfo.getValue(), keyInfo.getCallbackArg());
    keyInfo.setBucketId(bucketId);
  }
  if (keyInfo.isCheckPrimary()) {
    DistributedMember primary = getRegionAdvisor().getPrimaryMemberForBucket(bucketId);
    if (!primary.equals(getMyId())) {
      throw new PrimaryBucketException(
          "Bucket " + bucketId + " is not primary. Current primary holder is " + primary);
    }
  }
  BucketRegion br = this.dataStore.getLocalBucketById(bucketId);
  RegionEntry re = br.basicGetEntry(keyInfo.getKey());
  if (re != null && re.isRemoved()) {
    re = null;
  }
  return re;
}
 
开发者ID:ampool,项目名称:monarch,代码行数:23,代码来源:PartitionedRegion.java

示例4: lookupSystemMember

import org.apache.geode.distributed.DistributedMember; //导入方法依赖的package包/类
public SystemMember lookupSystemMember(DistributedMember distributedMember)
    throws AdminException {
  if (distributedMember == null)
    return null;
  SystemMember[] members = getSystemMemberApplications();
  for (int i = 0; i < members.length; i++) {
    if (distributedMember.equals(members[i].getDistributedMember())) {
      return members[i];
    }
  }
  return null;
}
 
开发者ID:ampool,项目名称:monarch,代码行数:13,代码来源:AdminDistributedSystemImpl.java

示例5: hasReceiversFor

import org.apache.geode.distributed.DistributedMember; //导入方法依赖的package包/类
/** check to see if there are still any receiver threads for the given end-point */
protected boolean hasReceiversFor(DistributedMember endPoint) {
  synchronized (this.receivers) {
    for (Iterator it = receivers.iterator(); it.hasNext();) {
      Connection con = (Connection) it.next();
      if (endPoint.equals(con.getRemoteAddress())) {
        return true;
      }
    }
  }
  return false;
}
 
开发者ID:ampool,项目名称:monarch,代码行数:13,代码来源:ConnectionTable.java

示例6: memberDeparted

import org.apache.geode.distributed.DistributedMember; //导入方法依赖的package包/类
public void memberDeparted(final InternalDistributedMember id, final boolean crashed) {
  try {
    DistributedMember dmem = prRegion.getSystem().getDistributedMember();
    if (logger.isDebugEnabled()) {
      logger.debug(
          "MembershipListener invoked on DistributedMember = {} for failed memberId = {}", dmem,
          id);
    }

    if (!prRegion.isCacheClosing() && !prRegion.isDestroyed() && !dmem.equals(id)) {

      Runnable postRecoveryTask = null;

      // Only schedule redundancy recovery if this not a fixed PR.
      if (!PRHARedundancyProvider.this.prRegion.isFixedPartitionedRegion()) {
        postRecoveryTask = new Runnable() {
          public void run() {
            // After the metadata has been cleaned, recover redundancy.
            scheduleRedundancyRecovery(id);
          }
        };
      }
      // Schedule clean up the metadata for the failed member.
      PartitionedRegionHelper.cleanUpMetaDataForRegion(prRegion.getCache(),
          prRegion.getRegionIdentifier(), id, postRecoveryTask);
    }
  } catch (CancelException e) {
    // ignore
  }
}
 
开发者ID:ampool,项目名称:monarch,代码行数:31,代码来源:PRHARedundancyProvider.java

示例7: executeFunction

import org.apache.geode.distributed.DistributedMember; //导入方法依赖的package包/类
/**
 * Execute the provided named function in all locations that contain the given keys. So function
 * can be executed on just one fabric node, executed in parallel on a subset of nodes in parallel
 * across all the nodes.
 * 
 * @param function
 * @param args
 * @since GemFire 5.8
 */
@Override
public ResultCollector executeFunction(final DistributedRegionFunctionExecutor execution,
    final Function function, final Object args, final ResultCollector rc, final Set filter,
    final ServerToClientFunctionResultSender sender) {
  DistributedMember target = getTransactionalNode();
  if (target != null) {
    if (target.equals(getMyId())) {
      return executeLocally(execution, function, args, 0, rc, filter, sender);
    }
    return executeOnReplicate(execution, function, args, rc, filter, target);
  } else if (this.getAttributes().getDataPolicy().withReplication()
      || this.getAttributes().getDataPolicy().withPreloaded()) {
    // execute locally
    final Set<InternalDistributedMember> singleMember = Collections.singleton(getMyId());
    execution.validateExecution(function, singleMember);
    execution.setExecutionNodes(singleMember);
    return executeLocally(execution, function, args, 0, rc, filter, sender);
  } else {
    // select a random replicate
    target = getRandomReplicate();
    if (target == null) {
      throw new FunctionException(
          LocalizedStrings.DistributedRegion_NO_REPLICATED_REGION_FOUND_FOR_EXECUTING_FUNCTION_0
              .toLocalizedString(function.getId()));
    }
  }
  final LocalResultCollector<?, ?> localRC = execution.getLocalResultCollector(function, rc);
  return executeOnReplicate(execution, function, args, localRC, filter, target);
}
 
开发者ID:ampool,项目名称:monarch,代码行数:39,代码来源:DistributedRegion.java

示例8: getOldestMember

import org.apache.geode.distributed.DistributedMember; //导入方法依赖的package包/类
public DistributedMember getOldestMember(Collection members) throws NoSuchElementException {
  if (members.size() == 1) {
    DistributedMember member = (DistributedMember) members.iterator().next();
    if (member.equals(viewMembers.get(0))) {
      return member;
    }
  }
  throw new NoSuchElementException(
      LocalizedStrings.LonerDistributionManager_MEMBER_NOT_FOUND_IN_MEMBERSHIP_SET
          .toLocalizedString());
}
 
开发者ID:ampool,项目名称:monarch,代码行数:12,代码来源:LonerDistributionManager.java

示例9: requestMemberRemoval

import org.apache.geode.distributed.DistributedMember; //导入方法依赖的package包/类
public boolean requestMemberRemoval(DistributedMember mbr, String reason) {
  if (mbr.equals(this.address)) {
    return false;
  }
  logger.warn(LocalizedMessage.create(
      LocalizedStrings.GroupMembershipService_MEMBERSHIP_REQUESTING_REMOVAL_OF_0_REASON_1,
      new Object[] {mbr, reason}));
  try {
    services.getJoinLeave().remove((InternalDistributedMember) mbr, reason);
  } catch (RuntimeException e) {
    Throwable problem = e;
    if (services.getShutdownCause() != null) {
      Throwable cause = services.getShutdownCause();
      // If ForcedDisconnectException occurred then report it as actual
      // problem.
      if (cause instanceof ForcedDisconnectException) {
        problem = cause;
      } else {
        Throwable ne = problem;
        while (ne.getCause() != null) {
          ne = ne.getCause();
        }
        try {
          ne.initCause(services.getShutdownCause());
        } catch (IllegalArgumentException selfCausation) {
          // fix for bug 38895 - the cause is already in place
        }
      }
    }
    if (!services.getConfig().getDistributionConfig().getDisableAutoReconnect()) {
      saveCacheXmlForReconnect();
    }
    listener.membershipFailure("Channel closed", problem);
    throw new DistributedSystemDisconnectedException("Channel closed", problem);
  }
  return true;
}
 
开发者ID:ampool,项目名称:monarch,代码行数:38,代码来源:GMSMembershipManager.java

示例10: fromData

import org.apache.geode.distributed.DistributedMember; //导入方法依赖的package包/类
public void fromData(DataInput in) throws IOException, ClassNotFoundException {
  DistributedSystem ds = InternalDistributedSystem.getAnyInstance();
  DistributedMember me = ds.getDistributedMember();
  DistributedMember hb = (DistributedMember) DataSerializer.readObject(in);
  if (me.equals(hb)) {
    ds.getLogWriter().info("HomeBoy was deserialized on his home");
  } else {
    String msg = "HomeBoy was deserialized on " + me + " instead of his home " + hb;
    ds.getLogWriter().error(msg);
    throw new IllegalStateException(msg);
  }
}
 
开发者ID:ampool,项目名称:monarch,代码行数:13,代码来源:Bug38013DUnitTest.java

示例11: validateNodeFailMetaDataCleanUp

import org.apache.geode.distributed.DistributedMember; //导入方法依赖的package包/类
/**
 * Returns CacheSerializableRunnable to validate the Failed node config metadata.
 *
 * @param dsMember Failed DistributedMember
 *
 * @return CacheSerializableRunnable
 */
private CacheSerializableRunnable validateNodeFailMetaDataCleanUp(
    final DistributedMember dsMember) {
  SerializableRunnable validator =
      new CacheSerializableRunnable("validateNodeFailMetaDataCleanUp") {
        public void run2() throws CacheException {
          Cache cache = getCache();
          Region rootReg = PartitionedRegionHelper.getPRRoot(cache);
          CacheListener[] cls = rootReg.getAttributes().getCacheListeners();
          assertEquals(2, cls.length);
          CertifiableTestCacheListener ctcl = (CertifiableTestCacheListener) cls[1];

          LogWriterUtils.getLogWriter()
              .info("Listener update (" + ctcl.updates.size() + "): " + ctcl.updates);
          LogWriterUtils.getLogWriter()
              .info("Listener destroy: (" + ctcl.destroys.size() + "): " + ctcl.destroys);

          Iterator itrator = rootReg.keySet().iterator();
          for (Iterator itr = itrator; itr.hasNext();) {
            String prName = (String) itr.next();
            ctcl.waitForUpdated(prName);

            Object obj = rootReg.get(prName);
            if (obj != null) {
              PartitionRegionConfig prConf = (PartitionRegionConfig) obj;
              Set<Node> nodeList = prConf.getNodes();
              Iterator itr2 = nodeList.iterator();
              while (itr2.hasNext()) {
                DistributedMember member = ((Node) itr2.next()).getMemberId();
                if (member.equals(dsMember)) {
                  fail("Failed DistributedMember's = " + member
                      + " global meta data not cleared. For PR Region = " + prName);
                }
              }
            }
          }
        }
      };
  return (CacheSerializableRunnable) validator;
}
 
开发者ID:ampool,项目名称:monarch,代码行数:47,代码来源:PartitionedRegionHAFailureAndRecoveryDUnitTest.java

示例12: getKeyOnMember

import org.apache.geode.distributed.DistributedMember; //导入方法依赖的package包/类
/**
 * @return first key found on the given member
 */
CustId getKeyOnMember(final DistributedMember owner, PartitionedRegion pr) {
  CustId retVal = null;
  for (int i = 0; i < 5; i++) {
    CustId custId = new CustId(i);
    DistributedMember member = pr.getOwnerForKey(pr.getKeyInfo(custId));
    if (member.equals(owner)) {
      retVal = custId;
      break;
    }
  }
  return retVal;
}
 
开发者ID:ampool,项目名称:monarch,代码行数:16,代码来源:RemoteTransactionDUnitTest.java

示例13: debugContains

import org.apache.geode.distributed.DistributedMember; //导入方法依赖的package包/类
String debugContains(final DistributedMember member) {
  StringBuilder sb = new StringBuilder();
  for (DistributedMember peer : getMembers()) {
    if (!peer.equals(member)) {
      InternalDistributedMember peerIDM = (InternalDistributedMember) peer;
      InternalDistributedMember memberIDM = (InternalDistributedMember) member;
      sb.append("peer port=").append(peerIDM.getPort()).append(" ");
      sb.append("member port=").append(memberIDM.getPort()).append(" ");
    }
  }
  return sb.toString();
}
 
开发者ID:ampool,项目名称:monarch,代码行数:13,代码来源:StatisticsDistributedTest.java


注:本文中的org.apache.geode.distributed.DistributedMember.equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。