Author: batosai
Date: 2008-09-11 16:56:28 +0000 (Thu, 11 Sep 2008)
New Revision: 22611

Modified:
   trunk/plugins/WoT/src/plugins/WoT/WoT.java
Log:
Set indexes on Trust an Score objects too, as I query on them...

Modified: trunk/plugins/WoT/src/plugins/WoT/WoT.java
===================================================================
--- trunk/plugins/WoT/src/plugins/WoT/WoT.java  2008-09-11 16:40:36 UTC (rev 
22610)
+++ trunk/plugins/WoT/src/plugins/WoT/WoT.java  2008-09-11 16:56:28 UTC (rev 
22611)
@@ -67,6 +67,10 @@
                this.pr = pr;
                Configuration config = Db4o.newConfiguration();
                
config.objectClass(Identity.class).objectField("id").indexed(true);
+               
config.objectClass(Trust.class).objectField("truster").indexed(true);
+               
config.objectClass(Trust.class).objectField("trustee").indexed(true);
+               
config.objectClass(Score.class).objectField("treeOwner").indexed(true);
+               
config.objectClass(Score.class).objectField("target").indexed(true);
                db = Db4o.openFile(config, "WoT.db4o");

                client = pr.getHLSimpleClient();
@@ -107,11 +111,11 @@
                        Logger.error(this, "Seed identity loading error", e);
                        return;
                }
-
+               /*
                // Start the inserter thread
                inserter = new IdentityInserter(db, client, 
pr.getNode().clientCore.tempBucketFactory);
                pr.getNode().executor.execute(inserter, "WoTinserter");
-               
+               */
                // Create the fetcher
                fetcher = new IdentityFetcher(db, client);

@@ -123,12 +127,15 @@
        }

        public void terminate() {
-
-               if(inserter == null) // Can't figure out why executor.execute() 
makes it null, but stop screwing the unload process.
+               /*
+               if(inserter == null) {// Can't figure out why 
executor.execute() makes it null, but stop screwing the unload process.
                        Logger.error(this, "Inserter's thread reference is 
null, can't stop it !" );
-               else 
-                       inserter.stop(); 
-
+               }
+               else {
+                       Logger.debug(this, "Calling inserter.stop()");
+                       inserter.stop();
+               }
+               */
                Logger.debug(this, "Cleanly closing the database");
                db.commit();
                db.close();


Reply via email to