private String getIpAddress() {
    String clientIpAddress;
    // Http transport mode.
    // We set the thread local ip address, in ThriftHttpServlet.
    //Since we are allowing multiple transport modes, this
    //transport information comes from the subclasses
    //instead of reading from hive configuration
    if (getTransportMode() == HiveServer2TransportMode.http) {
      clientIpAddress = SessionManager.getIpAddress();
    }
    else {
      if (hiveAuthFactory != null && hiveAuthFactory.isSASLWithKerberizedHadoop()) {
        clientIpAddress = hiveAuthFactory.getIpAddress();
      }
      // NOSASL
      else {
        clientIpAddress = TSetIpAddressProcessor.getUserIpAddress();
      }
    }
    return clientIpAddress;
  }
Return the number of Hive sessions this context has handled. It is
technically possible that a single connection context could handle an
unbounded number of sequential Hive sessions, though it is currently not
implemented.

@return The number of sessions this thrift context has handled
service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java