Package com.google.dataconnector.protocol.proto.SdcFrame

Examples of com.google.dataconnector.protocol.proto.SdcFrame.HealthCheckInfo


                                        .build()).build();

                getFrameSender().sendFrame(FrameInfo.Type.REGISTRATION,
                        registrationResponse.toByteString());
            } else if (frameInfo.getType() == Type.HEALTH_CHECK) {
                HealthCheckInfo healthCheckResponse = HealthCheckInfo
                        .newBuilder()
                        .setSource(Source.SERVER)
                        .setTimeStamp(System.currentTimeMillis())
                        .setType(
                                com.google.dataconnector.protocol.proto.SdcFrame.HealthCheckInfo.Type.RESPONSE)
                        .build();

                if (getLogger().isLoggable(Level.FINE)) {
                    getLogger()
                            .log(Level.FINE,
                                    "SDC health check received: "
                                            + healthCheckResponse);
                }

                // Reply to the check
                getFrameSender().sendFrame(Type.HEALTH_CHECK,
                        healthCheckResponse.toByteString());
            } else if (getLogger().isLoggable(Level.FINE)) {
                getLogger().log(Level.FINE,
                        "Unexpected SDC frame received: " + frameInfo);
            }
        } catch (InvalidProtocolBufferException e) {
View Full Code Here


      if (!(actual instanceof ByteString)) {
        return false;
      }
      ByteString actualPayload = (ByteString) actual;
      try {
        HealthCheckInfo actualHci = HealthCheckInfo.parseFrom(actualPayload);
        if (actualHci.getSource() != HealthCheckInfo.Source.CLIENT) {
          return false;
        } else if (actualHci.getType() != HealthCheckInfo.Type.REQUEST) {
          return false;
        } else if (actualHci.getTimeStamp() != FAKE_TIME_STAMP) {
          return false;
        }
        return true;
      } catch (InvalidProtocolBufferException e) {
        return false;
View Full Code Here

      // first health check response.
      lastHealthCheckReceivedStamp = clock.currentTimeMillis();

      // We send a healthcheck request every X seconds (configurable in localconf)
      while (true) {
        final HealthCheckInfo hci = HealthCheckInfo.newBuilder()
            .setSource(HealthCheckInfo.Source.CLIENT)
            .setTimeStamp(clock.currentTimeMillis())
            .setType(HealthCheckInfo.Type.REQUEST)
            .build();
        LOG.debug("Sending health check request");
        frameSender.sendFrame(SdcFrame.FrameInfo.Type.HEALTH_CHECK, hci.toByteString());
        sleep(serverSuppliedConf.getHealthCheckWakeUpInterval() * 1000);


        // Every send interval we check to see if we have timed out.  Sending is reliable as
        // it uses a large blocking queue to send frames.  Therefore we can re-use the send
View Full Code Here

TOP

Related Classes of com.google.dataconnector.protocol.proto.SdcFrame.HealthCheckInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.