collectOnlineNodes() {
		// Get the current node list so that we can check the disconnected nodes.
		const prevNodes = this.registry.nodes
			.list({ onlyAvailable: true, withServices: false })
			.map(node => node.id)
			.filter(nodeID => nodeID !== this.broker.nodeID);

		// Collect the online node keys.
		return this.Promise.resolve()
			.then(() => {
				if (this.opts.fullCheck && ++this.idx % this.opts.fullCheck == 0) {
					// Full check
					//this.logger.debug("Full check", this.idx);
					this.idx = 0;

					return this.client
						.getAll()
						.prefix(`${this.PREFIX}/beats/`)
						.buffers()
						.then(result =>
							Object.values(result).map(raw => {
								try {
									return this.serializer.deserialize(raw, P.PACKET_INFO);
								} catch (err) {
									this.logger.warn("Unable to parse HEARTBEAT packet", err, raw);
								}
							})
						);
				} else {
					//this.logger.debug("Lazy check", this.idx);
					// Lazy check
					return this.client
						.getAll()
						.prefix(`${this.PREFIX}/beats/`)
						.keys()
						.then(keys =>
							keys.map(key => {
								const p = key.substring(`${this.PREFIX}/beats/`.length).split("/");
								return {
									key,
									sender: p[0],
									instanceID: p[1],
									seq: Number(p[2])
								};
							})
						);
				}
			})

			.then(packets => {
				_.compact(packets).map(packet => {
					if (packet.sender == this.broker.nodeID) return;

					removeFromArray(prevNodes, packet.sender);
					this.heartbeatReceived(packet.sender, packet);
				});
			})

			.then(() => {
				if (prevNodes.length > 0) {
					// Disconnected nodes
					prevNodes.map(nodeID => {
						this.logger.info(
							`The node '${nodeID}' is not available. Removing from registry...`
						);
						this.remoteNodeDisconnected(nodeID, true);
					});
				}
			});
	}
Collect online nodes from etcd server.