/** * Return ProtocolVersion from a string of version value. * Throw Runtime exception if it is unrecognized version. */ static ProtocolVersion fromThrift(String v) { if (isValidVersionFormat(v)) { return new ProtocolVersion(v); } throw new RuntimeException("Unrecognized version format: " + v); }
protocolVersion_ = ThriftUtils.fromThrift(plannerClient_.GetProtocolVersion()); LOG.debug("Connected to RecordServicePlanner with version: " + protocolVersion_); if (!protocolVersion_.isValidProtocolVersion()) { String errorMsg = "Current RecordServiceClient does not support server protocol version: " + protocolVersion_.getVersion(); LOG.warn(errorMsg); throw new RecordServiceException(errorMsg, new TRecordServiceException());
protocolVersion_ = ThriftUtils.fromThrift(workerClient_.GetProtocolVersion()); LOG.debug("Connected to RecordServiceWorker with version: " + protocolVersion_); if (!protocolVersion_.isValidProtocolVersion()) { String errorMsg = "Current RecordServiceClient does not support server protocol version: " + protocolVersion_.getVersion(); LOG.warn(errorMsg); throw new RecordServiceException(errorMsg, new TRecordServiceException());