code: @Override
      protected Object createPoolOrConnection()
      {
          PersistenceUnitMetadata persistenceUnitMetadata = kunderaMetadata.getApplicationMetadata()
                  .getPersistenceUnitMetadata(getPersistenceUnit());
  
          Properties props = persistenceUnitMetadata.getProperties();
          String keyspace = null;
  
          if (externalProperties != null)
          {
              keyspace = (String) externalProperties.get(PersistenceProperties.KUNDERA_KEYSPACE);
          }
  
          if (keyspace == null)
          {
              keyspace = (String) props.get(PersistenceProperties.KUNDERA_KEYSPACE);
          }
  
          for (Host host : ((CassandraHostConfiguration) configuration).getCassandraHosts())
          {
              PoolConfiguration prop = new PoolProperties();
              prop.setHost(host.getHost());
              prop.setPort(host.getPort());
              prop.setKeySpace(keyspace);
  
              CassandraUtilities.setPoolConfigPolicy((CassandraHost) host, prop);
              try
              {
                  ConnectionPool pool = new ConnectionPool(prop);
                  hostPools.put(host, pool);
              }
              catch (TException e)
              {
                  logger.warn("Node {} are down, Caused by {} .", host.getHost(), e.getMessage());
                  if (host.isRetryHost())
                  {
                      logger.warn("Scheduling node for future retry");
                      ((CassandraRetryService) hostRetryService).add((CassandraHost) host);
                  }
              }
          }
          return null;
      }
docs: /* (non-Javadoc)
  @see com.impetus.kundera.loader.GenericClientFactory#createPoolOrConnection()