Author: jflesch
Date: 2007-04-11 13:25:01 +0000 (Wed, 11 Apr 2007)
New Revision: 12574
Modified:
trunk/apps/Thaw/src/thaw/fcp/FCPClientGet.java
trunk/apps/Thaw/src/thaw/plugins/index/Index.java
Log:
Force Thaw to not use the DDA when downloading indexes
Modified: trunk/apps/Thaw/src/thaw/fcp/FCPClientGet.java
===================================================================
--- trunk/apps/Thaw/src/thaw/fcp/FCPClientGet.java 2007-04-11 13:21:23 UTC
(rev 12573)
+++ trunk/apps/Thaw/src/thaw/fcp/FCPClientGet.java 2007-04-11 13:25:01 UTC
(rev 12574)
@@ -45,6 +45,7 @@
private boolean alreadySaved = false;
+ private boolean noDDA = false;
/**
* See setParameters().
@@ -107,6 +108,20 @@
/**
+ * See the other entry point
+ * @param noDDA refuse the use of DDA (if true, request must be *NOT*
*PERSISTENT*)
+ */
+ public FCPClientGet(final String key, final int priority,
+ final int persistence, boolean globalQueue,
+ final int maxRetries,
+ String destinationDir,
+ boolean noDDA) {
+ this(key, priority, persistence, globalQueue, maxRetries,
destinationDir);
+ this.noDDA = noDDA;
+ }
+
+
+ /**
* Entry point:
* Only for initial queries : To resume queries, use
FCPClientGet(FCPQueueManager, Hashmap).
* @param destinationDir if null => temporary file
@@ -151,6 +166,20 @@
/**
+ * See the other entry point
+ * @param noDDA refuse the use of DDA (if true, request must be *NOT*
*PERSISTENT*)
+ */
+ public FCPClientGet(final String key, final int priority,
+ final int persistence, boolean globalQueue,
+ final int maxRetries,
+ String destinationDir,
+ long maxSize,
+ boolean noDDA) {
+ this(key, priority, persistence, globalQueue, maxRetries,
destinationDir, maxSize);
+ this.noDDA = noDDA;
+ }
+
+ /**
* Another entry point allowing to specify a max size
*/
public FCPClientGet(final String key, final int priority,
@@ -214,7 +243,7 @@
else
queryMessage.setValue("Global", "false");
- if
(!queueManager.getQueryManager().getConnection().isLocalSocket())
+ if
(!queueManager.getQueryManager().getConnection().isLocalSocket() && !noDDA)
queryMessage.setValue("ReturnType", "direct");
else {
queryMessage.setValue("ReturnType", "disk");
@@ -256,10 +285,10 @@
fileSize = (new
Long(message.getValue("DataLength"))).longValue();
if(isPersistent()
- ||
queueManager.getQueryManager().getConnection().isLocalSocket()) {
+ ||
(queueManager.getQueryManager().getConnection().isLocalSocket() && !noDDA)) {
if(destinationDir != null) {
if(!fileExists()
- &&
!queueManager.getQueryManager().getConnection().isLocalSocket()) {
+ &&
!(queueManager.getQueryManager().getConnection().isLocalSocket() && !noDDA)) {
status =
"Requesting file from the node";
progress = 99;
running = true;
Modified: trunk/apps/Thaw/src/thaw/plugins/index/Index.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/Index.java 2007-04-11 13:21:23 UTC
(rev 12573)
+++ trunk/apps/Thaw/src/thaw/plugins/index/Index.java 2007-04-11 13:25:01 UTC
(rev 12574)
@@ -738,7 +738,7 @@
clientGet = new FCPClientGet(key, 2, 2, false, -1,
System.getProperty("java.io.tmpdir"),
- MAX_SIZE);
+ MAX_SIZE, true /* <= noDDA */);
/*
* These requests are usually quite fast, and don't consume too
much