You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by zh...@apache.org on 2017/09/27 01:06:32 UTC

[geode] branch feature/GEODE-3273 updated: GEODE-3273: if serializer has exception, not to update the index for this event

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

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


The following commit(s) were added to refs/heads/feature/GEODE-3273 by this push:
     new c378319  GEODE-3273: if serializer has exception, not to update the index for this event
c378319 is described below

commit c378319840790f7b15913dd94cb021065d6ef71c
Author: zhouxh <gz...@pivotal.io>
AuthorDate: Tue Sep 26 18:05:47 2017 -0700

    GEODE-3273: if serializer has exception, not to update the index for this event
---
 .../lucene/internal/repository/IndexRepositoryImpl.java    | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/repository/IndexRepositoryImpl.java b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/repository/IndexRepositoryImpl.java
index 4a856a0..0032fe9 100644
--- a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/repository/IndexRepositoryImpl.java
+++ b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/repository/IndexRepositoryImpl.java
@@ -87,8 +87,10 @@ public class IndexRepositoryImpl implements IndexRepository {
         stats.incFailedEntries();
         logger.info("Failed to add index for " + value + " due to " + e.getMessage());
       }
-      docs.forEach(doc -> SerializerUtil.addKey(key, doc));
-      writer.addDocuments(docs);
+      if (!docs.isEmpty()) {
+        docs.forEach(doc -> SerializerUtil.addKey(key, doc));
+        writer.addDocuments(docs);
+      }
     } finally {
       stats.endUpdate(start);
     }
@@ -105,9 +107,11 @@ public class IndexRepositoryImpl implements IndexRepository {
         stats.incFailedEntries();
         logger.info("Failed to update index for " + value + " due to " + e.getMessage());
       }
-      docs.forEach(doc -> SerializerUtil.addKey(key, doc));
-      Term keyTerm = SerializerUtil.toKeyTerm(key);
-      writer.updateDocuments(keyTerm, docs);
+      if (!docs.isEmpty()) {
+        docs.forEach(doc -> SerializerUtil.addKey(key, doc));
+        Term keyTerm = SerializerUtil.toKeyTerm(key);
+        writer.updateDocuments(keyTerm, docs);
+      }
     } finally {
       stats.endUpdate(start);
     }

-- 
To stop receiving notification emails like this one, please contact
['"commits@geode.apache.org" <co...@geode.apache.org>'].