Your "read between the lines" was spot on. Sorry for not being more clear I was not sure how to explain my train of thoughts. It's clear now. Thank you.
On Friday, April 5, 2019 at 4:17:49 PM UTC+3, Jesse Glick wrote: > > On Fri, Apr 5, 2019 at 4:11 AM Daniel Anechitoaie <[email protected] > <javascript:>> wrote: > > What happens when you do a FilePath.readToString() on a Master/Slave > setup? > > Will the master read the contents of the file from the salve and process > the contents locally? > > I am not sure what you mean by “process” in this context. The master > will send a request to the agent to load the file into a string, and > the agent sends back a response with that string. > > Reading between the lines a bit, I think you are asking something like > this: suppose the agent workspace contains some possibly big file and > you only need a little bit of information from it. In that case it is > a bad idea to write > > FilePath file = workspace.child("all-results.xml"); > String xml = file.readtoString(); // slow! > int count = countNumberOfResults(xml); > > The better code would be: > > FilePath file = workspace.child("all-results.xml"); > int count = file.act(new CountNumberOfResults()); > // … > private static final class CountNumberOfResults extends > MasterToSlaveFileCallable<Integer> {…} > > so that the response on the Remoting channel just contains the one > integer and not the complete file contents. > -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/d85e9530-e4d0-48e5-bb58-82fe27734744%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
