Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2019-02-12 04:00:55 -0500
committerEike Stepper2019-02-12 04:00:55 -0500
commit2e43008167ff49c27a0cc4545fe9877f8a5c5aa9 (patch)
tree5d5e243ec1a8ec5403b214dc0db0882526c32c80 /plugins
parent9b86d2e358a5d6785be4cf1c4502fcde0f5406c0 (diff)
downloadcdo-master.tar.gz
cdo-master.tar.xz
cdo-master.zip
[544363] Make timeout in CDOLobStore configurableHEADmaster
https://bugs.eclipse.org/bugs/show_bug.cgi?id=544363
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/CDOLobStoreImpl.java26
-rw-r--r--plugins/org.eclipse.net4j.util/.settings/.api_filters9
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/IOUtil.java3
3 files changed, 35 insertions, 3 deletions
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/CDOLobStoreImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/CDOLobStoreImpl.java
index db8ddea670..fbe7e2f416 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/CDOLobStoreImpl.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/CDOLobStoreImpl.java
@@ -42,6 +42,8 @@ public class CDOLobStoreImpl implements CDOLobStore
{
public static final CDOLobStoreImpl INSTANCE = new CDOLobStoreImpl();
+ private long timeout = IOUtil.DEFAULT_TIMEOUT;
+
private File folder;
private int tempID;
@@ -60,6 +62,22 @@ public class CDOLobStoreImpl implements CDOLobStore
this(getDefaultFolder());
}
+ /**
+ * @since 4.8
+ */
+ public long getTimeout()
+ {
+ return timeout;
+ }
+
+ /**
+ * @since 4.8
+ */
+ public void setTimeout(long timeout)
+ {
+ this.timeout = timeout;
+ }
+
public File getFolder()
{
if (!folder.exists())
@@ -80,7 +98,9 @@ public class CDOLobStoreImpl implements CDOLobStore
{
File file = getBinaryFile(info.getID());
long expectedSize = info.getSize();
- return new ExpectedFileInputStream(file, expectedSize);
+ ExpectedFileInputStream inputStream = new ExpectedFileInputStream(file, expectedSize);
+ inputStream.setTimeout(timeout);
+ return inputStream;
}
public CDOLobInfo putBinary(InputStream contents) throws IOException
@@ -117,7 +137,9 @@ public class CDOLobStoreImpl implements CDOLobStore
{
File file = getCharacterFile(info.getID());
long expectedSize = info.getSize();
- return new ExpectedFileReader(file, expectedSize);
+ ExpectedFileReader reader = new ExpectedFileReader(file, expectedSize);
+ reader.setTimeout(timeout);
+ return reader;
}
diff --git a/plugins/org.eclipse.net4j.util/.settings/.api_filters b/plugins/org.eclipse.net4j.util/.settings/.api_filters
index ba9ccf65cb..8cf3425cb0 100644
--- a/plugins/org.eclipse.net4j.util/.settings/.api_filters
+++ b/plugins/org.eclipse.net4j.util/.settings/.api_filters
@@ -190,6 +190,15 @@
</message_arguments>
</filter>
</resource>
+ <resource path="src/org/eclipse/net4j/util/io/IOUtil.java" type="org.eclipse.net4j.util.io.IOUtil">
+ <filter id="389242988">
+ <message_arguments>
+ <message_argument value="org.eclipse.net4j.util.io.IOUtil"/>
+ <message_argument value="DEFAULT_TIMEOUT"/>
+ <message_argument value="2500"/>
+ </message_arguments>
+ </filter>
+ </resource>
<resource path="src/org/eclipse/net4j/util/lifecycle/ILifecycle.java" type="org.eclipse.net4j.util.lifecycle.ILifecycle">
<filter id="403984517">
<message_arguments>
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/IOUtil.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/IOUtil.java
index d210bd5bac..7a9c0ccf62 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/IOUtil.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/IOUtil.java
@@ -15,6 +15,7 @@ import org.eclipse.net4j.internal.util.bundle.OM;
import org.eclipse.net4j.util.ReflectUtil;
import org.eclipse.net4j.util.StringUtil;
import org.eclipse.net4j.util.WrappedException;
+import org.eclipse.net4j.util.om.OMPlatform;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
@@ -62,7 +63,7 @@ public final class IOUtil
/**
* @since 3.1
*/
- public static final long DEFAULT_TIMEOUT = 2500;
+ public static final long DEFAULT_TIMEOUT = OMPlatform.INSTANCE.getProperty("org.eclipse.net4j.util.io.DEFAULT_TIMEOUT", 2500L);
public static final int DEFAULT_BUFFER_SIZE = 8192;

Back to the top