code: private void configureClientProperties(PersistenceUnitMetadata puMetadata)
      {
          SparkSchemaMetadata metadata = SparkPropertyReader.ssmd;
          ClientProperties cp = metadata != null ? metadata.getClientProperties() : null;
          if (cp != null)
          {
              DataStore dataStore = metadata != null ? metadata.getDataStore(puMetadata.getProperty("kundera.client"))
                      : null;
              List<Server> servers = dataStore != null && dataStore.getConnection() != null ? dataStore.getConnection()
                      .getServers() : null;
  
              if (servers!=null && !servers.isEmpty())
              {
                  Server server = servers.get(0);
                  sparkconf.set("hostname", server.getHost());
                  sparkconf.set("portname", server.getPort());
              }
  
              Connection conn = dataStore.getConnection();
  
              Properties props = conn.getProperties();
  
              Enumeration e = props.propertyNames();
  
              while (e.hasMoreElements())
              {
                  String key = (String) e.nextElement();
                  sparkconf.set(key, props.getProperty(key));
              }
          }
      }
docs: Configure client properties.
  
  @param puMetadata
  the pu metadata