code: protected Session getSession() throws IOException {
          if (session == null) {
              // start a session
              try {
                  ContentSource cs = InternalUtilities.getOutputContentSource(
                          conf, hostName);
                  session = cs.newSession();
                  if (LOG.isDebugEnabled()) {
                      LOG.debug("Connect to " + session.getConnectionUri().getHost());
                  }
                  if (txnSize > 1) {
                      session.setTransactionMode(TransactionMode.UPDATE);
                  }
              } catch (XccConfigException e) {
                  LOG.error("Error creating a new session: ", e);
                  throw new IOException(e);
              }    
          }
          return session;
      }
docs: Get the session for this writer.  One writer only maintains one session.
  
  @return Session for this writer.
  @throws IOException