You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by up...@apache.org on 2016/06/22 01:11:56 UTC

[1/2] incubator-geode git commit: GEODE-11: Adding a dunit test of querying with a custom query object

Repository: incubator-geode
Updated Branches:
  refs/heads/develop 087da4e3d -> 588269395


GEODE-11: Adding a dunit test of querying with a custom query object


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/d25dd3fe
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/d25dd3fe
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/d25dd3fe

Branch: refs/heads/develop
Commit: d25dd3fe61a67027d10ebcb6b11f3b2ecf6cf444
Parents: 087da4e
Author: Dan Smith <up...@apache.org>
Authored: Wed Jun 15 15:33:13 2016 -0700
Committer: Dan Smith <up...@apache.org>
Committed: Tue Jun 21 18:03:38 2016 -0700

----------------------------------------------------------------------
 .../gemfire/cache/lucene/LuceneQueriesBase.java | 26 ++++++++++++++++++++
 1 file changed, 26 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d25dd3fe/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesBase.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesBase.java b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesBase.java
index 2fdf531..f077bad 100644
--- a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesBase.java
+++ b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesBase.java
@@ -33,6 +33,8 @@ import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.SerializableRunnableIF;
 import com.gemstone.gemfire.test.dunit.VM;
 
+import org.apache.lucene.index.Term;
+import org.apache.lucene.search.TermQuery;
 import org.junit.Test;
 
 /**
@@ -85,6 +87,30 @@ public abstract class LuceneQueriesBase extends LuceneDUnitTest {
   }
 
   @Test
+  public void canQueryWithCustomLuceneQueryObject() {
+    SerializableRunnableIF createIndex = () -> {
+      LuceneService luceneService = LuceneServiceProvider.get(getCache());
+      luceneService.createIndex(INDEX_NAME, REGION_NAME, "text");
+    };
+    dataStore1.invoke(() -> initDataStore(createIndex));
+    dataStore2.invoke(() -> initDataStore(createIndex));
+    accessor.invoke(() -> initAccessor(createIndex));
+    putDataInRegion(accessor);
+    assertTrue(waitForFlushBeforeExecuteTextSearch(dataStore1, 60000));
+
+    //Execute a query with a custom lucene query object
+    accessor.invoke(() -> {
+      Cache cache = getCache();
+      LuceneService service = LuceneServiceProvider.get(cache);
+      LuceneQuery query = service.createLuceneQueryFactory().create(INDEX_NAME, REGION_NAME, index ->  {
+        return new TermQuery(new Term("text", "world"));
+      });
+      final LuceneQueryResults results = query.search();
+      assertEquals(3, results.size());
+    });
+  }
+
+  @Test
   public void entriesFlushedToIndexAfterWaitForFlushCalled() {
     SerializableRunnableIF createIndex = () -> {
       LuceneService luceneService = LuceneServiceProvider.get(getCache());


[2/2] incubator-geode git commit: GEODE-1494: Fixing javadocs and stats descriptions for stat suppliers

Posted by up...@apache.org.
GEODE-1494: Fixing javadocs and stats descriptions for stat suppliers

Based on review feedback, correcting some javadocs and the description
of the sample callbacks stat.


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/58826939
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/58826939
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/58826939

Branch: refs/heads/develop
Commit: 5882693954d6f71e5479e08bfb0a2abb3ac956c2
Parents: d25dd3f
Author: Dan Smith <up...@apache.org>
Authored: Tue Jun 21 11:04:54 2016 -0700
Committer: Dan Smith <up...@apache.org>
Committed: Tue Jun 21 18:04:00 2016 -0700

----------------------------------------------------------------------
 .../java/com/gemstone/gemfire/Statistics.java   | 32 +++++++-------------
 .../gemfire/internal/StatSamplerStats.java      |  2 +-
 2 files changed, 12 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/58826939/geode-core/src/main/java/com/gemstone/gemfire/Statistics.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/Statistics.java b/geode-core/src/main/java/com/gemstone/gemfire/Statistics.java
index 0b9c18e..80426e2 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/Statistics.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/Statistics.java
@@ -466,9 +466,8 @@ public interface Statistics {
    * replaces any previously registered supplier. If the passed in suppplier is null, it
    * will remove any existing supplier
    * @return the previously registered supplier, or null if there was no previously registered supplier
-   * @throws ArrayIndexOutOfBoundsException If the id is invalid.
-   * @throws IllegalArgumentException if the type of this
-   * stat is not int
+   * @throws IllegalArgumentException If the id is invalid.
+   * @since Geode 1.0
    */
   public IntSupplier setIntSupplier(int id, IntSupplier supplier);
 
@@ -495,8 +494,7 @@ public interface Statistics {
    *         If no statistic exists with name <code>name</code> or
    *         if the statistic named <code>name</code> is not of
    *         type <code>int</code>.
-   * @throws IllegalArgumentException if the type of this
-   * stat is not int
+   * @since Geode 1.0
    */
   public IntSupplier setIntSupplier(String name, IntSupplier supplier);
 
@@ -524,8 +522,7 @@ public interface Statistics {
    *         If no statistic exists with the given <code>descriptor</code> or
    *         if the described statistic is not of
    *         type <code>int</code>.
-   * @throws IllegalArgumentException if the type of this
-   * stat is not int
+   * @since Geode 1.0
    */
   public IntSupplier setIntSupplier(StatisticDescriptor descriptor, IntSupplier supplier);
 
@@ -549,9 +546,8 @@ public interface Statistics {
    * replaces any previously registered supplier. If the passed in suppplier is null, it
    * will remove any existing supplier
    * @return the previously registered supplier, or null if there was no previously registered supplier
-   * @throws ArrayIndexOutOfBoundsException If the id is invalid.
-   * @throws IllegalArgumentException if the type of this
-   * stat is not long
+   * @throws IllegalArgumentException If the id is invalid.
+   * @since Geode 1.0
    */
   public LongSupplier setLongSupplier(int id, LongSupplier supplier);
 
@@ -578,8 +574,6 @@ public interface Statistics {
    *         If no statistic exists with name <code>name</code> or
    *         if the statistic named <code>name</code> is not of
    *         type <code>long</code>.
-   * @throws IllegalArgumentException if the type of this
-   * stat is not long
    */
   public LongSupplier setLongSupplier(String name, LongSupplier supplier);
 
@@ -607,8 +601,7 @@ public interface Statistics {
    *         If no statistic exists with the given <code>descriptor</code> or
    *         if the described statistic is not of
    *         type <code>long</code>.
-   * @throws IllegalArgumentException if the type of this
-   * stat is not long
+   * @since Geode 1.0
    */
   public LongSupplier setLongSupplier(StatisticDescriptor descriptor, LongSupplier supplier);
 
@@ -632,9 +625,8 @@ public interface Statistics {
    * replaces any previously registered supplier. If the passed in suppplier is null, it
    * will remove any existing supplier
    * @return the previously registered supplier, or null if there was no previously registered supplier
-   * @throws ArrayIndexOutOfBoundsException If the id is invalid.
-   * @throws IllegalArgumentException if the type of this
-   * stat is not double
+   * @throws IllegalArgumentException If the id is invalid.
+   * @since Geode 1.0
    */
   public DoubleSupplier setDoubleSupplier(int id, DoubleSupplier supplier);
 
@@ -661,8 +653,7 @@ public interface Statistics {
    *         If no statistic exists with name <code>name</code> or
    *         if the statistic named <code>name</code> is not of
    *         type <code>double</code>.
-   * @throws IllegalArgumentException if the type of this
-   * stat is not double
+   * @since Geode 1.0
    */
   public DoubleSupplier setDoubleSupplier(String name, DoubleSupplier supplier);
 
@@ -690,8 +681,7 @@ public interface Statistics {
    *         If no statistic exists with the given <code>descriptor</code> or
    *         if the described statistic is not of
    *         type <code>double</code>.
-   * @throws IllegalArgumentException if the type of this
-   * stat is not double
+   * @since Geode 1.0
    */
   public DoubleSupplier setDoubleSupplier(StatisticDescriptor descriptor, DoubleSupplier supplier);
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/58826939/geode-core/src/main/java/com/gemstone/gemfire/internal/StatSamplerStats.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/StatSamplerStats.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/StatSamplerStats.java
index bbe333c..c3d556f 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/StatSamplerStats.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/StatSamplerStats.java
@@ -61,7 +61,7 @@ public class StatSamplerStats {
                                                     "Total number of JVM pauses (which may or may not be full GC pauses) detected by this sampler. A JVM pause is defined as a system event which kept the statistics sampler thread from sampling for 3000 or more milliseconds. This threshold can be customized by setting the system property gemfire.statSamplerDelayThreshold (units are milliseconds).",
                                                     "jvmPauses", false),
                                  f.createIntGauge(SAMPLE_CALLBACKS,
-                                   "Total number of statistics that are sampled using callbacks.",
+                                   "Current number of statistics that are sampled using callbacks.",
                                    "resources", false),
                                  f.createIntCounter(SAMPLE_CALLBACK_ERRORS,
                                    "Total number of exceptions thrown by callbacks when performing sampling",