Revision: 1566
http://svn.sourceforge.net/cogkit/?rev=1566&view=rev
Author: hategan
Date: 2007-02-05 16:58:37 -0800 (Mon, 05 Feb 2007)
Log Message:
-----------
get progress info from resources
Modified Paths:
--------------
trunk/current/src/cog/modules/abstraction-common/src/org/globus/cog/abstraction/impl/fileTransfer/DelegatedFileTransferHandler.java
Modified: trunk/current/src/cog/modules/abstraction-common/src/org/globus/cog/abstraction/impl/fileTransfer/DelegatedFileTransferHandler.java
===================================================================
--- trunk/current/src/cog/modules/abstraction-common/src/org/globus/cog/abstraction/impl/fileTransfer/DelegatedFileTransferHandler.java 2007-02-06 00:58:01 UTC (rev 1565)
+++ trunk/current/src/cog/modules/abstraction-common/src/org/globus/cog/abstraction/impl/fileTransfer/DelegatedFileTransferHandler.java 2007-02-06 00:58:37 UTC (rev 1566)
@@ -32,6 +32,7 @@
import org.globus.cog.abstraction.interfaces.DelegatedTaskHandler;
import org.globus.cog.abstraction.interfaces.FileResource;
import org.globus.cog.abstraction.interfaces.FileTransferSpecification;
+import org.globus.cog.abstraction.interfaces.ProgressMonitor;
import org.globus.cog.abstraction.interfaces.SecurityContext;
import org.globus.cog.abstraction.interfaces.Service;
import org.globus.cog.abstraction.interfaces.Status;
@@ -274,7 +275,11 @@
logger.debug("File transfer with resource remote->tmp");
}
this.sourceResource.getFile(spec.getSource(),
- localDestination.getAbsolutePath());
+ localDestination.getAbsolutePath(), new ProgressMonitor() {
+ public void progress(long current, long total) {
+ task.setStdOutput(current+"/"+total);
+ }
+ });
}
return localDestination;
}
@@ -351,7 +356,12 @@
.debug("File transfer with resource local->remote");
}
this.destinationResource.putFile(localSource
- .getAbsolutePath(), spec.getDestination());
+ .getAbsolutePath(), spec.getDestination(),
+ new ProgressMonitor() {
+ public void progress(long current, long total) {
+ task.setStdOutput(current + "/" + total);
+ }
+ });
}
}
else {
@@ -631,12 +641,12 @@
}
else {
if (logger.isDebugEnabled()) {
- logger.debug(current + " out of " + total + " bytes transferred");
+ logger.debug(current + " out of " + total
+ + " bytes transferred");
}
this.task.setStdOutput(current + " out of " + total
+ " bytes transfered");
}
-
}
public void transferError(Exception error) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
Revision: 1662
http://cogkit.svn.sourceforge.net/cogkit/?rev=1662&view=rev
Author: hategan
Date: 2007-07-28 13:01:10 -0700 (Sat, 28 Jul 2007)
Log Message:
-----------
honor thirdPartyIfPossible property
Modified Paths:
--------------
trunk/current/src/cog/modules/abstraction-common/src/org/globus/cog/abstraction/impl/fileTransfer/DelegatedFileTransferHandler.java
Modified: trunk/current/src/cog/modules/abstraction-common/src/org/globus/cog/abstraction/impl/fileTransfer/DelegatedFileTransferHandler.java
===================================================================
--- trunk/current/src/cog/modules/abstraction-common/src/org/globus/cog/abstraction/impl/fileTransfer/DelegatedFileTransferHandler.java 2007-07-28 20:00:31 UTC (rev 1661)
+++ trunk/current/src/cog/modules/abstraction-common/src/org/globus/cog/abstraction/impl/fileTransfer/DelegatedFileTransferHandler.java 2007-07-28 20:01:10 UTC (rev 1662)
@@ -146,7 +146,7 @@
"Invalid destination provider");
}
- if (spec.isThirdParty()) {
+ if (spec.isThirdParty() || spec.isThirdPartyIfPossible()) {
if ((sourceService.getProvider().equalsIgnoreCase("gridftp")
|| sourceService.getProvider().equalsIgnoreCase("gsiftp") || sourceService
.getProvider().equalsIgnoreCase("gridftp-old"))
@@ -157,7 +157,7 @@
.getProvider().equalsIgnoreCase("gridftp-old"))) {
this.thirdparty = true;
}
- else {
+ else if (spec.isThirdParty()) {
throw new IllegalSpecException(
"Third party transfers between providers "
+ sourceService.getProvider() + " and "
@@ -165,14 +165,13 @@
+ " is not supported");
}
}
- else {
- if (!canHandle(sourceService) || !canHandle(destinationService)) {
- throw new TaskSubmissionException(
- "Could not find appropriate providers to handle a "
- + sourceService.getProvider() + " -> "
- + destinationService.getProvider()
- + " transfer");
- }
+
+ if (!this.thirdparty
+ && (!canHandle(sourceService) || !canHandle(destinationService))) {
+ throw new TaskSubmissionException(
+ "Could not find appropriate providers to handle a "
+ + sourceService.getProvider() + " -> "
+ + destinationService.getProvider() + " transfer");
}
}
@@ -275,11 +274,12 @@
logger.debug("File transfer with resource remote->tmp");
}
this.sourceResource.getFile(spec.getSource(),
- localDestination.getAbsolutePath(), new ProgressMonitor() {
+ localDestination.getAbsolutePath(),
+ new ProgressMonitor() {
public void progress(long current, long total) {
- task.setStdOutput(current+"/"+total);
+ task.setStdOutput(current + "/" + total);
}
- });
+ });
}
return localDestination;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
Revision: 1833
http://cogkit.svn.sourceforge.net/cogkit/?rev=1833&view=rev
Author: hategan
Date: 2007-11-06 16:43:43 -0800 (Tue, 06 Nov 2007)
Log Message:
-----------
removed useless and race condition causing state
Modified Paths:
--------------
trunk/current/src/cog/modules/abstraction-common/src/org/globus/cog/abstraction/impl/fileTransfer/DelegatedFileTransferHandler.java
Modified: trunk/current/src/cog/modules/abstraction-common/src/org/globus/cog/abstraction/impl/fileTransfer/DelegatedFileTransferHandler.java
===================================================================
--- trunk/current/src/cog/modules/abstraction-common/src/org/globus/cog/abstraction/impl/fileTransfer/DelegatedFileTransferHandler.java 2007-11-06 19:20:38 UTC (rev 1832)
+++ trunk/current/src/cog/modules/abstraction-common/src/org/globus/cog/abstraction/impl/fileTransfer/DelegatedFileTransferHandler.java 2007-11-07 00:43:43 UTC (rev 1833)
@@ -86,7 +86,6 @@
Thread thread = new Thread(this);
this.task.setStatus(Status.SUBMITTED);
thread.start();
- this.task.setStatus(Status.ACTIVE);
}
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|