[infinispan-commits] Infinispan SVN: r1963 - branches/4.1.x/lucene-directory/src/test/java/org/infinispan/lucene/profiling.

infinispan-commits at lists.jboss.org infinispan-commits at lists.jboss.org
Fri Jul 2 08:36:24 EDT 2010


Author: sannegrinovero
Date: 2010-07-02 08:36:24 -0400 (Fri, 02 Jul 2010)
New Revision: 1963

Modified:
   branches/4.1.x/lucene-directory/src/test/java/org/infinispan/lucene/profiling/IndexReadingStressTest.java
Log:
Lucene Directory style & formatting to have trunk as 4.1 branch (IndexReadingStressTest only)

Modified: branches/4.1.x/lucene-directory/src/test/java/org/infinispan/lucene/profiling/IndexReadingStressTest.java
===================================================================
--- branches/4.1.x/lucene-directory/src/test/java/org/infinispan/lucene/profiling/IndexReadingStressTest.java	2010-07-02 12:32:10 UTC (rev 1962)
+++ branches/4.1.x/lucene-directory/src/test/java/org/infinispan/lucene/profiling/IndexReadingStressTest.java	2010-07-02 12:36:24 UTC (rev 1963)
@@ -50,35 +50,34 @@
 
 /**
  * This is a stress test meant to compare relative performance of RAMDirectory, FSDirectory,
- * Infinispan local Directory, clustered.
- * Focuses on Search performance; an index is built before the performance measurement is started and is not
- * changed during the searches.
- * To use it set a DURATION_MS as long as you can afford; choose thread number and terms number
- * according to your use case as they will affect the results.
+ * Infinispan local Directory, clustered. Focuses on Search performance; an index is built before
+ * the performance measurement is started and is not changed during the searches. To use it set a
+ * DURATION_MS as long as you can afford; choose thread number and terms number according to your
+ * use case as they will affect the results.
  * 
  * @author Sanne Grinovero
  * @since 4.0
  */
 @Test(groups = "profiling", testName = "lucene.profiling.IndexReadingStressTest")
 public class IndexReadingStressTest {
-   
+
    /** Concurrent IndexSearchers used during tests */
    private static final int THREADS = 20;
-   
+
    /** Test duration **/
    private static final long DURATION_MS = 350000;
-   
+
    /** Number of Terms written in the index **/
    private static final int TERMS_NUMBER = 200000;
 
    private static final ClusteredCacheFactory cacheFactory = new ClusteredCacheFactory(CacheTestSupport.createTestConfiguration());
-   
+
    @Test
    public void profileTestRAMDirectory() throws InterruptedException, IOException {
       RAMDirectory dir = new RAMDirectory();
       testDirectory(dir, "RAMDirectory");
    }
-   
+
    @Test
    public void profileTestFSDirectory() throws InterruptedException, IOException {
       File indexDir = new File(new File("."), "tempindex");
@@ -86,15 +85,15 @@
       FSDirectory dir = FSDirectory.open(indexDir);
       testDirectory(dir, "FSDirectory");
    }
-   
+
    @Test
    public void profileTestInfinispanDirectory() throws InterruptedException, IOException {
-      //theses default are not for performance settings but meant for problem detection:
-      Cache<CacheKey,Object> cache = cacheFactory.createClusteredCache();
+      // theses default are not for performance settings but meant for problem detection:
+      Cache<CacheKey, Object> cache = cacheFactory.createClusteredCache();
       InfinispanDirectory dir = new InfinispanDirectory(cache, "iname");
       testDirectory(dir, "InfinispanClustered");
    }
-   
+
    @Test
    public void profileInfinispanLocalDirectory() throws InterruptedException, IOException {
       CacheContainer cacheManager = CacheTestSupport.createLocalCacheManager();
@@ -106,11 +105,11 @@
          cacheManager.stop();
       }
    }
-   
+
    private void testDirectory(Directory dir, String testLabel) throws InterruptedException, IOException {
       SharedState state = fillDirectory(dir);
       ExecutorService e = Executors.newFixedThreadPool(THREADS);
-      for (int i=0; i<THREADS; i++) {
+      for (int i = 0; i < THREADS; i++) {
          e.execute(new LuceneReaderThread(dir, state));
       }
       e.shutdown();
@@ -120,10 +119,10 @@
       long writerTaskCount = state.incrementIndexWriterTaskCount(0);
       state.quit();
       e.awaitTermination(10, TimeUnit.SECONDS);
-      System.out.println(
-               "Test " + testLabel +" run in " + DURATION_MS + "ms:\n\tSearches: " + searchesCount + "\n\t" + "Writes: " + writerTaskCount);
+      System.out.println("Test " + testLabel + " run in " + DURATION_MS + "ms:\n\tSearches: " + searchesCount + "\n\t" + "Writes: "
+               + writerTaskCount);
    }
-   
+
    private SharedState fillDirectory(Directory directory) throws CorruptIndexException, LockObtainFailedException, IOException {
       CacheTestSupport.initializeDirectory(directory);
       SharedState state = new SharedState(0);



More information about the infinispan-commits mailing list