You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2011/11/23 18:24:03 UTC
svn commit: r1205501 -
/incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/Jena163_TDBDifferentIds.java
Author: andy
Date: Wed Nov 23 17:24:03 2011
New Revision: 1205501
URL: http://svn.apache.org/viewvc?rev=1205501&view=rev
Log: (empty)
Modified:
incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/Jena163_TDBDifferentIds.java
Modified: incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/Jena163_TDBDifferentIds.java
URL: http://svn.apache.org/viewvc/incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/Jena163_TDBDifferentIds.java?rev=1205501&r1=1205500&r2=1205501&view=diff
==============================================================================
--- incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/Jena163_TDBDifferentIds.java (original)
+++ incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/Jena163_TDBDifferentIds.java Wed Nov 23 17:24:03 2011
@@ -72,35 +72,32 @@ public class Jena163_TDBDifferentIds
log.error("**** Running with file mapped mode on MS Windows - expected test failure") ;
}
- static boolean MEM = true ;
+ static boolean MEM = false ;
- static final Location LOC = MEM ? Location.mem() : new Location(ConfigTest.getTestingDirDB()) ;
-
- static final int Iterations = MEM ? 1000 : 1000 ;
+ static final Location LOC = MEM ? Location.mem() : new Location(ConfigTest.getTestingDirDB()) ;
+ static final int Iterations = MEM ? 1000 : 1000 ;
// Output style.
- static boolean inlineProgress = true ; // (! log.isDebugEnabled()) && Iterations > 20 ;
- static boolean logging = ! inlineProgress ; // (! log.isDebugEnabled()) && Iterations > 20 ;
-
- static final int numReaderTasks = 5 ;
- static final int numWriterTasksA = 3 ;
- static final int numWriterTasksC = 5 ;
-
- static final int readerSeqRepeats = 8 ;
- static final int readerMaxPause = 10 ;
-
- static final int writerAbortSeqRepeats = 4 ;
- static final int writerCommitSeqRepeats = 4 ;
- static final int writerMaxPause = 10 ;
-
- static final int numThreadsInPool = 4 ; // If <= 0 then use an unbounded thread pool.
- private static ExecutorService execService = null ;
+ static boolean logging = false ;
-
- private static int iteration = 0 ;
- private static int numIterationsPerBlock = 100 ;
- private static int colCount = 0 ;
- private static int colMax = 200 ;
- private static boolean detailEveryTransaction = false ; // Set true so that every transaction print a letter for what it does.
+ static final int numReaderTasks = 5 ;
+ static final int numWriterTasksA = 3 ;
+ static final int numWriterTasksC = 5 ;
+
+ static final int readerSeqRepeats = 8 ;
+ static final int readerMaxPause = 10 ;
+
+ static final int writerAbortSeqRepeats = 4 ;
+ static final int writerCommitSeqRepeats = 4 ;
+ static final int writerMaxPause = 10 ;
+
+ static final int numThreadsInPool = 4 ; // If <= 0 then use an unbounded thread pool.
+ private static ExecutorService execService = null ;
+
+ private static int iteration = 0 ;
+ private static int numIterationsPerBlock = 100 ;
+ private static int colCount = 0 ;
+ private static int colMax = 200 ;
+ private static boolean inlineProgress = false ; // Set true so that every transaction print a letter for what it does.
private static Semaphore startPoint ;
/** TODO
@@ -116,7 +113,7 @@ public class Jena163_TDBDifferentIds
String x = (MEM?"memory":"disk["+SystemTDB.fileMode()+"]") ;
// Make colMax >= numIterationsPerBlock in detailEveryTransaction = false mode
- if ( !detailEveryTransaction )
+ if ( !inlineProgress )
colMax = numIterationsPerBlock ;
if ( logging )
@@ -144,16 +141,14 @@ public class Jena163_TDBDifferentIds
if (logging)
log.info("FINISH ({})", iteration) ;
else
- printf("FINISH") ;
+ println("FINISH") ;
}
private static void clean()
{
+ StoreConnection.release(LOC) ;
if ( ! LOC.isMem() )
- {
- StoreConnection.release(LOC) ;
FileOps.clearDirectory(LOC.getDirectoryPath()) ;
- }
}
static class Reader implements Callable<Object>
@@ -208,8 +203,7 @@ public class Jena163_TDBDifferentIds
log.debug("reader finish " + id + "/" + i) ;
dsg.end() ;
dsg = null ;
- if ( inlineProgress )
- txn("R") ;
+ txn("R") ;
}
return null ;
} catch (RuntimeException ex)
@@ -437,6 +431,8 @@ public class Jena163_TDBDifferentIds
submit(execService, procR, RN2, "READ-") ;
submit(execService, procW_a, WA1, "ABORT-") ;
submit(execService, procW_c, WC2, "COMMIT-") ;
+// submit(execService, procR, RN3, "READ-") ;
+// submit(execService, procW_c, WA2, "ABORT-") ;
submit(execService, procW_c, WA2, "ABORT-") ;
submit(execService, procR, RN3, "READ-") ;
@@ -513,7 +509,7 @@ public class Jena163_TDBDifferentIds
private static void txn(String label)
{
- if ( ! detailEveryTransaction )
+ if ( ! inlineProgress )
return ;
checkCol() ;
print(label) ;
@@ -532,14 +528,14 @@ public class Jena163_TDBDifferentIds
}
printf("%03d: ", iteration) ;
- if ( detailEveryTransaction )
+ if ( inlineProgress )
println() ;
}
}
private static void endTestIteration()
{
- if ( ! detailEveryTransaction )
+ if ( ! inlineProgress )
{
checkCol() ;
printf(".") ;
@@ -577,6 +573,10 @@ public class Jena163_TDBDifferentIds
System.out.print(str) ;
}
+ private static void println(String string)
+ {
+ print(string) ; println() ;
+ }
private static void println()
{