geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zho...@apache.org
Subject [geode] branch feature/GEODE-3273 updated: GEODE-3273: if serializer has exception, not to update the index for this event
Date Wed, 27 Sep 2017 01:06:32 GMT
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 <gzhou@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" <commits@geode.apache.org>'].

Mime
View raw message