code: 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;
      }
    }
docs: Get the data transfer protocol version supported in the cluster
  assuming all the datanodes have the same version.
  
  @return the data transfer protocol version supported in the cluster