com.gemstone.gemfire.cache.client.internal.locator.QueueConnectionRequest类的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.2k)|赞(0)|评价(0)|浏览(57)

本文整理了Java中com.gemstone.gemfire.cache.client.internal.locator.QueueConnectionRequest类的一些代码示例,展示了QueueConnectionRequest类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QueueConnectionRequest类的具体详情如下:
包路径:com.gemstone.gemfire.cache.client.internal.locator.QueueConnectionRequest
类名称:QueueConnectionRequest

QueueConnectionRequest介绍

[英]A request from a client to locator asking for a server to host a queue. If the durable client Id is specified, the locator will attempt to discover a pre-existing queue.
[中]客户端向定位器发出的请求,请求服务器托管队列。如果指定了持久客户端Id,定位器将尝试发现预先存在的队列。

代码示例

代码示例来源:origin: io.snappydata/gemfire-core

@Override
public String toString() {
 return "QueueConnectionRequest{group=" + getServerGroup() + ", excluded="
   + getExcludedServers() + ", redundant= " + redundantCopies
   + ",findDurable=" + findDurable + ",proxyId=" + proxyId + "}";
}

代码示例来源:origin: io.snappydata/gemfire-core

private Object pickQueueServers(QueueConnectionRequest clientRequest) {
 Set excludedServers = new HashSet(clientRequest.getExcludedServers());
 if(clientRequest.isFindDurable() && clientRequest.getProxyId().isDurable()) {
  servers = FindDurableQueueProcessor.sendAndFind(this, clientRequest.getProxyId(), getDistributionManager());
 if(clientRequest.getRedundantCopies() == -1) {
  candidates = loadSnapshot.getServersForQueue(clientRequest.getProxyId(),
                         clientRequest.getServerGroup(),
                         excludedServers,-1);
 } else if(clientRequest.getRedundantCopies() > servers.size()) {
  int count = clientRequest.getRedundantCopies() - servers.size();
  candidates = loadSnapshot.getServersForQueue(clientRequest.getProxyId(),
                         clientRequest.getServerGroup(),
                         excludedServers,
                         count);

代码示例来源:origin: io.snappydata/gemfire-junit

private void doServerLocation() throws Exception {
 {
  ClientConnectionRequest request = new ClientConnectionRequest(Collections.EMPTY_SET, "group1");
  ClientConnectionResponse response = (ClientConnectionResponse) TcpClient.requestToServer(InetAddress.getLocalHost(), port, request, REQUEST_TIMEOUT);
  Assert.assertEquals(null, response.getServer());
 }
 {
  QueueConnectionRequest request = new QueueConnectionRequest(ClientProxyMembershipID.getNewProxyMembership(InternalDistributedSystem.getAnyInstance()), 3, Collections.EMPTY_SET, "group1",true);
  QueueConnectionResponse response = (QueueConnectionResponse) TcpClient.requestToServer(InetAddress.getLocalHost(), port, request, REQUEST_TIMEOUT);
  Assert.assertEquals(new ArrayList(), response.getServers());
  Assert.assertFalse(response.isDurableQueueFound());
 }
}

代码示例来源:origin: org.apache.geode/gemfire-core

private Object pickQueueServers(QueueConnectionRequest clientRequest) {
 Set excludedServers = new HashSet(clientRequest.getExcludedServers());
 if(clientRequest.isFindDurable() && clientRequest.getProxyId().isDurable()) {
  servers = FindDurableQueueProcessor.sendAndFind(this, clientRequest.getProxyId(), getDistributionManager());
 if(clientRequest.getRedundantCopies() == -1) {
  candidates = loadSnapshot.getServersForQueue(clientRequest.getProxyId(),
                         clientRequest.getServerGroup(),
                         excludedServers,-1);
 } else if(clientRequest.getRedundantCopies() > servers.size()) {
  int count = clientRequest.getRedundantCopies() - servers.size();
  candidates = loadSnapshot.getServersForQueue(clientRequest.getProxyId(),
                         clientRequest.getServerGroup(),
                         excludedServers,
                         count);

代码示例来源:origin: io.snappydata/gemfire-core

public List/* ServerLocation */findServersForQueue(      
   Set/* <ServerLocation> */excludedServers, int numServers,
   ClientProxyMembershipID proxyId, boolean findDurableQueue) {
  if(PoolImpl.TEST_DURABLE_IS_NET_DOWN) {
   return new ArrayList();
  }
  QueueConnectionRequest request  = new QueueConnectionRequest(proxyId,numServers,excludedServers, serverGroup,findDurableQueue);
  QueueConnectionResponse response = (QueueConnectionResponse) queryLocators(request);
  if (response==null) {
   // why log a warning if we are going to throw the caller and exception?
   //getLogger().warning("Unable to connect to any locators in the list " + locators);
   throw new NoAvailableLocatorsException("Unable to connect to any locators in the list " + locators);
  }
  //TODO - do this logic on the server side, return one list in the message.
  List result = response.getServers();
//    if(getLogger().fineEnabled()) {
//      getLogger().fine("Received queue connection response with server " + result+" excludeList:"+excludedServers);
//    }
  
  return result;
 }

代码示例来源:origin: org.apache.geode/gemfire-core

public List/* ServerLocation */findServersForQueue(      
   Set/* <ServerLocation> */excludedServers, int numServers,
   ClientProxyMembershipID proxyId, boolean findDurableQueue) {
  if(PoolImpl.TEST_DURABLE_IS_NET_DOWN) {
   return new ArrayList();
  }
  QueueConnectionRequest request  = new QueueConnectionRequest(proxyId,numServers,excludedServers, serverGroup,findDurableQueue);
  QueueConnectionResponse response = (QueueConnectionResponse) queryLocators(request);
  if (response==null) {
   // why log a warning if we are going to throw the caller and exception?
   //getLogger().warning("Unable to connect to any locators in the list " + locators);
   throw new NoAvailableLocatorsException("Unable to connect to any locators in the list " + locators);
  }
  //TODO - do this logic on the server side, return one list in the message.
  List result = response.getServers();
//    if(getLogger().fineEnabled()) {
//      getLogger().fine("Received queue connection response with server " + result+" excludeList:"+excludedServers);
//    }
  
  return result;
 }

代码示例来源:origin: org.apache.geode/gemfire-core

@Override
public String toString() {
 return "QueueConnectionRequest{group=" + getServerGroup() + ", excluded="
   + getExcludedServers() + ", redundant= " + redundantCopies
   + ",findDurable=" + findDurable + ",proxyId=" + proxyId + "}";
}

代码示例来源:origin: io.snappydata/gemfire-hydra-tests

response2 = (QueueConnectionResponse) TcpClient.requestToServer(InetAddress
  .getByName(getServerHostName(host)), locatorPort,
  new QueueConnectionRequest(null, 2,
    Collections.EMPTY_SET, null, false), 10000, true);
Assert.assertEquals(Collections.singletonList(expectedLocation), response2.getServers());
    locatorPort, new QueueConnectionRequest(null, 5, Collections.EMPTY_SET, null,
      false), 10000, true);

代码示例来源:origin: io.snappydata/gemfire-core

() -> new ClientConnectionResponse());
registerDSFID(QUEUE_CONNECTION_REQUEST,
  () -> new QueueConnectionRequest());
registerDSFID(QUEUE_CONNECTION_RESPONSE,
  () -> new QueueConnectionResponse());

相关文章