
package eu.dnetlib.dhp.oa.graph.dump.filterentities;

/**
 * @author miriam.baglioni
 * @Date 26/03/24
 */
/**
 * @author miriam.baglioni
 * @Date 26/03/24
 */
import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import eu.dnetlib.dhp.application.ArgumentApplicationParser;

/**
 * @author miriam.baglioni
 * @Date 25/09/23
 */
public class EoscMasterDuplicate {

	private static final Logger log = LoggerFactory.getLogger(EoscMasterDuplicate.class);

	public static void main(final String[] args) throws Exception {
		final ArgumentApplicationParser parser = new ArgumentApplicationParser(
			IOUtils
				.toString(
					EoscMasterDuplicate.class
						.getResourceAsStream(
							"/eu/dnetlib/dhp/oa/graph/dump/skgif/datasourcemaster_parameters.json")));

		parser.parseArgument(args);

		final String dbUrl = parser.get("postgresUrl");
		log.info("postgresUrl: {}", dbUrl);

		final String dbUser = parser.get("postgresUser");
		log.info("postgresUser: {}", dbUser);

		final String dbPassword = parser.get("postgresPassword");
		log.info("postgresPassword: {}", dbPassword);

		final String hdfsPath = parser.get("hdfsPath");
		log.info("hdfsPath: {}", hdfsPath);

		final String hdfsNameNode = parser.get("hdfsNameNode");
		log.info("hdfsNameNode: {}", hdfsNameNode);

		ReadDatasourceMasterDuplicateFromDB.execute(dbUrl, dbUser, dbPassword, hdfsPath, hdfsNameNode);

	}

}
