Hi team, I have a question, I’m using SFTP module ...
# suitescript
c
Hi team, I have a question, I’m using SFTP module in Map reduce script so I need to use the connection in different places like in getinputdata and reduce and summarize stages. Instead of opening connections everytime can we do once and use that instance throughout Mr script ? Any ideas would be helpful. Thanks!
a
Typically you'd open it in the getinputdata phase or the summary phase rather than in map or reduce. What's the use case for not using it in either of those?
e
Not that I'm aware of. Each execution of an entry point function of a M/R is effectively a new script execution. Any memory and references are not persisted between stages. I suspect you'll have to reconnect in each stage, though I'd be happy to be wrong about that.
✔️ 2
n
Yes, you'll have to re-open it. In fact if for example you download a list of files and then need to re-upload / move to another folder even in the same instance, you are likely going to have to create a new connection each time. It seems NS closes the door behind you without you asking it to and it's safer to establish a new connection.
❤️ 1