You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ud...@apache.org on 2018/03/28 23:18:44 UTC

[geode] branch feature/GEODE-3926_3 updated: Fixed NPE for waitingThreadPool

This is an automated email from the ASF dual-hosted git repository.

udo pushed a commit to branch feature/GEODE-3926_3
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/feature/GEODE-3926_3 by this push:
     new f9c4bd5  Fixed NPE for waitingThreadPool
f9c4bd5 is described below

commit f9c4bd5371bb35a1185e1ca0199ff9f01bf721d0
Author: Udo Kohlmeyer <uk...@pivotal.io>
AuthorDate: Wed Mar 28 16:17:23 2018 -0700

    Fixed NPE for waitingThreadPool
---
 .../lucene/internal/LuceneIndexForPartitionedRegion.java   | 14 +++++++++-----
 .../geode/cache/lucene/internal/LuceneServiceImpl.java     |  6 +++---
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneIndexForPartitionedRegion.java b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneIndexForPartitionedRegion.java
index 2f3e4ee..3d23683 100644
--- a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneIndexForPartitionedRegion.java
+++ b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneIndexForPartitionedRegion.java
@@ -54,6 +54,7 @@ public class LuceneIndexForPartitionedRegion extends LuceneIndexImpl {
 
   public LuceneIndexForPartitionedRegion(String indexName, String regionPath, InternalCache cache) {
     super(indexName, regionPath, cache);
+    this.waitingThreadPoolFromDM = cache.getDistributionManager().getWaitingThreadPool();
 
     final String statsName = indexName + "-" + regionPath;
     this.fileSystemStats = new FileSystemStats(cache.getDistributedSystem(), statsName);
@@ -143,9 +144,11 @@ public class LuceneIndexForPartitionedRegion extends LuceneIndexImpl {
   }
 
   protected <K, V> Region<K, V> createRegion(final String regionName,
-      final RegionShortcut regionShortCut, final String colocatedWithRegionName,
-      final PartitionAttributes partitionAttributes, final RegionAttributes regionAttributes,
-      PartitionListener lucenePrimaryBucketListener) {
+                                             final RegionShortcut regionShortCut,
+                                             final String colocatedWithRegionName,
+                                             final PartitionAttributes partitionAttributes,
+                                             final RegionAttributes regionAttributes,
+                                             PartitionListener lucenePrimaryBucketListener) {
     PartitionAttributesFactory partitionAttributesFactory = new PartitionAttributesFactory();
     if (lucenePrimaryBucketListener != null) {
       partitionAttributesFactory.addPartitionListener(lucenePrimaryBucketListener);
@@ -165,12 +168,13 @@ public class LuceneIndexForPartitionedRegion extends LuceneIndexImpl {
     return createRegion(regionName, attributes);
   }
 
-  public void close() {}
+  public void close() {
+  }
 
   @Override
   public void dumpFiles(final String directory) {
     ResultCollector results = FunctionService.onRegion(getDataRegion())
-        .setArguments(new String[] {directory, indexName}).execute(DumpDirectoryFiles.ID);
+        .setArguments(new String[]{directory, indexName}).execute(DumpDirectoryFiles.ID);
     results.getResult();
   }
 
diff --git a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneServiceImpl.java b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneServiceImpl.java
index 01bc5c6..3e08abd 100644
--- a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneServiceImpl.java
+++ b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneServiceImpl.java
@@ -166,8 +166,7 @@ public class LuceneServiceImpl implements InternalLuceneService {
     if (!regionPath.startsWith("/")) {
       regionPath = "/" + regionPath;
     }
-    String name = indexName + "#" + regionPath.replace('/', '_');
-    return name;
+    return indexName + "#" + regionPath.replace('/', '_');
   }
 
   public static String getUniqueIndexRegionName(String indexName, String regionPath,
@@ -182,7 +181,7 @@ public class LuceneServiceImpl implements InternalLuceneService {
     }
     Analyzer analyzer = new PerFieldAnalyzerWrapper(new StandardAnalyzer(), fieldAnalyzers);
     Set<String> fieldsSet = fieldAnalyzers.keySet();
-    String[] fields = fieldsSet.toArray(new String[fieldsSet.size()]);
+    String[] fields = fieldsSet.toArray(new String[0]);
 
     createIndex(indexName, regionPath, analyzer, fieldAnalyzers, serializer, allowOnExistingRegion,
         fields);
@@ -209,6 +208,7 @@ public class LuceneServiceImpl implements InternalLuceneService {
       return;
     }
 
+
     if (!allowOnExistingRegion) {
       definedIndexMap.remove(LuceneServiceImpl.getUniqueIndexName(indexName, regionPath));
       throw new IllegalStateException("The lucene index must be created before region");

-- 
To stop receiving notification emails like this one, please contact
udo@apache.org.