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.{SFTPSgcConnectorFactory, SFTPParameters, KeyConfig}
import org.apache.spark.streaming.sgc._
In [ ]:
val parameters = SFTPParameters("HOST", PORT, "DIRECTORY", FTPCredentials("USER", Option("PASSWORD")))
In [ ]:
val parameters = SFTPParameters("HOST", PORT, "DIRECTORY", FTPCredentials("USER"),
pconfig = Option(KeyConfig("PRIVATE_KEY_URL", "PUBLIC_KEY_URL")))
In [ ]:
val parameters = SFTPParameters("HOST", PORT, "DIRECTORY", FTPCredentials("USER"),
pconfig = Option(KeyConfig("PRIVATE_KEY_URL", "PUBLIC_KEY_URL",
Option("PRIVATE_KEY_PASSWORD")))
In [ ]:
val rdd = sc.createSgcRDD(SFTPSgcConnectorFactory, parameters)
In [ ]:
rdd.partitions.map(_.asInstanceOf[SgcRDDPartition[FTPSlot]].slot)
rdd.take(10).foreach(println)