Get file info: decide which rpc to call based on protocol version
505818
private FileStatus versionBasedGetFileInfo(String src) throws IOException {
    if (namenodeVersion >= ClientProtocol.OPTIMIZE_FILE_STATUS_VERSION) {
      return HdfsFileStatus.toFileStatus(namenode.getHdfsFileInfo(src), src);
    } else {
      return namenode.getFileInfo(src);
    }
  }
993621
async def rpc_server_info(self, request):
        '''
        '''
        info = await send('arbiter', 'info')
        info = self.extra_server_info(request, info)
        try:
            info = await info
        except TypeError:
            pass
        return info
295468
def _get_operation_rpc(self):
        
        request_pb = operations_pb2.GetOperationRequest(name=self.name)
        return self.client._operations_stub.GetOperation(request_pb)
829755
def rpc_get_definition(self, filename, source, offset):
        
        return self._call_backend("rpc_get_definition", None, filename,
                                  get_source(source), offset)
772005
def do_version():
    """"""
    v = ApiPool.ping.model.Version(
        name=ApiPool().current_server_name,
        version=ApiPool().current_server_api.get_version(),
        container=get_container_version(),
    )
    log.info("/version: " + pprint.pformat(v))
    return v
1109276
async def _get_protocol(self):
        """"""
        if self._protocol is None:
            self._protocol = asyncio.Task(Context.create_client_context(
                loop=self._loop))
        return (await self._protocol)
437235
def get_version_id(protocol_version):
    
    ver = registry.version_info.get(protocol_version)
    if ver:
        return ver.version_id
837970
def get_file_client(opts, pillar=False):
    '''
    
    '''
    client = opts.get('file_client', 'remote')
    if pillar and client == 'local':
        client = 'pillar'
    return {
        'remote': RemoteClient,
        'local': FSClient,
        'pillar': PillarClient,
    }.get(client, RemoteClient)(opts)
269982
async def SetFilesystemInfo(self, filesystems):
        '''
        
        '''
        # map input types to rpc msg
        _params = dict()
        msg = dict(type='StorageProvisioner',
                   request='SetFilesystemInfo',
                   version=3,
                   params=_params)
        _params['filesystems'] = filesystems
        reply = await self.rpc(msg)
        return reply
2203
public int getDataTransferProtocolVersion() throws IOException {
    synchronized (dataTransferVersion) {
      if (dataTransferVersion == -1) {
        // Get the version number from NN
        try {
          int remoteDataTransferVersion = namenode.getDataTransferProtocolVersion();
          updateDataTransferProtocolVersionIfNeeded(remoteDataTransferVersion);
        } catch (RemoteException re) {
          IOException ioe = re.unwrapRemoteException(IOException.class);
          if (ioe.getMessage().startsWith(IOException.class.getName() + ": " +
              NoSuchMethodException.class.getName())) {
            dataTransferVersion = 14; // last version not supportting this RPC
          } else {
            throw ioe;
          }
        }
        if (LOG.isDebugEnabled()) {
		LOG.debug("Data Transfer Protocal Version is "+ dataTransferVersion);
        }
      }
      return dataTransferVersion;
    }
  }
1321404
def systemInformationType2ter():
    """"""
    a = L2PseudoLength(l2pLength=0x12)
    b = TpPd(pd=0x6)
    c = MessageType(mesType=0x3)  # 00000011
    d = NeighbourCellsDescription2()
    e = Si2terRestOctets()
    packet = a / b / c / d / e
    return packet
1089574
def rpc_get_docstring(self, filename, source, offset):
        
        return self._call_backend("rpc_get_docstring", None, filename,
                                  get_source(source), offset)
834638
def rpc_get_names(self, filename, source, offset):
        
        source = get_source(source)
        if hasattr(self.backend, "rpc_get_names"):
            return self.backend.rpc_get_names(filename, source, offset)
        else:
            raise Fault("get_names not implemented by current backend",
                        code=400)
983666
def _get_interface_info(interface):
    '''
    
    '''
    adapter_mode = _get_adapter_mode_info(interface.name)
    if adapter_mode == 'disabled':
        return _get_base_interface_info(interface)
    elif adapter_mode == 'ethercat':
        return _get_ethercat_interface_info(interface)
    return _get_tcpip_interface_info(interface)
580018
def GetGRRVersionString(self):
    """"""
    client_info = self.startup_info.client_info
    client_name = client_info.client_description or client_info.client_name
    if client_info.client_version > 0:
      client_version = str(client_info.client_version)
    else:
      client_version = _UNKNOWN_GRR_VERSION
    return " ".join([client_name, client_version])
849166
private void parseProtocolVersion(Map<?, ?> props) {
        Object protocolVersionProperty = props.get(HttpConfigConstants.PROPNAME_PROTOCOL_VERSION);
        if (null != protocolVersionProperty) {

            String protocolVersion = ((String) protocolVersionProperty).toLowerCase();
            if (HttpConfigConstants.PROTOCOL_VERSION_11.equals(protocolVersion)) {
                this.useH2ProtocolAttribute = Boolean.FALSE;
            } else if (HttpConfigConstants.PROTOCOL_VERSION_2.equals(protocolVersion)) {
                this.useH2ProtocolAttribute = Boolean.TRUE;

            }

            if ((TraceComponent.isAnyTracingEnabled()) && (tc.isEventEnabled()) && this.useH2ProtocolAttribute != null) {
                Tr.event(tc, "HTTP Channel Config: versionProtocol has been set to " + protocolVersion);
            }

        }

    }
230071
def _find_protocol_error(tb, proto_name):
    
    tb_info = traceback.extract_tb(tb)
    for frame in reversed(tb_info):
        if frame.filename == proto_name:
            return frame
    else:
        raise KeyError