Send ServiceInstance heartbeats.

@param heartbeatMap
the ServiceInstances heartbeat Map.
778147
public Map<String, OperationResult<String>> sendHeartBeat(Map<String, ServiceInstanceHeartbeat> heartbeatMap){
        String body = _serialize(heartbeatMap);
        HttpResponse result = invoker.invoke("/service/heartbeat", body,
                HttpMethod.PUT);

        if (result.getHttpCode() != HTTP_OK) {
           throw new ServiceException(ErrorCode.REMOTE_DIRECTORY_SERVER_ERROR,
                    "HTTP Code is not OK, code=%s", result.getHttpCode());
        }

        Map<String, OperationResult<String>> operateResult = _deserialize(
                result.getRetBody(), new TypeReference<Map<String, OperationResult<String>>>(){});
        return operateResult;

    }
402191
public void setMap(Map map) {
		this.map = (MapImpl) map;
		mapWidget = this.map.getMapWidget();
		delegate = new GeometryEditorImpl(mapWidget);
		editingService = new JsGeometryEditService(delegate.getEditService());
		splitService = new JsGeometrySplitService(delegate.getEditService());
		mergeService = new JsGeometryMergeService();
		renderer = new JsGeometryRenderer(delegate.getRenderer());
		styleService = new JsStyleService(delegate.getStyleService());
		snapService = new JsSnapService(this);
	}
266902
public void addStatusMapping(Map<String, Integer> statusMapping) {
		Assert.notNull(statusMapping, "StatusMapping must not be null");
		this.statusMapping.putAll(statusMapping);
	}
342270
public void sendHeartBeat(String ipAddress, int port) throws Exception {
    	MBeanServer mbeanServer = getMBeanServer();
			
		Set<ObjectName> queryNames = mbeanServer.queryNames(new ObjectName("*:type=Service,*"), null);
		for(ObjectName objectName : queryNames) {								
			mbeanServer.invoke(objectName, "sendHeartBeat", new Object[]{this.ipAddress, this.port, this.transport, ipAddress, port}, new String[] {String.class.getName() , "int", String.class.getName(), String.class.getName() , "int"});
		} 
			   
    }
831035
@Override
  public ServerHeartbeat server(String address,
                                int port,
                                boolean isSSL,
                                String clusterId,
                                String displayName,
                                boolean isDynamic)
  {
    Objects.requireNonNull(address);
    Objects.requireNonNull(clusterId);
    
    if (address.isEmpty()) {
      address = "127.0.0.1";
    }

    /*
    if (port <= 0) {
      throw new IllegalArgumentException();
    }
    */
    
    ClusterHeartbeat cluster = createCluster(clusterId);
    
    ServerHeartbeat server;
    
    if (isDynamic) {
      server = cluster.createDynamicServer(address, port, isSSL);
    }
    else {
      server = cluster.createServer(address, port, isSSL);
    }
    
    if (displayName != null) {
      server.setDisplayName(displayName);
    }
    
    if (! isDynamic) {
      cluster.addSeedServer(server);
    }
    
    return server;
  }
358630
private void setHeartbeatInterval(long heartbeatInterval,
                                    long heartbeatRecheckInterval) {
    this.heartbeatInterval = heartbeatInterval;
    this.heartbeatRecheckInterval = heartbeatRecheckInterval;
    this.heartbeatExpireInterval = 2 * heartbeatRecheckInterval +
      10 * heartbeatInterval;
    ReplicationConfigKeys.blockInvalidateLimit =
      Math.max(ReplicationConfigKeys.blockInvalidateLimit,
               20 * (int) (heartbeatInterval/1000L));
    
  }
1330432
public final CompletableFuture<Integer> sendMap(boolean last, Object... messages) {
        return send(true, messages, last);
    }
986363
public void setApplicationMap(final Map<String, Object> applicationMap) {
		JKThreadLocal.setValue(JKContextConstants.APPLICATION_MAP, applicationMap);
	}
1113789
public void acknowledgeHeartBeat( Instance scopedInstance ) {

		String count = scopedInstance.data.get( MISSED_HEARTBEATS );
		if( count != null
				&& Integer.parseInt( count ) > THRESHOLD )
			this.logger.info( "Agent " + InstanceHelpers.computeInstancePath( scopedInstance ) + " is alive and reachable again." );

		// Store the moment the first ACK (without interruption) was received.
		// If we were deploying, store it.
		// If we were in problem, store it.
		// If we were already deployed and started, do NOT override it.
		if( scopedInstance.getStatus() != InstanceStatus.DEPLOYED_STARTED
				|| ! scopedInstance.data.containsKey( Instance.RUNNING_FROM ))
			scopedInstance.data.put( Instance.RUNNING_FROM, String.valueOf( new Date().getTime()));

		scopedInstance.setStatus( InstanceStatus.DEPLOYED_STARTED );
		scopedInstance.data.remove( MISSED_HEARTBEATS );
	}
550682
function sendHeartbeat() {
    _.forOwn(_this.socks, function (sock) {
      sock.write('hb');
    });
    setTimeout(sendHeartbeat, _this.heartbeatFreq);
  }
587642
private void sendHeartbeat(WebSocket websocket) {
        ObjectNode heartbeatPacket = JsonNodeFactory.instance.objectNode();
        heartbeatPacket.put("op", GatewayOpcode.HEARTBEAT.getCode());
        heartbeatPacket.put("d", lastSeq);
        WebSocketFrame heartbeatFrame = WebSocketFrame.createTextFrame(heartbeatPacket.toString());
        nextHeartbeatFrame.set(heartbeatFrame);
        websocket.sendFrame(heartbeatFrame);
    }
933765
void onHeartbeat(Member member, long timestamp) {
        if (!heartbeatAwareQuorumFunction) {
            return;
        }
        ((HeartbeatAware) quorumFunction).onHeartbeat(member, timestamp);
    }
914394
private synchronized void sendHeartBeat(
      final EvaluatorRuntimeProtocol.EvaluatorHeartbeatProto heartbeatProto) {
    if (LOG.isLoggable(Level.FINEST)) {
      LOG.log(Level.FINEST, "Heartbeat message:\n" + heartbeatProto, new Exception("Stack trace"));
    }
    this.evaluatorHeartbeatHandler.onNext(heartbeatProto);
  }
270590
def _send_heartbeat_request(self):
        """"""
        if self.coordinator_unknown():
            e = Errors.GroupCoordinatorNotAvailableError(self.coordinator_id)
            return Future().failure(e)

        elif not self._client.ready(self.coordinator_id, metadata_priority=False):
            e = Errors.NodeNotReadyError(self.coordinator_id)
            return Future().failure(e)

        version = 0 if self.config['api_version'] < (0, 11, 0) else 1
        request = HeartbeatRequest[version](self.group_id,
                                            self._generation.generation_id,
                                            self._generation.member_id)
        log.debug("Heartbeat: %s[%s] %s", request.group, request.generation_id, request.member_id)  # pylint: disable-msg=no-member
        future = Future()
        _f = self._client.send(self.coordinator_id, request)
        _f.add_callback(self._handle_heartbeat_response, future, time.time())
        _f.add_errback(self._failed_request, self.coordinator_id,
                       request, future)
        return future
56373
public void setHeartbeatInterval(short heartbeatInterval)
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setHeartbeatInterval");
      properties.put(HEARTBEAT_INTERVAL, heartbeatInterval);
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setHeartbeatInterval", ""+heartbeatInterval);
   }
696010
@Override
  public void heartbeat() {
    // Prepare metadata for the next heartbeat
    BlockHeartbeatReport blockReport = mBlockWorker.getReport();
    BlockStoreMeta storeMeta = mBlockWorker.getStoreMeta();

    // Send the heartbeat and execute the response
    Command cmdFromMaster = null;
    List<alluxio.grpc.Metric> metrics = new ArrayList<>();
    for (Metric metric : MetricsSystem.allWorkerMetrics()) {
      metrics.add(metric.toProto());
    }
    try {
      cmdFromMaster = mMasterClient.heartbeat(mWorkerId.get(), storeMeta.getCapacityBytesOnTiers(),
          storeMeta.getUsedBytesOnTiers(), blockReport.getRemovedBlocks(),
          blockReport.getAddedBlocks(), blockReport.getLostStorage(), metrics);
      handleMasterCommand(cmdFromMaster);
      mLastSuccessfulHeartbeatMs = System.currentTimeMillis();
    } catch (IOException | ConnectionFailedException e) {
      // An error occurred, log and ignore it or error if heartbeat timeout is reached
      if (cmdFromMaster == null) {
        LOG.error("Failed to receive master heartbeat command.", e);
      } else {
        LOG.error("Failed to receive or execute master heartbeat command: {}",
            cmdFromMaster.toString(), e);
      }
      mMasterClient.disconnect();
      if (mHeartbeatTimeoutMs > 0) {
        if (System.currentTimeMillis() - mLastSuccessfulHeartbeatMs >= mHeartbeatTimeoutMs) {
          if (ServerConfiguration.getBoolean(PropertyKey.TEST_MODE)) {
            throw new RuntimeException("Master heartbeat timeout exceeded: " + mHeartbeatTimeoutMs);
          }
          // TODO(andrew): Propagate the exception to the main thread and exit there.
          ProcessUtils.fatalError(LOG, "Master heartbeat timeout exceeded: %d",
              mHeartbeatTimeoutMs);
        }
      }
    }
  }
1289245
private CompletableFuture<Void> sendHeartbeats() {
    checkMetadata();
    Stream<GossipMember> clusterMembers = members.values().stream()
        .filter(member -> !member.id().equals(localMember.id()));

    Stream<GossipMember> providerMembers = discoveryService.getNodes().stream()
        .filter(node -> !members.containsKey(MemberId.from(node.id().id())))
        .map(node -> new GossipMember(MemberId.from(node.id().id()), node.address()));

    return Futures.allOf(Stream.concat(clusterMembers, providerMembers)
        .map(member -> {
          LOGGER.trace("{} - Sending heartbeat: {}", localMember.id(), member);
          return sendHeartbeat(member).exceptionally(v -> null);
        }).collect(Collectors.toList()))
        .thenApply(v -> null);
  }