private List<NodeGroupState> getNodeGroupStates() { TestRequestSender sender = getTestRequestSender(); String nodeGroupPath = getNodeGroupPath(); List<Operation> nodeGroupOps = this.hosts.stream() .map(host -> UriUtils.buildUri(host.getUri(), nodeGroupPath)) .map(Operation::createGet) .collect(toList()); return sender.sendAndWait(nodeGroupOps, NodeGroupState.class); }
private List<NodeGroupState> getNodeGroupStates() { TestRequestSender sender = getTestRequestSender(); String nodeGroupPath = getNodeGroupPath(); List<Operation> nodeGroupOps = this.hosts.stream() .map(host -> UriUtils.buildUri(host.getUri(), nodeGroupPath)) .map(Operation::createGet) .collect(toList()); return sender.sendAndWait(nodeGroupOps, NodeGroupState.class); }
/** * Create a node group service instance on each of the attached hosts */ public TestNodeGroupManager createNodeGroup() { List<Operation> ops = this.hosts.stream() .map(host -> UriUtils.buildUri(host.getUri(), ServiceUriPaths.NODE_GROUP_FACTORY)) .map(uri -> { NodeGroupState body = new NodeGroupState(); body.documentSelfLink = this.nodeGroupName; return Operation.createPost(uri).setBodyNoCloning(body); }) .collect(toList()); // choose one peer and send all request in parallel then wait. getTestRequestSender().sendAndWait(ops); return this; }
/** * Create a node group service instance on each of the attached hosts */ public TestNodeGroupManager createNodeGroup() { List<Operation> ops = this.hosts.stream() .map(host -> UriUtils.buildUri(host.getUri(), ServiceUriPaths.NODE_GROUP_FACTORY)) .map(uri -> { NodeGroupState body = new NodeGroupState(); body.documentSelfLink = this.nodeGroupName; return Operation.createPost(uri).setBodyNoCloning(body); }) .collect(toList()); // choose one peer and send all request in parallel then wait. getTestRequestSender().sendAndWait(ops); return this; }
TestRequestSender sender = getTestRequestSender();
TestRequestSender sender = getTestRequestSender();
Operation selectPost = Operation.createPost(peer, nodeSelector).setBody(body); Operation selectResponse = getTestRequestSender().sendAndWait(selectPost); SelectOwnerResponse selectOwnerResponse = selectResponse .getBody(SelectOwnerResponse.class); Operation statsOp = Operation.createGet(factoryOwnerServiceStatsUri); ServiceStats stats = getTestRequestSender().sendAndWait(statsOp, ServiceStats.class); return isServiceStatAvailable(stats);
Operation selectPost = Operation.createPost(peer, nodeSelector).setBody(body); Operation selectResponse = getTestRequestSender().sendAndWait(selectPost); SelectOwnerResponse selectOwnerResponse = selectResponse .getBody(SelectOwnerResponse.class); Operation statsOp = Operation.createGet(factoryOwnerServiceStatsUri); ServiceStats stats = getTestRequestSender().sendAndWait(statsOp, ServiceStats.class); return isServiceStatAvailable(stats);
TestRequestSender sender = getTestRequestSender(); String nodeGroupPath = getNodeGroupPath(); Operation nodeGroupStateGetOp = Operation.createGet(host, nodeGroupPath);
TestRequestSender sender = getTestRequestSender(); String nodeGroupPath = getNodeGroupPath(); Operation nodeGroupStateGetOp = Operation.createGet(host, nodeGroupPath);