Daniel, this is not exactly THE "huge directory" problem. This is regarding real directories used by the txfile store, not the webdav collections.
But you are right, the "huge directory" problem is still unsolved. I'm currently not quite sure where the bottle neck is situated.
Stefan
Daniel Florey wrote:
How can we ever get rid of this "huge directory" problem? AFAIK the most time consuming operation is the PROPFIND on huge collections, isn't it? So if we could map this propfind to a DASL-request this could be much faster if an appropriate index exists. What do you think? This is no objection agains your proposal, I'm just thinking of a cleaner solution as we are getting this problem over and over again under different circumstances. Cheers, Daniel
"Slide Developers Mailing List" <[EMAIL PROTECTED]> schrieb am 08.11.04 11:35:46:
This modification is just a first trial.
Using BindingStore and txfile store all resource are created in the same directory because UURIs have a strukture like /3429748238429837492.232.
I added some more structure like /3429748238429837492/12/232 to avoid huge directories.
All works with the txfile store.
Has anybody objections regarding this change?
Thanks Stefan
[EMAIL PROTECTED] wrote:
luetzkendorf 2004/11/08 01:30:16
Modified: src/share/org/apache/slide/store ResourceId.java
Log:
trial with structures UURIs to avoid very large directories with FileStore
Revision Changes Path
1.6 +33 -19 jakarta-slide/src/share/org/apache/slide/store/ResourceId.java
Index: ResourceId.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/store/ResourceId.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ResourceId.java 22 Sep 2004 15:20:23 -0000 1.5
+++ ResourceId.java 8 Nov 2004 09:30:16 -0000 1.6
@@ -30,6 +30,7 @@
import org.apache.slide.common.ServiceAccessException;
import org.apache.slide.common.ServiceConnectionFailedException;
import org.apache.slide.common.ServiceMissingOnRootNodeException;
+import org.apache.slide.common.SlideRuntimeException;
import org.apache.slide.common.SlideToken;
import org.apache.slide.common.Uri;
import org.apache.slide.common.UriPath;
@@ -63,7 +64,8 @@
/**
** Number of uuri created in this JVM session
**/
- private static int counter = 0;
+ private static int counter1 = 0;
+ private static int counter2 = 0;
/**
* @pre uriStr has to contain store prefix, i.e. extractStoreUri has to succeed
@@ -73,15 +75,21 @@
boolean useBinding = Configuration.useBinding(uri.getStore());
if (useBinding) {
- String scopeSlash = uri.getScope().toString();
- if (!"/".equals(scopeSlash)) {
- scopeSlash += "/";
- }
- synchronized (ResourceId.class) {
- newUuri = uri.isStoreRoot()
- ? scopeSlash
- : scopeSlash+TIMESTAMP+"."+counter++;
+ StringBuffer b = new StringBuffer();
+ b.append(uri.getScope().toString());
+ if (b.length() > 1) b.append("/");
+ + if (!uri.isStoreRoot()) {
+ synchronized (ResourceId.class) { + b.append(TIMESTAMP).append("/").append(counter2)
+ .append("/") .append(counter1++);
+ if (counter1 > 500) {
+ counter1 = 0;
+ counter2++;
+ }
+ }
}
+ newUuri = b.toString();
} else {
newUuri = uri.toString();
}
@@ -233,7 +241,7 @@
*
* @param uri Uri to parse
*/
- private void parseUuri(String uuri) {
+ protected void parseUuri(String uuri) {
// We first try to tokenize the uri string.
scopes = new ScopeTokenizer(token, namespace, uuri);
@@ -255,12 +263,10 @@
}
}
catch (ServiceConnectionFailedException e) {
- // Problem ...
- // FIXME : Throw a RuntimeException ??
+ throw new SlideRuntimeException(e.toString(), true);
}
catch (ServiceAccessException e) {
- // Problem ...
- // FIXME : Throw a RuntimeException ??
+ throw new SlideRuntimeException(e.toString(), true);
}
}
@@ -269,7 +275,15 @@
if (store == null) {
throw new ServiceMissingOnRootNodeException();
}
- }
+ + /**
+ * Does nothing, overwrited the [EMAIL PROTECTED] Uri#parseUri(String)} method to
+ * avoid its unrequired overhead.
+ */
+ protected void parseUri(String uri) {
+ + }
+ }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- Stefan L�tzkendorf -- [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
__________________________________________________________ Mit WEB.DE FreePhone mit hoechster Qualitaet ab 0 Ct./Min. weltweit telefonieren! http://freephone.web.de/?mc=021201
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- Stefan L�tzkendorf -- [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
