package org.jenkinsci.plugins.p4.client; import java.util.ArrayList; import java.util.List; import java.util.Map; import com.perforce.p4java.core.file.IFileSpec; import com.perforce.p4java.exception.P4JavaException; import com.perforce.p4java.impl.mapbased.server.Server; import com.perforce.p4java.server.IServer; import com.perforce.p4java.server.callback.IStreamingCallback; import hudson.model.TaskListener; public class SyncStreamingCallback implements IStreamingCallback { private boolean done = false; private final Server server; private final Validate validate; public SyncStreamingCallback(IServer iserver, TaskListener listener) { this.server = (Server) iserver; this.validate = new Validate(listener); } @Override public boolean startResults(int key) throws P4JavaException { return true; } @Override public boolean endResults(int key) throws P4JavaException { done = true; return true; } @Override public boolean handleResult(Map<String, Object> map, int key) throws P4JavaException { List<IFileSpec> specList = new ArrayList<IFileSpec>(); specList.add(server.handleFileReturn(map)); try { validate.check(specList, "file(s) up-to-date.", "file does not exist", "no file(s) as of that date"); } catch (Exception e) { // re-throw exception as AbortException is only used if !quiet throw new P4JavaException(e); } return true; } public boolean isDone() { return done; } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#3 | 22514 | Paul Allen | Raise Errors from StreamingCallbacks. | ||
#2 | 22349 | Paul Allen |
Parallel Sync using P4Java. Update to P4Java 2017.2; using RPC level parallel sync and threaded within the JVM. Native parallel sync no longer requires a 'p4d' binary. |
||
#1 | 18889 | Paul Allen |
Asynchronous sync operation. To avoid memory issues with very large sync operations. #review-18773 |