In [ ]:
%dep
z.load("alvsanand:spark-generic-connector:0.2.0-spark_2x-s_2.11")
In [ ]:
import es.alvsanand.sgc.ftp.{FTPCredentials, FTPSlot}
import es.alvsanand.sgc.ftp.secure.{FTPSSgcConnectorFactory, FTPSParameters, KeystoreConfig}
import org.apache.spark.streaming.sgc._
In [ ]:
val parameters = FTPSParameters("HOST", PORT, "DIRECTORY", FTPCredentials("USER", Option("PASSWORD")))
In [ ]:
val parameters = FTPSParameters("HOST", PORT, "DIRECTORY", FTPCredentials("USER", Option("PASSWORD"), activeMode = true)
In [ ]:
val parameters = FTPSParameters("HOST", PORT, "DIRECTORY", FTPCredentials("USER", Option("PASSWORD")),
kconfig = Option(KeystoreConfig(Option("KEYSTORE_URL"), keystorePassword = Option("KEYSTORE_PASSWORD"))))
In [ ]:
val parameters = FTPSParameters("HOST", PORT, "DIRECTORY", FTPCredentials("USER", Option("PASSWORD")),
kconfig = Option(KeystoreConfig(Option("KEYSTORE_URL"), keystorePassword = Option("KEYSTORE_PASSWORD"))),
tconfig = Option(KeystoreConfig(Option("TRUSTSTORE_URL"), keystorePassword = Option("TRUSTSTORE_PASSWORD"))))
In [ ]:
val rdd = sc.createSgcRDD(FTPSSgcConnectorFactory, parameters)
In [ ]:
rdd.partitions.map(_.asInstanceOf[SgcRDDPartition[FTPSlot]].slot)
rdd.take(10).foreach(println)