incubator-geode git commit: Adding my PGP key to KEYS
Repository: incubator-geode Updated Branches: refs/heads/develop a847c550b -> 06de52736 Adding my PGP key to KEYS Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/06de5273 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/06de5273 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/06de5273 Branch: refs/heads/develop Commit: 06de52736845a434ab0325766fab44506a81df2a Parents: a847c55 Author: zhouxhAuthored: Tue Oct 25 14:17:26 2016 -0700 Committer: zhouxh Committed: Tue Oct 25 14:17:26 2016 -0700 -- KEYS | 128 ++ 1 file changed, 128 insertions(+) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/06de5273/KEYS -- diff --git a/KEYS b/KEYS index cbc5354..183abc1 100644 --- a/KEYS +++ b/KEYS @@ -897,3 +897,131 @@ CmrjtFbx4w8QQYkUwvYYtdVWD2JvNnp/eX89ROcaS+TCbLukaC3OphBXvWI3k1BK Vb32t+OopTVcELjTjAMBsixx+IaBClvjPXBTuaSXA4S+ =SSEN -END PGP PUBLIC KEY BLOCK- +-BEGIN PGP PUBLIC KEY BLOCK- +Version: GnuPG v2 + +mQENBFcGu5QBCACdmRgd8tfI7RVBdySyL/z41j+yJXdAak2BPXyVvlKP0FMvb0qB +U6l8vk89HB+jpr5HtUFn+/rj4HuN8IK2blyn8NkSFCWdxirOZWWhMXyNFZQNJ7O7 ++DdR8/ko/5I8RsLQ3cHLrF4e4c3NtAhv1IndFisd+mnalcnhLMIQU3899YC+VK4N +KkSs9N1WDBtTd/kdr6sRUvkHf5hlICaXxmYwDknJ/jdLOI7bZN90fTWH0dWQNf2p +6qEJlG/TrcW8IFVVk/eS9lk2eMVpYe8ObOfoF5lxfBqElTuuFOVQ+ermUzrQ+C7j +HUYRKGsxs13cJXnaq3m2GCFbCuMzsU0aqg99ABEBAAG0J1hpYW9qaWFuIFpob3Ug +PHpob3UueGlhb2ppYW5AZ21haWwuY29tPokBOQQTAQgAIwUCVwa7lAIbAwcLCQgH +AwIBBhUIAgkKCwQWAgMBAh4BAheAAAoJEHbgUH6u2u49LkEH/3hL5UqceDnOV+2s +Fx2kiT7L5dYQWHETls8ZFkrpokCHhPt7A/MxYPP06Ohe7q1g8FJhKeQbzXD6FSdq +ewn2t9DwZN/pIIdPR/6OTgwgwhqeQvdLQIAZBbC3qjIRe0KxJFtxgcBVMXN8aWfa +iUF/6ir+6bjx6/mtziTI3A/qdO/D8C3TwU2SpqpqLh1N/cTcgU6ZtIk/ZiaL4Eh4 +qIO205p1fvFX6gytrBkX9aBVSMtJFkOCBX/VqkGsrGcDtQYEwNEbI5rVFiYmA5of +j8VxrSpXXK8eirXcHEzEbW969Wu29GzdhYIipVjVwDwmA+M6Wf6093jI+Y5IrgAf +jgxhYn6JARwEEAEIAAYFAlcGyHkACgkQ8EzEmalmEzoZCwf/cl37XcJuH29yTzLr +ApFMNxOEUb9p5wMKMSyEM7NzIMJc9luP2Di1nCZ/Hgp9+cjVFSwQ5eR8s4+y6d3b +0Fva7QdMit1GLN+F/vV8ln8fql7SYbjhI/Z4yskMl4nvL8DBlPKGHTv5ruXQAmJi +y50iCoa9wSXeU8ZT5N7g+BsbryRvfdKjYLfSdMUa4YlR/pRVTitivpwcyA4mN0AQ +27Tb/ygurqHAVNlmgJjX0fowwOUEr1aqgasTRv5meet//utQsiRlIKGF43IMLai0 +dhk+r/EtXIsHaQXmGGpcFhFf0FN18x52A3LXsZTeSELxCXY8YdzhmtJmyRt7H+pe +vgEPY4kCHAQQAQoABgUCVwa+JAAKCRBETB0goWiNl3uzD/4+8vs9zX89F8o4HMyF +DpxzgH3etpjM8CScHcNdbVnrcO3OCgGg1nO8HMwRZS6PjIS0FVfl9csNMOZw8/SJ +FdVz8u2GycyueiRu4SZHA0smu7lZlLNeB1AOqYFmreXbAHLd8LnCxlW4qA5RPtw/ +x0nWVSNJ5zUvJjBXurcDPS/FpcdaTRoK2jkWePddF/c4SBkgc1VARHWhqIuwvohZ +ifCEeeU11l0Vl4HZCj0hgUUt9gXAcjk4YhCsSba/Cz3ERuxlhRgluvhBYlp+DzHq +0benTCOSVUywTLUjajxdeV1l0jgH1Ps9Rvq8KYBPyP8PcdONLDIa9VcrhZNHabHN +SUZRz3hAp/xsDY9oihUCHn1zfGklZRidAorR5FS0UZzFy8PoV6+Mrz2inf1xZapK +a4bA3A0fYm1z3pXxA7ty6XCtwaQ7Gavs3toAXZWdiTtvqdObjb+3Zmhh1o63BA9t +wIMi5dGy9/xvlQT7Ah6vWtJwGD45t9MwbRnDdivk0/3EJlZWwVzlHoPfjzUFKo+J +zpU4cWRljJQPps5EAPFPl/OWx0nHbvrpbBQzc6f+ZbB+LszEetap+xq9yVJbGlXU +cLr5OSAe0IWwOca5CGXCiO2Rr33jnCjLwshNTsPi4Iqtj+1ZVE75eDDbLXvQL+DF +YIhA56DNZ8svFfBs34gtrW60fYkCIgQQAQoADAUCVwa/ugWDB4YfgAAKCRAmj1Aw +i2z43fBJD/4i1ac8VxqMuSiEovEb/b+BbW2hipE6BofLdHIG3pixyo4mWR+EWlCB +BDP8Vm/TZrnBS4b22K3xui4wR7ReTS5qqifv2LHxUdWMYZIbCGp4M1QbTmtGPvWG +F6p/cw0lMltX2zTxRf1H/T71xvy8n4s07BZ7i0dgySYyZHDptXkPyZJGHeE1RbFW +mwvvW3n8q40wETQXXTajIiUJEsDVbqTPTL5dlHrCbIdUXzxB+vkcg8e6sqZAqKJz +YIaeL7VjbF9vzvcc6nLMa4qrlaBVOFfVrCgA8BL03UOIJ6sTmrXF7p4/qyxc8BIR +kTQSXBU6t+D9NTXIGZ1VtOxuIIbE5TzzVGGHni/+D3aHhZjI/WHpXjvWgFfd6xY4 +6mVhO2H1pqgnnTqp+P4HCjKmoifUXVdqZnM0KAT2+RmIQ4FTXTZ/anxIIgETXXtF +UiR9n+lc/P5D25UEj+gL07L+2smb0UYQmPAvCs0gGgyfR+iovOFX4CO9c/UPwnKf +lPlW1u0nIEBIK6Z0kgsHCEh9H5NE1IV5YUY/2lq8ymAatCIf0+vaeI1b44j15aqd +f1n/Ddp9eH8WOsicO9E5FJqBaOIGeRcGxkpFeix0HiMq0q5rwoC6M1agSxNdZVWy +FkQx8r0kIMa28KDvMLFEhiLsc7sEZYHvcy0N5gYtXsu29hqva1XA0IkCIgQQAQoA +DAUCVwbAUgWDB4YfgAAKCRDg7ynLSKVPhAyAD/9eBoOoc6a9tl7zIzBBlKjHMvFh +Uv2zDJQpT6bd7HdzNnB9Ja2k72xeOzxdLH+2PU5IO0nrasJQMmvxSYQ4nPg1jWOQ +hE8TQ061Y2Fbv8Z0eb5HJKcvI74xcseoML4wg15V69XV9768eeQD53jGpLoarbd8 +sNMOn8je6Gp1lGJ2MSxFOiPI2VWCTzc4BHMVv7t8VvQDOgOgEYw5ZhW1U+4spSWi +45mS4y8V0zaA8x4pULkP1en+x3F8zavKWwJqCAl6zmd5gYtAvfEroXSLE7r/lRwd +8gHJD/lhUmFLok31c61+a2yz8bDdD26noDorO7O66sYSJowflHsDz5jB9j1/iL3Z +eHoM0ANLZ8TNHnR/buyiKoUG+BuQCCKBQH00ifqqP7UabLea/Ajbf9hxHGxfjOiA +EA2Ij7pbYYR39FBdww3QmJxU9MyFL89h8egW5XE7Q73MdCd8WiqrLj4/NYI1Gvht ++5QKR0sY0jtJpX9+YW+8XBb2HwfwIZvmP/H6nyaXPq2uLCMNMMl+HNs4dpM5+1Gz +dqHoyCpNoY39G3KdxWFe+Cwmf0Jt5JZab4DkRjYSRRkQ3R/lIdDnqPRaa0YConVh +puywIKjS/yJWC6Sg9m6Wh1uf0IM94d45OGuFV/wDnky6kqnTOOwB5XIjaZvNflIU +W1zh5l9Eb9fS9g55bokCIgQTAQgADAUCVwa+9AWDB4YfgAAKCRBWSn1JwdVHAe16
incubator-geode git commit: GEODE-1956: fix the race condition that cause the vm only hosts 1 primary bucket
Repository: incubator-geode Updated Branches: refs/heads/develop 68aef5b7f -> 4b3ae7867 GEODE-1956: fix the race condition that cause the vm only hosts 1 primary bucket Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/4b3ae786 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/4b3ae786 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/4b3ae786 Branch: refs/heads/develop Commit: 4b3ae78675bedc7c1bc3ee247fbd66f465614b79 Parents: 68aef5b Author: zhouxhAuthored: Mon Oct 10 11:46:53 2016 -0700 Committer: zhouxh Committed: Mon Oct 10 11:46:53 2016 -0700 -- .../java/org/apache/geode/cache/lucene/LuceneQueriesPRBase.java| 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4b3ae786/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesPRBase.java -- diff --git a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesPRBase.java b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesPRBase.java index d24131a..dd3dea1 100644 --- a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesPRBase.java +++ b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesPRBase.java @@ -54,7 +54,7 @@ import org.apache.geode.test.dunit.VM; * */ public abstract class LuceneQueriesPRBase extends LuceneQueriesBase { - protected static final int NUM_BUCKETS = 7; + protected static final int NUM_BUCKETS = 10; @After public void cleanupRebalanceCallback() {
incubator-geode git commit: GEODE-1956: fix the race condition that cause the vm only hosts 1 primary bucket
Repository: incubator-geode Updated Branches: refs/heads/master 2e1075246 -> c3162e0b9 GEODE-1956: fix the race condition that cause the vm only hosts 1 primary bucket Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/c3162e0b Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/c3162e0b Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/c3162e0b Branch: refs/heads/master Commit: c3162e0b9d7315c4665ebd05e26515228f9e89de Parents: 2e10752 Author: zhouxhAuthored: Mon Oct 10 11:20:25 2016 -0700 Committer: zhouxh Committed: Mon Oct 10 11:20:25 2016 -0700 -- .../com/gemstone/gemfire/cache/lucene/LuceneQueriesPRBase.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/c3162e0b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesPRBase.java -- diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesPRBase.java b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesPRBase.java index 1de600d..66a5f48 100644 --- a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesPRBase.java +++ b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesPRBase.java @@ -49,7 +49,7 @@ import com.gemstone.gemfire.test.dunit.VM; * */ public abstract class LuceneQueriesPRBase extends LuceneQueriesBase { - protected static final int NUM_BUCKETS = 7; + protected static final int NUM_BUCKETS = 10; @After public void cleanupRebalanceCallback() {
incubator-geode git commit: GEODE-1894: there's a race that AckReader thred is reading for ack (hold the read lock), while stopping sender thread tried to hold the write lock.
Repository: incubator-geode Updated Branches: refs/heads/develop 4f2e27749 -> a1938b386 GEODE-1894: there's a race that AckReader thred is reading for ack (hold the read lock), while stopping sender thread tried to hold the write lock. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/a1938b38 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/a1938b38 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/a1938b38 Branch: refs/heads/develop Commit: a1938b386f1ed9064529df7f4206af913d4461c2 Parents: 4f2e277 Author: zhouxhAuthored: Fri Sep 23 10:02:21 2016 -0700 Committer: zhouxh Committed: Fri Sep 23 10:02:21 2016 -0700 -- .../internal/cache/wan/GatewaySenderEventRemoteDispatcher.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a1938b38/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderEventRemoteDispatcher.java -- diff --git a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderEventRemoteDispatcher.java b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderEventRemoteDispatcher.java index 6beb0ee..da94f65 100644 --- a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderEventRemoteDispatcher.java +++ b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderEventRemoteDispatcher.java @@ -98,7 +98,7 @@ public class GatewaySenderEventRemoteDispatcher implements } this.connectionLifeCycleLock.readLock().lock(); try { -if (connection != null) { +if (connection != null && !processor.isStopped()) { ack = (GatewayAck)sp.receiveAckFromReceiver(connection); } } finally {
incubator-geode git commit: GEODE-11: let profile's getId() return unique name
Repository: incubator-geode Updated Branches: refs/heads/develop f497c596c -> 426f1ae22 GEODE-11: let profile's getId() return unique name Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/426f1ae2 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/426f1ae2 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/426f1ae2 Branch: refs/heads/develop Commit: 426f1ae22f1c5933dd14c08c29c7afbfdef60f4f Parents: f497c59 Author: zhouxhAuthored: Thu Sep 1 18:04:14 2016 -0700 Committer: zhouxh Committed: Thu Sep 1 18:05:06 2016 -0700 -- .../lucene/internal/LuceneIndexCreationProfile.java | 12 +++- .../cache/lucene/internal/LuceneServiceImpl.java| 2 +- .../internal/LuceneIndexCreationProfileJUnitTest.java | 12 ++-- 3 files changed, 10 insertions(+), 16 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/426f1ae2/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexCreationProfile.java -- diff --git a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexCreationProfile.java b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexCreationProfile.java index 720d20d..de331ea 100644 --- a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexCreationProfile.java +++ b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexCreationProfile.java @@ -44,14 +44,6 @@ public class LuceneIndexCreationProfile implements CacheServiceProfile, DataSeri /* Used by DataSerializer */ public LuceneIndexCreationProfile() {} - public LuceneIndexCreationProfile(String indexName, String[] fieldNames, Analyzer analyzer, - Map fieldAnalyzers) { -this.indexName = indexName; -this.fieldNames = fieldNames; -this.analyzerClass = analyzer.getClass().getSimpleName(); -initializeFieldAnalyzers(fieldAnalyzers); - } - public LuceneIndexCreationProfile(String indexName, String regionPath, String[] fieldNames, Analyzer analyzer, Map fieldAnalyzers) { this.indexName = indexName; @@ -90,7 +82,7 @@ public class LuceneIndexCreationProfile implements CacheServiceProfile, DataSeri @Override public String getId() { -return this.indexName; +return "lucene_"+LuceneServiceImpl.getUniqueIndexName(indexName, regionPath); } @Override @@ -143,6 +135,7 @@ public class LuceneIndexCreationProfile implements CacheServiceProfile, DataSeri @Override public void toData(DataOutput out) throws IOException { DataSerializer.writeString(this.indexName, out); +DataSerializer.writeString(this.regionPath, out); DataSerializer.writeStringArray(this.fieldNames, out); DataSerializer.writeString(this.analyzerClass, out); DataSerializer.writeHashMap(this.fieldAnalyzers, out); @@ -151,6 +144,7 @@ public class LuceneIndexCreationProfile implements CacheServiceProfile, DataSeri @Override public void fromData(DataInput in) throws IOException, ClassNotFoundException { this.indexName = DataSerializer.readString(in); +this.regionPath = DataSerializer.readString(in); this.fieldNames = DataSerializer.readStringArray(in); this.analyzerClass = DataSerializer.readString(in); this.fieldAnalyzers = DataSerializer.readHashMap(in); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/426f1ae2/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneServiceImpl.java -- diff --git a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneServiceImpl.java b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneServiceImpl.java index 29a8e62..81a62b8 100644 --- a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneServiceImpl.java +++ b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneServiceImpl.java @@ -183,7 +183,7 @@ public class LuceneServiceImpl implements InternalLuceneService { } // Add index creation profile - internalRegionArgs.addCacheServiceProfile(new LuceneIndexCreationProfile(indexName, fields, analyzer, fieldAnalyzers)); + internalRegionArgs.addCacheServiceProfile(new LuceneIndexCreationProfile(indexName, dataRegionPath, fields, analyzer, fieldAnalyzers)); } return updatedRA; }
incubator-geode git commit: GEODE-1833: should save the reference locally in case other thread closed the server location.
Repository: incubator-geode Updated Branches: refs/heads/develop fd3786a82 -> ea5516c53 GEODE-1833: should save the reference locally in case other thread closed the server location. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/ea5516c5 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/ea5516c5 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/ea5516c5 Branch: refs/heads/develop Commit: ea5516c53fa124da7ff7ee91f69d52e78949bbfd Parents: fd3786a Author: zhouxhAuthored: Wed Aug 31 16:48:13 2016 -0700 Committer: zhouxh Committed: Thu Sep 1 08:57:48 2016 -0700 -- .../cache/wan/GatewaySenderEventRemoteDispatcher.java| 8 1 file changed, 4 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ea5516c5/geode-wan/src/main/java/com/gemstone/gemfire/internal/cache/wan/GatewaySenderEventRemoteDispatcher.java -- diff --git a/geode-wan/src/main/java/com/gemstone/gemfire/internal/cache/wan/GatewaySenderEventRemoteDispatcher.java b/geode-wan/src/main/java/com/gemstone/gemfire/internal/cache/wan/GatewaySenderEventRemoteDispatcher.java index 2625ad2..d2302c4 100644 --- a/geode-wan/src/main/java/com/gemstone/gemfire/internal/cache/wan/GatewaySenderEventRemoteDispatcher.java +++ b/geode-wan/src/main/java/com/gemstone/gemfire/internal/cache/wan/GatewaySenderEventRemoteDispatcher.java @@ -398,12 +398,12 @@ public class GatewaySenderEventRemoteDispatcher implements } else { synchronized (this.sender .getLockForConcurrentDispatcher()) { -if (this.sender.getServerLocation() != null) { +ServerLocation server = this.sender.getServerLocation(); +if (server != null) { if (logger.isDebugEnabled()) { -logger.debug("ServerLocation is: {}. Connecting to this serverLocation...", sender.getServerLocation()); +logger.debug("ServerLocation is: {}. Connecting to this serverLocation...", server); } - con = this.sender.getProxy().acquireConnection( - this.sender.getServerLocation()); + con = this.sender.getProxy().acquireConnection(server); } else { if (logger.isDebugEnabled()) { logger.debug("ServerLocation is null. Creating new connection. ");
incubator-geode git commit: GEODE-11: need to fix the junit test case when adding FSDirectory
Repository: incubator-geode Updated Branches: refs/heads/develop 746820bb1 -> fd3786a82 GEODE-11: need to fix the junit test case when adding FSDirectory Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/fd3786a8 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/fd3786a8 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/fd3786a8 Branch: refs/heads/develop Commit: fd3786a82f3a61f03fac1a4154c721dc406e3805 Parents: 746820b Author: zhouxhAuthored: Wed Aug 31 18:05:37 2016 -0700 Committer: zhouxh Committed: Wed Aug 31 18:05:37 2016 -0700 -- .../internal/repository/IndexRepositoryImplJUnitTest.java | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/fd3786a8/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/repository/IndexRepositoryImplJUnitTest.java -- diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/repository/IndexRepositoryImplJUnitTest.java b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/repository/IndexRepositoryImplJUnitTest.java index dd0378a..8f8bbb6 100644 --- a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/repository/IndexRepositoryImplJUnitTest.java +++ b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/repository/IndexRepositoryImplJUnitTest.java @@ -65,6 +65,7 @@ public class IndexRepositoryImplJUnitTest { private StandardAnalyzer analyzer = new StandardAnalyzer(); private IndexWriter writer; private Region region; + private Region userRegion; private LuceneIndexStats stats; private FileSystemStats fileSystemStats; @@ -79,9 +80,10 @@ public class IndexRepositoryImplJUnitTest { String[] indexedFields= new String[] {"s", "i", "l", "d", "f", "s2", "missing"}; mapper = new HeterogeneousLuceneSerializer(indexedFields); region = Mockito.mock(Region.class); +userRegion = Mockito.mock(Region.class); stats = Mockito.mock(LuceneIndexStats.class); -Mockito.when(region.isDestroyed()).thenReturn(false); -repo = new IndexRepositoryImpl(region, writer, mapper, stats, null); +Mockito.when(userRegion.isDestroyed()).thenReturn(false); +repo = new IndexRepositoryImpl(region, writer, mapper, stats, userRegion); } @Test
incubator-geode git commit: GEODE-11: create index repository using raw Lucene directory.
Repository: incubator-geode Updated Branches: refs/heads/develop 07798ca80 -> 746820bb1 GEODE-11: create index repository using raw Lucene directory. GEODE-11: add RawDirectory using index instance GEODE-11: add abstract class for index and repositoryManager remove commented lines in test code Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/746820bb Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/746820bb Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/746820bb Branch: refs/heads/develop Commit: 746820bb18fe3f3ab7bd6b00f847821d934bbf09 Parents: 07798ca Author: zhouxhAuthored: Fri Jul 15 15:57:07 2016 -0700 Committer: zhouxh Committed: Wed Aug 31 17:09:08 2016 -0700 -- .../AbstractPartitionedRepositoryManager.java | 124 + .../lucene/internal/IndexRepositoryFactory.java | 21 ++- .../lucene/internal/LuceneIndexFactory.java | 30 + .../LuceneIndexForPartitionedRegion.java| 134 +++ .../cache/lucene/internal/LuceneIndexImpl.java | 79 +-- .../cache/lucene/internal/LuceneRawIndex.java | 43 ++ .../lucene/internal/LuceneRawIndexFactory.java | 27 .../lucene/internal/LuceneServiceImpl.java | 3 +- .../internal/PartitionedRepositoryManager.java | 123 ++--- .../internal/RawIndexRepositoryFactory.java | 63 + .../internal/RawLuceneRepositoryManager.java| 46 +++ .../repository/IndexRepositoryImpl.java | 6 +- .../LuceneIndexCreationIntegrationTest.java | 29 .../cache/lucene/LuceneQueriesPRBase.java | 7 +- .../LuceneIndexForPartitionedRegionTest.java| 34 - .../LuceneIndexRecoveryHAIntegrationTest.java | 19 +-- .../PartitionedRepositoryManagerJUnitTest.java | 68 +- .../RawLuceneRepositoryManagerJUnitTest.java| 97 ++ .../DistributedScoringJUnitTest.java| 2 +- .../IndexRepositoryImplJUnitTest.java | 2 +- .../IndexRepositoryImplPerformanceTest.java | 2 +- .../cache/lucene/test/IndexRepositorySpy.java | 20 +-- 22 files changed, 689 insertions(+), 290 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/746820bb/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/AbstractPartitionedRepositoryManager.java -- diff --git a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/AbstractPartitionedRepositoryManager.java b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/AbstractPartitionedRepositoryManager.java new file mode 100755 index 000..1dc716c --- /dev/null +++ b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/AbstractPartitionedRepositoryManager.java @@ -0,0 +1,124 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.gemstone.gemfire.cache.lucene.internal; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + +import com.gemstone.gemfire.InternalGemFireError; +import com.gemstone.gemfire.cache.Region; +import com.gemstone.gemfire.cache.execute.RegionFunctionContext; +import com.gemstone.gemfire.cache.lucene.internal.repository.IndexRepository; +import com.gemstone.gemfire.cache.lucene.internal.repository.RepositoryManager; +import com.gemstone.gemfire.cache.lucene.internal.repository.serializer.LuceneSerializer; +import com.gemstone.gemfire.internal.cache.BucketNotFoundException; +import com.gemstone.gemfire.internal.cache.BucketRegion; +import com.gemstone.gemfire.internal.cache.PartitionedRegion; +import com.gemstone.gemfire.internal.cache.execute.InternalRegionFunctionContext; + +public abstract class AbstractPartitionedRepositoryManager implements RepositoryManager { + + /** map of the parent bucket region to the index
incubator-geode git commit: GEODE-11: Fixing bug that arises while using user defined analyzer in gfsh.
Repository: incubator-geode Updated Branches: refs/heads/develop cea5535cf -> 1ab59ffb2 GEODE-11: Fixing bug that arises while using user defined analyzer in gfsh. This closes #233 When we use an user defined analyzer class in gfsh, the cluster hangs because the create region message that is sent has a LuceneIndexCreationProfile has a user defined analyzer class. Fixed this by storing only the class name in LuceneIndexCreationProfile. Signed-off-by: Gester ZhouGEODE-11: StandardAnalyzer is used when analyzer option is null Using the string "null" in the analyzer option for create lucene index command will now set the field analyzer to be StandardAnalyzer. GEODE-11: Added CliAvailabilityIndicator to lucene gfsh commands The lucene gfsh commands were available offline. Changed this behavior by adding CliAvailabilityIndicator. GEODE-11:Fix for "Comparison method violates general contract" The search results are sorted by score and the compareTo method caused the "Comparison method violates general contract" error when it returned multiple results with same score. Signed-off-by: Gester Zhou GEODE 11: Added a check to make sure StandardAnalyzer and NULL were considered the same. LuceneIndexCreationProfile checks to makes sure the newly created index's field analyzers are consistent with existing indexes' field analyzers. However, when a field's analyzer is null and a new index is created with StandardAnalyzer on the same field, it failed. Fixed this issue by modifying the conditional checks. Added dunit tests to verify. Signed-off-by: Gester Zhou GEODE 11: Added a check to make sure StandardAnalyzer and NULL were considered the same. LuceneIndexCreationProfile checks to makes sure the newly created index's field analyzers are consistent with existing indexes' field analyzers. However, when a field's analyzer is null and a new index is created with StandardAnalyzer on the same field, it failed. Fixed this issue by modifying the conditional checks. Added dunit tests to verify. Signed-off-by: Gester Zhou GEODE 11: Clean up of comparison code in LuceneIndexCreationProfile Since the null in fieldAnalyzers are converted to Standard analyzer, a few checks become irrelevant. Modified the code and relevant tests. Signed-off-by: Gester Zhou fix merge issue Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/1ab59ffb Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/1ab59ffb Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/1ab59ffb Branch: refs/heads/develop Commit: 1ab59ffb20346a957cfcbc8324376f772f14da96 Parents: cea5535 Author: Aparna Dharmakkan Authored: Thu Aug 11 16:35:41 2016 -0700 Committer: zhouxh Committed: Fri Aug 19 11:46:39 2016 -0700 -- .../internal/LuceneIndexCreationProfile.java| 98 +++- .../internal/cli/LuceneIndexCommands.java | 7 ++ .../lucene/internal/cli/LuceneIndexDetails.java | 8 +- .../internal/cli/LuceneSearchResults.java | 2 +- .../functions/LuceneCreateIndexFunction.java| 12 ++- .../lucene/LuceneIndexCreationDUnitTest.java| 58 +--- .../LuceneIndexCreationProfileJUnitTest.java| 11 ++- .../cli/LuceneIndexCommandsDUnitTest.java | 34 +++ .../cli/LuceneIndexCommandsJUnitTest.java | 40 .../cache/lucene/test/LuceneTestUtilities.java | 11 +-- 10 files changed, 186 insertions(+), 95 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1ab59ffb/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexCreationProfile.java -- diff --git a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexCreationProfile.java b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexCreationProfile.java index 12f4ae5..720d20d 100644 --- a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexCreationProfile.java +++ b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexCreationProfile.java @@ -22,6 +22,7 @@ import com.gemstone.gemfire.internal.Version; import com.gemstone.gemfire.internal.cache.CacheServiceProfile; import com.gemstone.gemfire.internal.i18n.LocalizedStrings; import org.apache.lucene.analysis.Analyzer; +import org.apache.lucene.analysis.standard.StandardAnalyzer; import java.io.DataInput; import java.io.DataOutput; @@ -34,9 +35,9 @@ public class LuceneIndexCreationProfile implements CacheServiceProfile, DataSeri private String[] fieldNames;
incubator-geode git commit: This closes #229
Repository: incubator-geode Updated Branches: refs/heads/develop affb50495 -> e0d80a255 This closes #229 GEODE-11: Fixing bug in definedIndexMap in LuceneServiceImpl If an index is created on an existing region, an exception is thrown, but the index is still stored in definedIndexMap. This is fixed by removing the index definition before the exception is thrown. Added a test to verify GEODE-11: Describe/Search index gfsh commands returns error message when region not created - Previously, the describe/search index gfsh command on definied indexes returned an exception. Changed the behavior to return a message. Added dunit test to verify - Changed Search index command to "search lucene" (previously "lucene search") Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/e0d80a25 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/e0d80a25 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/e0d80a25 Branch: refs/heads/develop Commit: e0d80a25583f8fb0be20f69ee62d43107ac87208 Parents: affb504 Author: Aparna DharmakkanAuthored: Tue Aug 9 13:56:02 2016 -0700 Committer: zhouxh Committed: Tue Aug 9 15:41:13 2016 -0700 -- .../cache/lucene/internal/LuceneServiceImpl.java | 1 + .../lucene/internal/cli/LuceneCliStrings.java | 2 +- .../lucene/internal/cli/LuceneIndexCommands.java | 12 +--- .../LuceneIndexCreationIntegrationTest.java | 12 .../cli/LuceneIndexCommandsDUnitTest.java | 18 +++--- 5 files changed, 26 insertions(+), 19 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0d80a25/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneServiceImpl.java -- diff --git a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneServiceImpl.java b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneServiceImpl.java index b0da08d..8375888 100644 --- a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneServiceImpl.java +++ b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneServiceImpl.java @@ -143,6 +143,7 @@ public class LuceneServiceImpl implements InternalLuceneService { Region region = cache.getRegion(regionPath); if(region != null) { + definedIndexMap.remove(LuceneServiceImpl.getUniqueIndexName(indexName, regionPath)); throw new IllegalStateException("The lucene index must be created before region"); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0d80a25/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneCliStrings.java -- diff --git a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneCliStrings.java b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneCliStrings.java index f573bf5..b424d8f 100644 --- a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneCliStrings.java +++ b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneCliStrings.java @@ -59,7 +59,7 @@ public class LuceneCliStrings { //Search lucene index commands - public static final String LUCENE_SEARCH_INDEX = "lucene search"; + public static final String LUCENE_SEARCH_INDEX = "search lucene"; public static final String LUCENE_SEARCH_INDEX__HELP = "Search lucene index"; public static final String LUCENE_SEARCH_INDEX__ERROR_MESSAGE = "An error occurred while searching lucene index across the Geode cluster: %1$s"; public static final String LUCENE_SEARCH_INDEX__NAME__HELP = "Name of the lucene index to search."; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0d80a25/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneIndexCommands.java -- diff --git a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneIndexCommands.java b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneIndexCommands.java index e25f7dd..20c3990 100755 --- a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneIndexCommands.java +++ b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneIndexCommands.java @@ -243,6 +243,9 @@ public class LuceneIndexCommands extends AbstractCommandsSupport { SystemFailure.initiateFailure(e); throw e; } +catch (IllegalArgumentException e) { +
incubator-geode git commit: GEODE-11: Changing test to check if the bug is fixed.
Repository: incubator-geode Updated Branches: refs/heads/develop 2cab2ee70 -> 59e4c447e GEODE-11: Changing test to check if the bug is fixed. Signed-off-by: Gester ZhouThis closes #222 Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/59e4c447 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/59e4c447 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/59e4c447 Branch: refs/heads/develop Commit: 59e4c447e6e645d3ea3ce3093e33a6d8774b1cc3 Parents: 2cab2ee Author: Aparna Dharmakkan Authored: Mon Aug 1 15:48:16 2016 -0700 Committer: zhouxh Committed: Mon Aug 1 16:00:01 2016 -0700 -- .../LuceneIndexCreationIntegrationTest.java | 28 +--- 1 file changed, 18 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/59e4c447/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneIndexCreationIntegrationTest.java -- diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneIndexCreationIntegrationTest.java b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneIndexCreationIntegrationTest.java index dd9fd57..fc1f84f 100644 --- a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneIndexCreationIntegrationTest.java +++ b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneIndexCreationIntegrationTest.java @@ -166,20 +166,28 @@ public class LuceneIndexCreationIntegrationTest extends LuceneIntegrationTest { @Test public void cannotCreateLuceneIndexForReplicateRegion() throws IOException, ParseException { -expectedException.expect(UnsupportedOperationException.class); -expectedException.expectMessage("Lucene indexes on replicated regions are not supported"); -createIndex("field1", "field2", "field3"); - this.cache.createRegionFactory(RegionShortcut.REPLICATE).create(REGION_NAME); +try { + createIndex("field1", "field2", "field3"); + this.cache.createRegionFactory(RegionShortcut.REPLICATE).create(REGION_NAME); + fail("Should not have been able to create index"); +} catch (UnsupportedOperationException e) { + assertEquals("Lucene indexes on replicated regions are not supported", e.getMessage()); + assertNull(cache.getRegion(REGION_NAME)); +} } @Test public void cannotCreateLuceneIndexForRegionWithEviction() throws IOException, ParseException { -expectedException.expect(UnsupportedOperationException.class); -expectedException.expectMessage("Lucene indexes on regions with eviction and action local destroy are not supported"); -createIndex("field1", "field2", "field3"); -RegionFactory regionFactory = this.cache.createRegionFactory(RegionShortcut.PARTITION); - regionFactory.setEvictionAttributes(EvictionAttributes.createLIFOEntryAttributes(100, EvictionAction.LOCAL_DESTROY)); -regionFactory.create(REGION_NAME); +try { + createIndex("field1", "field2", "field3"); + RegionFactory regionFactory = this.cache.createRegionFactory(RegionShortcut.PARTITION); + regionFactory.setEvictionAttributes( +EvictionAttributes.createLIFOEntryAttributes(100, EvictionAction.LOCAL_DESTROY)); + regionFactory.create(REGION_NAME); +} catch (UnsupportedOperationException e) { + assertEquals("Lucene indexes on regions with eviction and action local destroy are not supported", e.getMessage()); + assertNull(cache.getRegion(REGION_NAME)); +} } @Test
incubator-geode git commit: GEODE-11: Fixing creation of replicated region after index creation.
Repository: incubator-geode Updated Branches: refs/heads/develop b9387fb57 -> 2cab2ee70 GEODE-11: Fixing creation of replicated region after index creation. If a replicated region is created after a lucene index is defined, an error is thrown but the region is created (since this check is done in the afterCreate method). This was fixed by moving the check to the beforeCreate method of the region listener. Signed-off-by: Gester ZhouProject: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/2cab2ee7 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/2cab2ee7 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/2cab2ee7 Branch: refs/heads/develop Commit: 2cab2ee70c5fd05c76b8806a4e6033e3277d6664 Parents: b9387fb Author: Aparna Dharmakkan Authored: Mon Aug 1 14:54:39 2016 -0700 Committer: zhouxh Committed: Mon Aug 1 15:18:41 2016 -0700 -- .../lucene/internal/LuceneServiceImpl.java | 36 +--- 1 file changed, 16 insertions(+), 20 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2cab2ee7/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneServiceImpl.java -- diff --git a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneServiceImpl.java b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneServiceImpl.java index 5cce2f8..b0da08d 100644 --- a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneServiceImpl.java +++ b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneServiceImpl.java @@ -153,7 +153,22 @@ public class LuceneServiceImpl implements InternalLuceneService { RegionAttributes attrs, InternalRegionArguments internalRegionArgs) { RegionAttributes updatedRA = attrs; String path = parent == null ? "/" + regionName : parent.getFullPath() + "/" + regionName; + if(path.equals(dataRegionPath)) { + + if (!attrs.getDataPolicy().withPartitioning()) { +// replicated region +throw new UnsupportedOperationException("Lucene indexes on replicated regions are not supported"); + } + + //For now we cannot support eviction with local destroy. + //Eviction with overflow to disk still needs to be supported + EvictionAttributes evictionAttributes = attrs.getEvictionAttributes(); + EvictionAlgorithm evictionAlgorithm = evictionAttributes.getAlgorithm(); + if (evictionAlgorithm != EvictionAlgorithm.NONE && evictionAttributes.getAction().isLocalDestroy()) { +throw new UnsupportedOperationException("Lucene indexes on regions with eviction and action local destroy are not supported"); + } + String aeqId = LuceneServiceImpl.getUniqueIndexName(indexName, dataRegionPath); if (!attrs.getAsyncEventQueueIds().contains(aeqId)) { AttributesFactory af = new AttributesFactory(attrs); @@ -175,7 +190,6 @@ public class LuceneServiceImpl implements InternalLuceneService { } } }); - } @@ -202,26 +216,8 @@ public class LuceneServiceImpl implements InternalLuceneService { return null; } //Convert the region name into a canonical form - regionPath = dataregion.getFullPath(); -LuceneIndexImpl index = null; - -//For now we cannot support eviction with local destroy. -//Eviction with overflow to disk still needs to be supported -EvictionAttributes evictionAttributes = dataregion.getAttributes().getEvictionAttributes(); -EvictionAlgorithm evictionAlgorithm = evictionAttributes.getAlgorithm(); -if (evictionAlgorithm != EvictionAlgorithm.NONE && evictionAttributes.getAction().isLocalDestroy()) { - throw new UnsupportedOperationException("Lucene indexes on regions with eviction and action local destroy are not supported"); -} - -if (dataregion instanceof PartitionedRegion) { - // partitioned region - index = new LuceneIndexForPartitionedRegion(indexName, regionPath, cache); -} else { - // replicated region - throw new UnsupportedOperationException("Lucene indexes on replicated regions are not supported"); -} -return index; +return new LuceneIndexForPartitionedRegion(indexName, regionPath, cache); } private void registerDefinedIndex(final String regionAndIndex, final LuceneIndexCreationProfile luceneIndexCreationProfile) {
incubator-geode git commit: GEODE-1671: It's a test issue. The accessor is a datastore. So it should be pauseSender too.
Repository: incubator-geode Updated Branches: refs/heads/develop 90e00bf97 -> 983010e4a GEODE-1671: It's a test issue. The accessor is a datastore. So it should be pauseSender too. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/983010e4 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/983010e4 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/983010e4 Branch: refs/heads/develop Commit: 983010e4a1768c33ff24ac595421240903cdf489 Parents: 90e00bf Author: zhouxhAuthored: Mon Aug 1 09:05:05 2016 -0700 Committer: zhouxh Committed: Mon Aug 1 09:07:06 2016 -0700 -- .../cache/lucene/LuceneQueriesPeerPRRedundancyDUnitTest.java | 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/983010e4/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesPeerPRRedundancyDUnitTest.java -- diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesPeerPRRedundancyDUnitTest.java b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesPeerPRRedundancyDUnitTest.java index dc86a7c..d509cb2 100644 --- a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesPeerPRRedundancyDUnitTest.java +++ b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesPeerPRRedundancyDUnitTest.java @@ -100,11 +100,13 @@ public class LuceneQueriesPeerPRRedundancyDUnitTest extends LuceneQueriesPRBase accessor.invoke(() -> initAccessor(createIndex)); dataStore1.invoke(() -> LuceneTestUtilities.pauseSender(getCache())); dataStore2.invoke(() -> LuceneTestUtilities.pauseSender(getCache())); +accessor.invoke(() -> LuceneTestUtilities.pauseSender(getCache())); putEntryInEachBucket(); dataStore1.invoke(() -> LuceneTestUtilities.resumeSender(getCache())); dataStore2.invoke(() -> LuceneTestUtilities.resumeSender(getCache())); +accessor.invoke(() -> LuceneTestUtilities.resumeSender(getCache())); assertTrue(waitForFlushBeforeExecuteTextSearch(dataStore2, 6));
incubator-geode git commit: This closes #220
Repository: incubator-geode Updated Branches: refs/heads/develop 02c6818b4 -> c7530d06b This closes #220 GEODE-11: Added exception handling to lucene gfsh commands Added exception handling to lucene search and describe gfsh commands to handle region not found, index not found and invalid query string exceptions. GEODE-11: gfsh lucene search command returns only keys Added an option to the lucene search command to return only keys of the search results. Added dunit and junit tests to verify Signed-off-by: Gester ZhouGEODE-11: gfsh lucene search command returns only keys Added an option to the lucene search command to return only keys of the search results. Added dunit and junit tests to verify Signed-off-by: Gester Zhou Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/c7530d06 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/c7530d06 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/c7530d06 Branch: refs/heads/develop Commit: c7530d06b6fbd40784b4e2f8d452fffdcfbb50dd Parents: 02c6818 Author: Aparna Dharmakkan Authored: Fri Jul 29 14:48:19 2016 -0700 Committer: zhouxh Committed: Fri Jul 29 17:03:22 2016 -0700 -- .../lucene/internal/cli/LuceneCliStrings.java | 3 + .../internal/cli/LuceneIndexCommands.java | 70 --- .../lucene/internal/cli/LuceneIndexDetails.java | 4 +- .../lucene/internal/cli/LuceneQueryInfo.java| 8 +- .../internal/cli/LuceneSearchResults.java | 26 +++ .../functions/LuceneSearchIndexFunction.java| 38 ++-- .../cli/LuceneIndexCommandsDUnitTest.java | 189 +-- .../cli/LuceneIndexCommandsJUnitTest.java | 40 +++- .../LuceneSearchIndexFunctionJUnitTest.java | 3 +- 9 files changed, 315 insertions(+), 66 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/c7530d06/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneCliStrings.java -- diff --git a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneCliStrings.java b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneCliStrings.java index 15d2ca7..f573bf5 100644 --- a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneCliStrings.java +++ b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneCliStrings.java @@ -73,4 +73,7 @@ public class LuceneCliStrings { public static final String LUCENE_SEARCH_INDEX__NO_RESULTS_MESSAGE="No results"; public static final String LUCENE_SEARCH_INDEX__PAGE_SIZE="pageSize"; public static final String LUCENE_SEARCH_INDEX__PAGE_SIZE__HELP="Number of results to be returned in a page"; + public static final String LUCENE_SEARCH_INDEX__KEYSONLY="keys-only"; + public static final String LUCENE_SEARCH_INDEX__KEYSONLY__HELP="Return only keys of search results."; + } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/c7530d06/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneIndexCommands.java -- diff --git a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneIndexCommands.java b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneIndexCommands.java index 0edd2ff..6984f58 100755 --- a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneIndexCommands.java +++ b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneIndexCommands.java @@ -16,7 +16,6 @@ */ package com.gemstone.gemfire.cache.lucene.internal.cli; -import java.io.IOException; import java.util.List; import java.util.Set; import java.util.stream.Collectors; @@ -92,7 +91,7 @@ public class LuceneIndexCommands extends AbstractCommandsSupport { } catch (Throwable t) { SystemFailure.checkFailure(); - getCache().getLogger().error(t); + getCache().getLogger().info(t); return ResultBuilder.createGemFireErrorResult(String.format(LuceneCliStrings.LUCENE_LIST_INDEX__ERROR_MESSAGE, toString(t, isDebugging(; } @@ -243,7 +242,7 @@ public class LuceneIndexCommands extends AbstractCommandsSupport { } catch (Throwable t) { SystemFailure.checkFailure(); - getCache().getLogger().error(t); + getCache().getLogger().info(t); return ResultBuilder.createGemFireErrorResult(String.format(LuceneCliStrings.LUCENE_DESCRIBE_INDEX__ERROR_MESSAGE, toString(t, isDebugging(; } @@ -252,8
incubator-geode git commit: This closes #219
Repository: incubator-geode Updated Branches: refs/heads/develop a4f93cdd6 -> 547fc4886 This closes #219 GEODE-11: Added Limit to lucene search gfsh commands Added an option to specify limit in gfsh search. Added a dunit test to verify. GEODE-11 : Pagination for gfsh lucene search command Added pagination for gfsh lucene search results. Added junit test to verify. GEODE-11 : Fixing display messages in pagination Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/547fc488 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/547fc488 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/547fc488 Branch: refs/heads/develop Commit: 547fc48860c178c1e024379d58128264275fbc98 Parents: a4f93cd Author: Aparna DharmakkanAuthored: Wed Jul 20 13:50:59 2016 -0700 Committer: zhouxh Committed: Thu Jul 28 19:09:44 2016 -0700 -- .../lucene/internal/cli/LuceneCliStrings.java | 4 + .../internal/cli/LuceneIndexCommands.java | 143 --- .../lucene/internal/cli/LuceneQueryInfo.java| 11 +- .../functions/LuceneSearchIndexFunction.java| 5 +- .../cli/LuceneIndexCommandsDUnitTest.java | 32 + .../cli/LuceneIndexCommandsJUnitTest.java | 98 - .../LuceneSearchIndexFunctionJUnitTest.java | 9 +- 7 files changed, 271 insertions(+), 31 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/547fc488/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneCliStrings.java -- diff --git a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneCliStrings.java b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneCliStrings.java index 2f61cf9..15d2ca7 100644 --- a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneCliStrings.java +++ b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneCliStrings.java @@ -65,8 +65,12 @@ public class LuceneCliStrings { public static final String LUCENE_SEARCH_INDEX__NAME__HELP = "Name of the lucene index to search."; public static final String LUCENE_SEARCH_INDEX__REGION_HELP = "Name/Path of the region where the lucene index exists."; public static final String LUCENE_SEARCH_INDEX__QUERY_STRING="queryStrings"; + public static final String LUCENE_SEARCH_INDEX__LIMIT="limit"; + public static final String LUCENE_SEARCH_INDEX__LIMIT__HELP="Number of search results needed"; public static final String LUCENE_SEARCH_INDEX__QUERY_STRING__HELP="Query string to search the lucene index"; public static final String LUCENE_SEARCH_INDEX__DEFAULT_FIELD="defaultField"; public static final String LUCENE_SEARCH_INDEX__DEFAULT_FIELD__HELP="Default field to search in"; public static final String LUCENE_SEARCH_INDEX__NO_RESULTS_MESSAGE="No results"; + public static final String LUCENE_SEARCH_INDEX__PAGE_SIZE="pageSize"; + public static final String LUCENE_SEARCH_INDEX__PAGE_SIZE__HELP="Number of results to be returned in a page"; } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/547fc488/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneIndexCommands.java -- diff --git a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneIndexCommands.java b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneIndexCommands.java index 7f681da..0edd2ff 100755 --- a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneIndexCommands.java +++ b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneIndexCommands.java @@ -16,6 +16,7 @@ */ package com.gemstone.gemfire.cache.lucene.internal.cli; +import java.io.IOException; import java.util.List; import java.util.Set; import java.util.stream.Collectors; @@ -31,6 +32,7 @@ import com.gemstone.gemfire.cache.execute.Execution; import com.gemstone.gemfire.cache.execute.FunctionAdapter; import com.gemstone.gemfire.cache.execute.FunctionInvocationTargetException; import com.gemstone.gemfire.cache.execute.ResultCollector; + import com.gemstone.gemfire.cache.lucene.internal.cli.functions.LuceneCreateIndexFunction; import com.gemstone.gemfire.cache.lucene.internal.cli.functions.LuceneDescribeIndexFunction; import com.gemstone.gemfire.cache.lucene.internal.cli.functions.LuceneListIndexFunction; @@ -45,9 +47,11 @@ import com.gemstone.gemfire.management.internal.cli.CliUtil; import
incubator-geode git commit: GEODE-11: defined index will be saved and can be found.
Repository: incubator-geode Updated Branches: refs/heads/develop a6e9569f5 -> de3f90e03 GEODE-11: defined index will be saved and can be found. This closes #217 GEODE-11: Adding a defined index field in LuceneServiceImpl Added a definedIndexMap field in LuceneServiceImpl to store the uninitialized lucene indexes Signed-off-by: Gester ZhouGEODE-11: Added status to gfsh commands Added a field status(initialized/defined wrt region creation) to list and describe lucene commands. Added a dunit test for create index command to verify that the created index is stored in definedIndexMap. Signed-off-by: Gester Zhou GEODE-11: Removed methods from LuceneService interface Removed methods accessing definedIndexMap from the LuceneServiceInterface. Made few other method and field name changes as per review comments. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/de3f90e0 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/de3f90e0 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/de3f90e0 Branch: refs/heads/develop Commit: de3f90e03472818079e6a0892c6ff3d221298c8e Parents: a6e9569 Author: Aparna Dharmakkan Authored: Mon Jul 25 12:21:21 2016 -0700 Committer: zhouxh Committed: Wed Jul 27 14:30:08 2016 -0700 -- .../gemfire/cache/lucene/LuceneService.java | 4 +- .../internal/LuceneIndexCreationProfile.java| 15 .../lucene/internal/LuceneServiceImpl.java | 25 +- .../internal/cli/LuceneIndexCommands.java | 26 +++--- .../lucene/internal/cli/LuceneIndexDetails.java | 40 +++-- .../functions/LuceneDescribeIndexFunction.java | 8 +- .../cli/functions/LuceneListIndexFunction.java | 9 +- .../LuceneIndexCreationIntegrationTest.java | 29 ++ .../cli/LuceneIndexCommandsDUnitTest.java | 94 +++- .../cli/LuceneIndexCommandsJUnitTest.java | 60 + .../LuceneDescribeIndexFunctionJUnitTest.java | 3 +- .../LuceneListIndexFunctionJUnitTest.java | 3 +- 12 files changed, 229 insertions(+), 87 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/de3f90e0/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneService.java -- diff --git a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneService.java b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneService.java index 8a94959..cf1f735 100644 --- a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneService.java +++ b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneService.java @@ -23,6 +23,7 @@ import org.apache.lucene.analysis.Analyzer; import com.gemstone.gemfire.annotations.Experimental; import com.gemstone.gemfire.cache.GemFireCache; +import com.gemstone.gemfire.cache.lucene.internal.LuceneIndexCreationProfile; /** * LuceneService instance is a singleton for each cache. @@ -124,4 +125,5 @@ public interface LuceneService { * @return LuceneQueryFactory object */ public LuceneQueryFactory createLuceneQueryFactory(); -} + + } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/de3f90e0/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexCreationProfile.java -- diff --git a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexCreationProfile.java b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexCreationProfile.java index ceb7aa9..12f4ae5 100644 --- a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexCreationProfile.java +++ b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexCreationProfile.java @@ -38,6 +38,8 @@ public class LuceneIndexCreationProfile implements CacheServiceProfile, DataSeri private Map fieldAnalyzers; + private String regionPath; + /* Used by DataSerializer */ public LuceneIndexCreationProfile() {} @@ -49,6 +51,15 @@ public class LuceneIndexCreationProfile implements CacheServiceProfile, DataSeri initializeFieldAnalyzers(fieldAnalyzers); } + public LuceneIndexCreationProfile(String indexName, String regionPath, String[] fieldNames, Analyzer analyzer, +Map fieldAnalyzers) { +this.indexName = indexName; +this.regionPath = regionPath; +this.fieldNames = fieldNames; +this.analyzerClass = analyzer.getClass(); +initializeFieldAnalyzers(fieldAnalyzers); + } + public String
incubator-geode git commit: GEODE-11: GFSH command fixes
Repository: incubator-geode Updated Branches: refs/heads/develop 3473229fc -> 701909fd4 GEODE-11: GFSH command fixes List lucene gfsh command is changed to "list lucene indexes --with-stats" (previously list lucene index --stats) Changed the create index command's result display to a tabular format This closes #211 Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/701909fd Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/701909fd Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/701909fd Branch: refs/heads/develop Commit: 701909fd46626774d7b4ce0266a3a1c0340814b3 Parents: 3473229 Author: Aparna DharmakkanAuthored: Mon Jul 18 13:49:16 2016 -0700 Committer: zhouxh Committed: Mon Jul 18 14:29:12 2016 -0700 -- .../lucene/internal/cli/LuceneCliStrings.java | 4 +- .../internal/cli/LuceneIndexCommands.java | 63 +++- .../cli/LuceneIndexCommandsJUnitTest.java | 24 +++- 3 files changed, 20 insertions(+), 71 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/701909fd/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneCliStrings.java -- diff --git a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneCliStrings.java b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneCliStrings.java index 282e691..393ab22 100644 --- a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneCliStrings.java +++ b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneCliStrings.java @@ -24,11 +24,11 @@ public class LuceneCliStrings { public static final String LUCENE__REGION_PATH = "region"; //List lucene index commands - public static final String LUCENE_LIST_INDEX = "list lucene index"; + public static final String LUCENE_LIST_INDEX = "list lucene indexes"; public static final String LUCENE_LIST_INDEX__HELP = "Display the list of lucene indexes created for all members."; public static final String LUCENE_LIST_INDEX__ERROR_MESSAGE = "An error occurred while collecting all lucene index information across the Geode cluster: %1$s"; public static final String LUCENE_LIST_INDEX__INDEXES_NOT_FOUND_MESSAGE = "No lucene indexes found"; - public static final String LUCENE_LIST_INDEX__STATS = "stats"; + public static final String LUCENE_LIST_INDEX__STATS = "with-stats"; public static final String LUCENE_LIST_INDEX__STATS__HELP = "Display lucene index stats"; //Create lucene index commands http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/701909fd/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneIndexCommands.java -- diff --git a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneIndexCommands.java b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneIndexCommands.java index 30028be..bb2b2c9 100755 --- a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneIndexCommands.java +++ b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneIndexCommands.java @@ -181,68 +181,23 @@ public class LuceneIndexCommands extends AbstractCommandsSupport { final ResultCollector rc = this.executeFunctionOnGroups(createIndexFunction, groups, indexInfo); final List funcResults = (List) rc.getResult(); - final Set successfulMembers = new TreeSet(); - final Map indexOpFailMap = new HashMap (); - + final TabularResultData tabularResult = ResultBuilder.createTabularResultData(); for (final CliFunctionResult cliFunctionResult : funcResults) { + tabularResult.accumulate("Member",cliFunctionResult.getMemberIdOrName()); if (cliFunctionResult.isSuccessful()) { -successfulMembers.add(cliFunctionResult.getMemberIdOrName()); - -if (xmlEntity == null) { - xmlEntity = cliFunctionResult.getXmlEntity(); -} +tabularResult.accumulate("Status","Successfully created lucene index"); +//if (xmlEntity == null) { +// xmlEntity = cliFunctionResult.getXmlEntity(); +//} } else { -final String exceptionMessage = cliFunctionResult.getMessage(); -Set failedMembers = indexOpFailMap.get(exceptionMessage); - -if (failedMembers == null) { - failedMembers = new TreeSet(); -} -
incubator-geode git commit: GEODE-11:Dunit test to verify stats in list lucene gfsh command
Repository: incubator-geode Updated Branches: refs/heads/develop 1744e7b5a -> f1a6d2e01 GEODE-11:Dunit test to verify stats in list lucene gfsh command Added a dunit test to verify whether the stats displayed in the list lucene gfsh command is right This closes #209 Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/f1a6d2e0 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/f1a6d2e0 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/f1a6d2e0 Branch: refs/heads/develop Commit: f1a6d2e01ce9b1117954354ec6304281abfb30ff Parents: 1744e7b Author: Aparna DharmakkanAuthored: Thu Jul 14 17:49:36 2016 -0700 Committer: zhouxh Committed: Fri Jul 15 11:53:18 2016 -0700 -- .../cli/LuceneIndexCommandsDUnitTest.java | 80 1 file changed, 80 insertions(+) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f1a6d2e0/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneIndexCommandsDUnitTest.java -- diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneIndexCommandsDUnitTest.java b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneIndexCommandsDUnitTest.java index 06cc410..8114f93 100755 --- a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneIndexCommandsDUnitTest.java +++ b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/cli/LuceneIndexCommandsDUnitTest.java @@ -17,17 +17,22 @@ package com.gemstone.gemfire.cache.lucene.internal.cli; import com.gemstone.gemfire.cache.*; +import com.gemstone.gemfire.cache.Region.Entry; import com.gemstone.gemfire.cache.lucene.LuceneIndex; +import com.gemstone.gemfire.cache.lucene.LuceneQuery; import com.gemstone.gemfire.cache.lucene.LuceneService; import com.gemstone.gemfire.cache.lucene.LuceneServiceProvider; +import com.gemstone.gemfire.cache.lucene.internal.LuceneIndexImpl; import com.gemstone.gemfire.distributed.ConfigurationProperties; import com.gemstone.gemfire.management.cli.Result.Status; import com.gemstone.gemfire.management.internal.cli.CommandManager; import com.gemstone.gemfire.management.internal.cli.commands.CliCommandTestBase; import com.gemstone.gemfire.management.internal.cli.result.CommandResult; +import com.gemstone.gemfire.management.internal.cli.result.TabularResultData; import com.gemstone.gemfire.management.internal.cli.util.CommandStringBuilder; import com.gemstone.gemfire.test.dunit.*; import com.gemstone.gemfire.test.junit.categories.DistributedTest; +import com.jayway.awaitility.Awaitility; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.core.KeywordAnalyzer; @@ -39,11 +44,16 @@ import org.junit.experimental.categories.Category; import static com.gemstone.gemfire.cache.lucene.test.LuceneTestUtilities.*; import static com.gemstone.gemfire.test.dunit.Assert.*; +import java.io.Serializable; import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Properties; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; @Category(DistributedTest.class) public class LuceneIndexCommandsDUnitTest extends CliCommandTestBase { @@ -216,6 +226,31 @@ public class LuceneIndexCommandsDUnitTest extends CliCommandTestBase { assertTrue(resultAsString.contains("No lucene indexes found")); } + @Test + public void listIndexWithStatsShouldReturnCorrectStats() throws Exception { +final VM vm1 = Host.getHost(0).getVM(1); + +createIndex(vm1); +Map entries=new HashMap<>(); +entries.put("A",new TestObject("field1:value1","field2:value2","field3:value3")); +entries.put("B",new TestObject("ABC","EFG","HIJ")); + +putEntries(vm1,entries); +queryAndVerify(vm1, "field1:value1", "field1", Collections.singletonList("A")); + +CommandStringBuilder csb = new CommandStringBuilder(LuceneCliStrings.LUCENE_LIST_INDEX); +csb.addOption(LuceneCliStrings.LUCENE_LIST_INDEX__STATS,"true"); +TabularResultData data = (TabularResultData) executeCommandAndGetResult(csb).getResultData(); + +assertEquals(Collections.singletonList(INDEX_NAME), data.retrieveAllValues("Index Name")); +assertEquals(Collections.singletonList("/region"), data.retrieveAllValues("Region Path")); +assertEquals(Collections.singletonList("113"), data.retrieveAllValues("Query Executions")); +assertEquals(Collections.singletonList("2"), data.retrieveAllValues("Commits")); +
incubator-geode git commit: GEODE-11: GFSH commands for Lucene
Repository: incubator-geode Updated Branches: refs/heads/develop 48f6e6ec5 -> 82adda1cf GEODE-11: GFSH commands for Lucene Signed-off-by: Aparna DharmakkanGEODE-11: Implementing GFSH command for listing lucene indexes. Added the LuceneIndexCommands class that implements the list lucene index functionality in GFSH and the LuceneListIndexFunction class that gets the information about lucene indexes from the cache. Also added a test to verify this functionality. The org.springframework.shell.core.CommandMarker file is required to register the lucene commands in GFSH. Signed-off-by: Gester Zhou GEODE-11: Adding JUnit test for LuceneIndexCommands Added a JUnit test for getIndexListing() Signed-off-by: Gester Zhou Adding a unit test for list lucene indexes gfsh command Signed-off-by: Gester Zhou GEODE-11 Adding lucene create index gfsh command Added lucene create index command and dunit tests. Signed-off-by: Aparna Dharmakkan GEODE-11: Create lucene index gfsh command Added a GFSH command to create a lucene index. Added DUnit and JUnit tests. Also added JUnit test for LucenListIndexFunction. Made changes according to review comments. Signed-off-by: Gester Zhou GEODE-1652: merge pull request 190, fix the conflicts This closes #190 Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/82adda1c Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/82adda1c Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/82adda1c Branch: refs/heads/develop Commit: 82adda1cf7eb55d39c29f99d06d73f9d9ad7b0dc Parents: 48f6e6e Author: Dan Smith Authored: Fri Jul 1 10:45:04 2016 -0700 Committer: zhouxh Committed: Mon Jul 11 12:09:31 2016 -0700 -- .../management/internal/cli/CliUtil.java| 32 +++ .../cli/functions/RegionCreateFunction.java | 53 +--- .../lucene/internal/cli/LuceneCliStrings.java | 48 .../internal/cli/LuceneIndexCommands.java | 249 +++ .../lucene/internal/cli/LuceneIndexDetails.java | 107 .../lucene/internal/cli/LuceneIndexInfo.java| 59 + .../functions/LuceneCreateIndexFunction.java| 106 .../cli/functions/LuceneListIndexFunction.java | 66 + ...org.springframework.shell.core.CommandMarker | 2 + .../cli/LuceneIndexCommandsDUnitTest.java | 197 +++ .../cli/LuceneIndexCommandsJUnitTest.java | 185 ++ .../LuceneCreateIndexFunctionJUnitTest.java | 126 ++ .../LuceneListIndexFunctionJUnitTest.java | 102 13 files changed, 1289 insertions(+), 43 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/82adda1c/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/CliUtil.java -- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/CliUtil.java b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/CliUtil.java index 30ae97b..94dee73 100755 --- a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/CliUtil.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/CliUtil.java @@ -359,6 +359,38 @@ public class CliUtil { return stackAsString; } + @SuppressWarnings("unchecked") + public static Class forName(String classToLoadName, String neededFor) { +Class loadedClass = null; +try { + // Set Constraints + ClassPathLoader classPathLoader = ClassPathLoader.getLatest(); + if (classToLoadName != null && !classToLoadName.isEmpty()) { +loadedClass = (Class) classPathLoader.forName(classToLoadName); + } +} catch (ClassNotFoundException | NoClassDefFoundError e) { + throw new RuntimeException(CliStrings.format(CliStrings.CREATE_REGION__MSG__COULDNOT_FIND_CLASS_0_SPECIFIED_FOR_1, new Object[] {classToLoadName, neededFor}), e); +} +catch (ClassCastException e) { + throw new RuntimeException(CliStrings.format(CliStrings.CREATE_REGION__MSG__CLASS_SPECIFIED_FOR_0_SPECIFIED_FOR_1_IS_NOT_OF_EXPECTED_TYPE, new Object[] {classToLoadName, neededFor}), e); +} + +return loadedClass; + } + + public static K newInstance(Class klass, String neededFor) { +K instance = null; +try { + instance = klass.newInstance(); +} catch (InstantiationException e) { + throw new RuntimeException(CliStrings.format(CliStrings.CREATE_REGION__MSG__COULDNOT_INSTANTIATE_CLASS_0_SPECIFIED_FOR_1, new Object[] {klass, neededFor}), e); +} catch (IllegalAccessException e) { + throw new
incubator-geode git commit: GEODE-1572: add a dunit test for client server query for lucene
Repository: incubator-geode Updated Branches: refs/heads/develop 9ccb4d5bb -> de6105f98 GEODE-1572: add a dunit test for client server query for lucene Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/de6105f9 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/de6105f9 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/de6105f9 Branch: refs/heads/develop Commit: de6105f98021095c110bbc91ba547f8a01904ae7 Parents: 9ccb4d5 Author: zhouxhAuthored: Tue Jun 21 10:15:21 2016 -0700 Committer: zhouxh Committed: Tue Jun 21 10:15:59 2016 -0700 -- .../gemfire/cache/lucene/LuceneQueriesBase.java | 10 +-- .../lucene/LuceneQueriesClientDUnitTest.java| 70 2 files changed, 75 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/de6105f9/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 26cd4aa..2fdf531 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 @@ -47,7 +47,7 @@ public abstract class LuceneQueriesBase extends LuceneDUnitTest { protected VM accessor; @Override - public final void postSetUp() throws Exception { + public void postSetUp() throws Exception { super.postSetUp(); accessor = Host.getHost(0).getVM(3); } @@ -65,7 +65,7 @@ public abstract class LuceneQueriesBase extends LuceneDUnitTest { accessor.invoke(() -> initAccessor(createIndex)); putDataInRegion(accessor); -assertTrue(waitForFlushBeforeExecuteTextSearch(accessor, 6)); +assertTrue(waitForFlushBeforeExecuteTextSearch(dataStore1, 6)); executeTextSearch(accessor); } @@ -79,7 +79,7 @@ public abstract class LuceneQueriesBase extends LuceneDUnitTest { dataStore2.invoke(() -> initDataStore(createIndex)); accessor.invoke(() -> initAccessor(createIndex)); putDataInRegion(accessor); -assertTrue(waitForFlushBeforeExecuteTextSearch(accessor, 6)); +assertTrue(waitForFlushBeforeExecuteTextSearch(dataStore1, 6)); executeTextSearch(accessor, "world", "text", 3); executeTextSearch(accessor, "world", "noEntriesMapped", 0); } @@ -98,10 +98,10 @@ public abstract class LuceneQueriesBase extends LuceneDUnitTest { dataStore1.invoke(() -> pauseSender(getCache())); dataStore2.invoke(() -> pauseSender(getCache())); putDataInRegion(accessor); -assertFalse(waitForFlushBeforeExecuteTextSearch(accessor, 500)); +assertFalse(waitForFlushBeforeExecuteTextSearch(dataStore1, 500)); dataStore1.invoke(() -> resumeSender(getCache())); dataStore2.invoke(() -> resumeSender(getCache())); -assertTrue(waitForFlushBeforeExecuteTextSearch(accessor, 6)); +assertTrue(waitForFlushBeforeExecuteTextSearch(dataStore1, 6)); executeTextSearch(accessor); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/de6105f9/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesClientDUnitTest.java -- diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesClientDUnitTest.java b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesClientDUnitTest.java new file mode 100755 index 000..1988baf --- /dev/null +++ b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesClientDUnitTest.java @@ -0,0 +1,70 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package com.gemstone.gemfire.cache.lucene; + +import static
incubator-geode git commit: GEODE-1545: fix compile problem caused by merge
Repository: incubator-geode Updated Branches: refs/heads/develop ed32ceefb -> 0d5de3e3f GEODE-1545: fix compile problem caused by merge Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/0d5de3e3 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/0d5de3e3 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/0d5de3e3 Branch: refs/heads/develop Commit: 0d5de3e3f5e69f4de683ea289ac58d36280f7d6d Parents: ed32cee Author: zhouxhAuthored: Tue Jun 14 15:25:46 2016 -0700 Committer: zhouxh Committed: Tue Jun 14 15:25:46 2016 -0700 -- .../gemfire/cache/lucene/LuceneQueriesIntegrationTest.java | 8 1 file changed, 4 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0d5de3e3/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesIntegrationTest.java -- diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesIntegrationTest.java b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesIntegrationTest.java index 95f5781..587e4db 100644 --- a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesIntegrationTest.java +++ b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesIntegrationTest.java @@ -102,7 +102,7 @@ public class LuceneQueriesIntegrationTest extends LuceneIntegrationTest { expectedResults.put("A", new TestObject(value1, value1)); expectedResults.put("B", new TestObject(value2, value2)); expectedResults.put("C", new TestObject(value3, value3)); -verifyQuery("field1:one@three", expectedResults); +verifyQuery("field1:one@three", DEFAULT_FIELD, expectedResults); // keyword analyzer, this query will only match the entry that exactly matches // this query string will be parsed as "one three" @@ -182,7 +182,7 @@ public class LuceneQueriesIntegrationTest extends LuceneIntegrationTest { HashMap expectedResults = new HashMap(); expectedResults.put("jsondoc1", pdx1); expectedResults.put("jsondoc10", pdx10); -verifyQuery("name:jsondoc1*", expectedResults); +verifyQuery("name:jsondoc1*", DEFAULT_FIELD, expectedResults); } @Test() @@ -247,9 +247,9 @@ public class LuceneQueriesIntegrationTest extends LuceneIntegrationTest { verifyQueryKeys(queryWithStandardAnalyzer, expectedKeys); } - private void verifyQuery(String query, HashMap expectedResults) throws ParseException { + private void verifyQuery(String query, String DEFAULT_FIELD, HashMap expectedResults) throws ParseException { final LuceneQuery queryWithStandardAnalyzer = luceneService.createLuceneQueryFactory().create( - INDEX_NAME, REGION_NAME, query); + INDEX_NAME, REGION_NAME, query, DEFAULT_FIELD); verifyQueryKeyAndValues(queryWithStandardAnalyzer, expectedResults); }
incubator-geode git commit: GEODE-1545: add a test case for querying JSON in geode-lucene
Repository: incubator-geode Updated Branches: refs/heads/develop d5dae19b2 -> ed32ceefb GEODE-1545: add a test case for querying JSON in geode-lucene Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/ed32ceef Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/ed32ceef Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/ed32ceef Branch: refs/heads/develop Commit: ed32ceefba89b5cd295659faa3368971ee4adabb Parents: d5dae19 Author: zhouxhAuthored: Tue Jun 14 15:10:53 2016 -0700 Committer: zhouxh Committed: Tue Jun 14 15:14:39 2016 -0700 -- .../lucene/LuceneQueriesIntegrationTest.java| 68 .../cache/lucene/test/LuceneTestUtilities.java | 27 .../gemfire/cache/lucene/test/TestObject.java | 7 ++ 3 files changed, 102 insertions(+) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ed32ceef/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesIntegrationTest.java -- diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesIntegrationTest.java b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesIntegrationTest.java index 536f5c3..95f5781 100644 --- a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesIntegrationTest.java +++ b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesIntegrationTest.java @@ -42,6 +42,8 @@ import com.gemstone.gemfire.cache.RegionShortcut; import com.gemstone.gemfire.cache.execute.FunctionException; import com.gemstone.gemfire.cache.lucene.test.TestObject; import com.gemstone.gemfire.cache.query.QueryException; +import com.gemstone.gemfire.pdx.JSONFormatter; +import com.gemstone.gemfire.pdx.PdxInstance; import com.gemstone.gemfire.test.junit.categories.IntegrationTest; /** @@ -96,6 +98,12 @@ public class LuceneQueriesIntegrationTest extends LuceneIntegrationTest { // query will be--field1:one field1:three verifyQuery("field1:one@three", DEFAULT_FIELD, "A", "B", "C"); +HashMap expectedResults = new HashMap(); +expectedResults.put("A", new TestObject(value1, value1)); +expectedResults.put("B", new TestObject(value2, value2)); +expectedResults.put("C", new TestObject(value3, value3)); +verifyQuery("field1:one@three", expectedResults); + // keyword analyzer, this query will only match the entry that exactly matches // this query string will be parsed as "one three" // but keyword analyzer will parse one@three to be "one three" @@ -155,6 +163,29 @@ public class LuceneQueriesIntegrationTest extends LuceneIntegrationTest { } @Test() + public void queryJsonObject() throws ParseException { +Map fields = new HashMap (); +fields.put("name", null); +fields.put("lastName", null); +fields.put("address", null); +luceneService.createIndex(INDEX_NAME, REGION_NAME, fields); +Region region = cache.createRegionFactory(RegionShortcut.PARTITION) + .create(REGION_NAME); +final LuceneIndex index = luceneService.getIndex(INDEX_NAME, REGION_NAME); + +//Put two values with some of the same tokens +PdxInstance pdx1 = insertAJson(region, "jsondoc1"); +PdxInstance pdx2 = insertAJson(region, "jsondoc2"); +PdxInstance pdx10 = insertAJson(region, "jsondoc10"); +index.waitUntilFlushed(6); + +HashMap expectedResults = new HashMap(); +expectedResults.put("jsondoc1", pdx1); +expectedResults.put("jsondoc10", pdx10); +verifyQuery("name:jsondoc1*", expectedResults); + } + + @Test() public void throwFunctionExceptionWhenGivenBadQuery() { LuceneService luceneService = LuceneServiceProvider.get(cache); luceneService.createIndex(INDEX_NAME, REGION_NAME, "text"); @@ -178,6 +209,36 @@ public class LuceneQueriesIntegrationTest extends LuceneIntegrationTest { } } + + private PdxInstance insertAJson(Region region, String key) { +String jsonCustomer = "{" ++ "\"name\": \""+key+"\"," ++ "\"lastName\": \"Smith\"," ++ " \"age\": 25," ++ "\"address\":" ++ "{" ++ "\"streetAddress\": \"21 2nd Street\"," ++ "\"city\": \"New York\"," ++ "\"state\": \"NY\"," ++ "\"postalCode\": \"10021\"" ++ "}," ++ "\"phoneNumber\":" ++ "[" ++ "{" ++ " \"type\": \"home\"," ++ "\"number\": \"212 555-1234\"" ++ "}," ++ "{" ++ " \"type\": \"fax\"," ++ "\"number\": \"646 555-4567\"" ++ "}" ++ "]" ++ "}"; + +PdxInstance pdx =
incubator-geode git commit: GEODE-1453: when parsing field value, should consider it is null
Repository: incubator-geode Updated Branches: refs/heads/develop bd892f531 -> 31096fbf9 GEODE-1453: when parsing field value, should consider it is null Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/31096fbf Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/31096fbf Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/31096fbf Branch: refs/heads/develop Commit: 31096fbf927e75ba30c25deea985c2b40af75f75 Parents: bd892f5 Author: zhouxhAuthored: Tue May 24 17:25:37 2016 -0700 Committer: zhouxh Committed: Tue May 24 17:26:34 2016 -0700 -- .../serializer/PdxLuceneSerializer.java | 3 +++ .../serializer/ReflectionLuceneSerializer.java | 3 +++ .../lucene/LuceneQueriesIntegrationTest.java| 20 +++- .../serializer/PdxFieldMapperJUnitTest.java | 20 .../ReflectionFieldMapperJUnitTest.java | 16 5 files changed, 61 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/31096fbf/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/repository/serializer/PdxLuceneSerializer.java -- diff --git a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/repository/serializer/PdxLuceneSerializer.java b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/repository/serializer/PdxLuceneSerializer.java index 3990614..13465d7 100644 --- a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/repository/serializer/PdxLuceneSerializer.java +++ b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/repository/serializer/PdxLuceneSerializer.java @@ -44,6 +44,9 @@ class PdxLuceneSerializer implements LuceneSerializer { for(String field : indexedFields) { if(pdx.hasField(field)) { Object fieldValue = pdx.getField(field); +if (fieldValue == null) { + continue; +} SerializerUtil.addField(doc, field, fieldValue); } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/31096fbf/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/repository/serializer/ReflectionLuceneSerializer.java -- diff --git a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/repository/serializer/ReflectionLuceneSerializer.java b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/repository/serializer/ReflectionLuceneSerializer.java index a76478c..e06f99e 100644 --- a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/repository/serializer/ReflectionLuceneSerializer.java +++ b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/repository/serializer/ReflectionLuceneSerializer.java @@ -70,6 +70,9 @@ class ReflectionLuceneSerializer implements LuceneSerializer { for(Field field: fields) { try { Object fieldValue = field.get(value); +if (fieldValue == null) { + continue; +} SerializerUtil.addField(doc, field.getName(), fieldValue); } catch (IllegalArgumentException | IllegalAccessException e) { //TODO - what to do if we can't read a field? http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/31096fbf/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesIntegrationTest.java -- diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesIntegrationTest.java b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesIntegrationTest.java index 4ebb9c4..13df7a9 100644 --- a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesIntegrationTest.java +++ b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesIntegrationTest.java @@ -134,7 +134,25 @@ public class LuceneQueriesIntegrationTest extends LuceneIntegrationTest { verifyQuery("field1:one AND field2:two", "A"); verifyQuery("field1:three AND field2:four", "A"); } - + + @Test() + public void shouldAllowNullInFieldValue() throws ParseException { +Map fields = new HashMap (); +fields.put("field1", null); +fields.put("field2", null); +luceneService.createIndex(INDEX_NAME, REGION_NAME, fields); +Region region = cache.createRegionFactory(RegionShortcut.PARTITION) + .create(REGION_NAME); +final LuceneIndex index = luceneService.getIndex(INDEX_NAME, REGION_NAME); + +//Put two values
incubator-geode git commit: GEODE-11: let query to use index's analyzer; add tests for customized analyzer and analyzer per field
Repository: incubator-geode Updated Branches: refs/heads/develop 46eeb39ce -> 777c42ee0 GEODE-11: let query to use index's analyzer; add tests for customized analyzer and analyzer per field Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/777c42ee Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/777c42ee Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/777c42ee Branch: refs/heads/develop Commit: 777c42ee08866caf63c39a20072c7930bbbd2fc5 Parents: 46eeb39 Author: zhouxhAuthored: Tue May 24 15:52:09 2016 -0700 Committer: zhouxh Committed: Tue May 24 15:55:22 2016 -0700 -- .../lucene/internal/StringQueryProvider.java| 7 +- .../repository/IndexRepositoryImpl.java | 8 ++ .../HeterogeneousLuceneSerializer.java | 7 ++ .../serializer/PdxLuceneSerializer.java | 7 ++ .../serializer/ReflectionLuceneSerializer.java | 8 ++ .../cache/lucene/LuceneIntegrationTest.java | 1 + .../lucene/LuceneQueriesIntegrationTest.java| 103 --- .../internal/StringQueryProviderJUnitTest.java | 8 +- .../distributed/LuceneFunctionJUnitTest.java| 11 +- .../cache/lucene/test/LuceneTestUtilities.java | 2 +- 10 files changed, 139 insertions(+), 23 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/777c42ee/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/StringQueryProvider.java -- diff --git a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/StringQueryProvider.java b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/StringQueryProvider.java index 1e2b63d..62cb65c 100644 --- a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/StringQueryProvider.java +++ b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/StringQueryProvider.java @@ -65,10 +65,13 @@ public class StringQueryProvider implements LuceneQueryProvider, DataSerializabl if (luceneQuery == null) { String[] fields = index.getFieldNames(); - //TODO get the analyzer from the index - MultiFieldQueryParser parser = new MultiFieldQueryParser(fields, new StandardAnalyzer()); + LuceneIndexImpl indexImpl = (LuceneIndexImpl)index; + MultiFieldQueryParser parser = new MultiFieldQueryParser(fields, indexImpl.getAnalyzer()); try { luceneQuery = parser.parse(query); +if (logger.isDebugEnabled()) { + logger.debug("User query "+query+" is parsed to be: "+luceneQuery); +} } catch (ParseException e) { logger.debug("Malformed lucene query: " + query, e); throw new QueryException(e); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/777c42ee/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/repository/IndexRepositoryImpl.java -- diff --git a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/repository/IndexRepositoryImpl.java b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/repository/IndexRepositoryImpl.java index e589ef4..065cc6a 100644 --- a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/repository/IndexRepositoryImpl.java +++ b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/repository/IndexRepositoryImpl.java @@ -20,7 +20,9 @@ package com.gemstone.gemfire.cache.lucene.internal.repository; import java.io.IOException; +import java.util.Iterator; +import org.apache.logging.log4j.Logger; import org.apache.lucene.document.Document; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.Term; @@ -33,6 +35,7 @@ import org.apache.lucene.search.TopDocs; import com.gemstone.gemfire.cache.Region; import com.gemstone.gemfire.cache.lucene.internal.repository.serializer.LuceneSerializer; import com.gemstone.gemfire.cache.lucene.internal.repository.serializer.SerializerUtil; +import com.gemstone.gemfire.internal.logging.LogService; /** * A repository that writes to a single lucene index writer @@ -48,6 +51,8 @@ public class IndexRepositoryImpl implements IndexRepository { private final SearcherManager searcherManager; private Region region; + private static final Logger logger = LogService.getLogger(); + public IndexRepositoryImpl(Region region, IndexWriter writer, LuceneSerializer serializer) throws IOException { this.region = region; this.writer = writer; @@ -85,6 +90,9 @@ public class IndexRepositoryImpl implements IndexRepository { for(ScoreDoc scoreDoc :
incubator-geode git commit: GEODE-1344: fix the testcase to remove the durable client part
Repository: incubator-geode Updated Branches: refs/heads/develop 8024f33d5 -> 8266f6b9b GEODE-1344: fix the testcase to remove the durable client part The test case for durable client with 2 cache servers on the same JVM is not mature. Since we did not change any logic in durable client, remove the test code for now. This senario will be followed up in GEODE-1102. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/8266f6b9 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/8266f6b9 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/8266f6b9 Branch: refs/heads/develop Commit: 8266f6b9b944adddeea449743f8da611f76d9852 Parents: 8024f33 Author: zhouxhAuthored: Tue May 17 14:13:55 2016 -0700 Committer: zhouxh Committed: Tue May 17 14:16:04 2016 -0700 -- .../cache/wan/Simple2CacheServerDUnitTest.java | 47 1 file changed, 39 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8266f6b9/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/Simple2CacheServerDUnitTest.java -- diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/Simple2CacheServerDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/Simple2CacheServerDUnitTest.java index 4fdd88d..2b7617d 100755 --- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/Simple2CacheServerDUnitTest.java +++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/Simple2CacheServerDUnitTest.java @@ -17,22 +17,31 @@ package com.gemstone.gemfire.internal.cache.wan; import java.util.Iterator; +import java.util.List; import java.util.concurrent.TimeUnit; import org.junit.experimental.categories.Category; +import com.gemstone.gemfire.cache.EvictionAction; +import com.gemstone.gemfire.cache.EvictionAttributes; +import com.gemstone.gemfire.cache.Region; +import com.gemstone.gemfire.cache.RegionAttributes; import com.gemstone.gemfire.cache.client.internal.PoolImpl; +import com.gemstone.gemfire.cache.server.CacheServer; import com.gemstone.gemfire.distributed.internal.ServerLocation; +import com.gemstone.gemfire.internal.cache.CacheServerImpl; import com.gemstone.gemfire.internal.cache.ClientServerObserverAdapter; import com.gemstone.gemfire.internal.cache.ClientServerObserverHolder; import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientNotifier; import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientProxy; import com.gemstone.gemfire.internal.logging.LogService; import com.gemstone.gemfire.test.dunit.SerializableCallable; +import com.gemstone.gemfire.test.dunit.SerializableRunnable; import com.gemstone.gemfire.test.dunit.VM; import com.gemstone.gemfire.test.dunit.Wait; import com.gemstone.gemfire.test.dunit.WaitCriterion; import com.gemstone.gemfire.internal.cache.GemFireCacheImpl; +import com.gemstone.gemfire.internal.cache.ha.HAContainerRegion; import com.gemstone.gemfire.test.junit.categories.FlakyTest; import com.jayway.awaitility.Awaitility; @@ -45,11 +54,6 @@ public class Simple2CacheServerDUnitTest extends WANTestBase { super(name); } - // GEODE-1183: random ports, failure to start threads, eats exceptions, time sensitive - public void testDurableClient2MultipleCacheServer() throws Exception { -doMultipleCacheServer(true); - } - public void testNormalClient2MultipleCacheServer() throws Exception { doMultipleCacheServer(false); } @@ -80,11 +84,38 @@ public class Simple2CacheServerDUnitTest extends WANTestBase { Awaitility.waitAtMost(20, TimeUnit.SECONDS).until(() -> { return checkProxyIsPrimary(vm0) || checkProxyIsPrimary(vm1); }); // close the current primary cache server, then re-test -vm1.invoke(()-> CacheClientNotifierDUnitTest.closeACacheServer(serverPort2)); -Awaitility.waitAtMost(20, TimeUnit.SECONDS).until(() -> { return checkProxyIsPrimary(vm0) || checkProxyIsPrimary(vm1); }); +int serverPortAtVM1 = vm1.invoke(()-> findCacheServerForPrimaryProxy()); +if (serverPortAtVM1 != 0) { + vm1.invoke(()-> CacheClientNotifierDUnitTest.closeACacheServer(serverPortAtVM1)); + LogService.getLogger().info("Closed cache server on vm1:"+serverPortAtVM1); + Awaitility.waitAtMost(20, TimeUnit.SECONDS).until(() -> { return checkProxyIsPrimary(vm0) || checkProxyIsPrimary(vm1); }); +} else { + vm0.invoke(()-> CacheClientNotifierDUnitTest.closeACacheServer(serverPort3)); + LogService.getLogger().info("Closed cache server on vm0:"+serverPort3); + assertTrue(checkProxyIsPrimary(vm1)); +} disconnectAllFromDS();
incubator-geode git commit: GEODE-1351: let the waitForFlush() to return false if timeout
Repository: incubator-geode Updated Branches: refs/heads/develop 34d379196 -> 3e8a610e9 GEODE-1351: let the waitForFlush() to return false if timeout also apply it on some unit tests. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/3e8a610e Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/3e8a610e Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/3e8a610e Branch: refs/heads/develop Commit: 3e8a610e99bc005bcc56c378e3d1e2274a3d468c Parents: 34d3791 Author: zhouxhAuthored: Mon May 16 17:12:15 2016 -0700 Committer: zhouxh Committed: Mon May 16 17:12:15 2016 -0700 -- .../gemfire/cache/lucene/LuceneIndex.java | 4 +++- .../cache/lucene/internal/LuceneIndexImpl.java | 11 - .../internal/xml/LuceneIndexCreation.java | 3 ++- .../LuceneIndexCreationIntegrationTest.java | 25 ++-- .../LuceneIndexRecoveryHAIntegrationTest.java | 14 +-- 5 files changed, 29 insertions(+), 28 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3e8a610e/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneIndex.java -- diff --git a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneIndex.java b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneIndex.java index be329f7..6b1a4b4 100644 --- a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneIndex.java +++ b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneIndex.java @@ -58,7 +58,9 @@ public interface LuceneIndex { /* * wait until the current entries in cache are indexed + * @param maxWaitInMilliseconds max wait time in millisecond + * @return if entries are flushed within maxWait */ - public void waitUntilFlushed(int maxWait); + public boolean waitUntilFlushed(int maxWaitInMillisecond); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3e8a610e/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexImpl.java -- diff --git a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexImpl.java b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexImpl.java index 981d9e4..c165085 100644 --- a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexImpl.java +++ b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexImpl.java @@ -81,19 +81,17 @@ public abstract class LuceneIndexImpl implements InternalLuceneIndex { searchableFieldNames = fields; } - /* - * For test and demo purpose. To use it, the data region should stop feeding - * A more advanced version is under-development - */ @Override - public void waitUntilFlushed(int maxWait) { + public boolean waitUntilFlushed(int maxWaitInMillisecond) { String aeqId = LuceneServiceImpl.getUniqueIndexName(indexName, regionPath); AsyncEventQueue queue = (AsyncEventQueue)cache.getAsyncEventQueue(aeqId); +boolean flushed = false; if (queue != null) { long start = System.nanoTime(); - while (System.nanoTime() - start < TimeUnit.MILLISECONDS.toNanos(maxWait)) { + while (System.nanoTime() - start < TimeUnit.MILLISECONDS.toNanos(maxWaitInMillisecond)) { if (0 == queue.size()) { logger.debug("waitUntilFlushed: Queue size is 0"); + flushed = true; break; } else { try { @@ -105,6 +103,7 @@ public abstract class LuceneIndexImpl implements InternalLuceneIndex { } else { throw new IllegalArgumentException("The AEQ does not exist for the index "+indexName+" region "+regionPath); } +return flushed; } @Override http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3e8a610e/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/xml/LuceneIndexCreation.java -- diff --git a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/xml/LuceneIndexCreation.java b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/xml/LuceneIndexCreation.java index b54f51b..a3bdd24 100644 --- a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/xml/LuceneIndexCreation.java +++ b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/xml/LuceneIndexCreation.java @@ -116,6 +116,7 @@ public class LuceneIndexCreation implements LuceneIndex, Extension } @Override - public void
incubator-geode git commit: GEODE-1351: add waitUntilFlush() into luceneIndexImpl
Repository: incubator-geode Updated Branches: refs/heads/develop e1cbc9b25 -> 34d379196 GEODE-1351: add waitUntilFlush() into luceneIndexImpl This function is very useful in test and demo. It will wait for the AEQ size to be 0 Also added junit test and integration tests. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/34d37919 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/34d37919 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/34d37919 Branch: refs/heads/develop Commit: 34d379196c3bf2129a391ce63a9890daa3d75b7b Parents: e1cbc9b Author: zhouxhAuthored: Sun May 15 21:36:34 2016 -0700 Committer: zhouxh Committed: Mon May 16 11:42:05 2016 -0700 -- .../gemfire/cache/lucene/LuceneIndex.java | 5 ++ .../lucene/internal/LuceneEventListener.java| 11 +++ .../cache/lucene/internal/LuceneIndexImpl.java | 43 +-- .../internal/xml/LuceneIndexCreation.java | 4 + .../gemfire/cache/lucene/LuceneQueriesBase.java | 69 - .../internal/LuceneIndexImplJUnitTest.java | 78 6 files changed, 202 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/34d37919/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneIndex.java -- diff --git a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneIndex.java b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneIndex.java index 743045b..be329f7 100644 --- a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneIndex.java +++ b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneIndex.java @@ -56,4 +56,9 @@ public interface LuceneIndex { */ public Map getFieldAnalyzers(); + /* + * wait until the current entries in cache are indexed + */ + public void waitUntilFlushed(int maxWait); + } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/34d37919/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneEventListener.java -- diff --git a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneEventListener.java b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneEventListener.java index 9fdfd43..2dae4ee 100644 --- a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneEventListener.java +++ b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneEventListener.java @@ -35,6 +35,8 @@ import com.gemstone.gemfire.cache.lucene.internal.repository.RepositoryManager; import com.gemstone.gemfire.cache.lucene.internal.repository.IndexRepository; import com.gemstone.gemfire.cache.query.internal.DefaultQuery; import com.gemstone.gemfire.internal.cache.BucketNotFoundException; +import com.gemstone.gemfire.internal.cache.CacheObserverHolder; +import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientProxy.TestHook; import com.gemstone.gemfire.internal.logging.LogService; /** @@ -70,6 +72,10 @@ public class LuceneEventListener implements AsyncEventListener { IndexRepository repository = repositoryManager.getRepository(region, key, callbackArgument); Operation op = event.getOperation(); + +if (testHook != null) { + testHook.doTestHook("FOUND_AND_BEFORE_PROCESSING_A_EVENT"); +} if (op.isCreate()) { repository.create(key, event.getDeserializedValue()); @@ -96,4 +102,9 @@ public class LuceneEventListener implements AsyncEventListener { DefaultQuery.setPdxReadSerialized(false); } } + + public interface TestHook { +public void doTestHook(String spot); + } + public static TestHook testHook; } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/34d37919/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexImpl.java -- diff --git a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexImpl.java b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexImpl.java index 0b5f8fa..981d9e4 100644 --- a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexImpl.java +++ b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexImpl.java @@ -21,23 +21,26 @@ package com.gemstone.gemfire.cache.lucene.internal; import java.util.Collections; import java.util.Map; +import java.util.concurrent.TimeUnit;
incubator-geode git commit: GEODE-1360: Enabling to specify log4j2.xml for junit/dunit/intgrationtest
Repository: incubator-geode Updated Branches: refs/heads/develop eaa159394 -> 717ba5c8b GEODE-1360: Enabling to specify log4j2.xml for junit/dunit/intgrationtest Product code has built in log4j's trace log. However there's no command line parameter to turn on it. This fix let gradlew to transfer the system property to unit test framework, and let unit test framework to set it in run-time jvm. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/717ba5c8 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/717ba5c8 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/717ba5c8 Branch: refs/heads/develop Commit: 717ba5c8b45394c691b77d6a1bb83318bfa182da Parents: eaa1593 Author: zhouxhAuthored: Mon May 9 14:04:07 2016 -0700 Committer: zhouxh Committed: Mon May 9 14:07:18 2016 -0700 -- .../gemstone/gemfire/test/dunit/standalone/DUnitLauncher.java| 1 + .../gemstone/gemfire/test/dunit/standalone/ProcessManager.java | 1 + gradle/test.gradle | 4 3 files changed, 6 insertions(+) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/717ba5c8/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/standalone/DUnitLauncher.java -- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/standalone/DUnitLauncher.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/standalone/DUnitLauncher.java index be459b9..f45d2dd 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/standalone/DUnitLauncher.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/standalone/DUnitLauncher.java @@ -75,6 +75,7 @@ public class DUnitLauncher { /** change this to use a different log level in unit tests */ public static final String LOG_LEVEL = System.getProperty("logLevel", "info"); + public static final String LOG4J = System.getProperty("log4j.configurationFile"); static int locatorPort; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/717ba5c8/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/standalone/ProcessManager.java -- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/standalone/ProcessManager.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/standalone/ProcessManager.java index dd532c4..489f72b 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/standalone/ProcessManager.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/standalone/ProcessManager.java @@ -172,6 +172,7 @@ public class ProcessManager { "-Xrunjdwp:transport=dt_socket,server=y,suspend=" + jdkSuspend + jdkDebug, "-XX:+HeapDumpOnOutOfMemoryError", "-Xmx512m", + DUnitLauncher.LOG4J==null?"":"-Dlog4j.configurationFile="+DUnitLauncher.LOG4J, "-Dgemfire.DEFAULT_MAX_OPLOG_SIZE=10", "-Dgemfire.disallowMcastDefaults=true", "-ea", "-XX:+PrintGC", "-XX:+PrintGCDetails","-XX:+PrintGCTimeStamps", http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/717ba5c8/gradle/test.gradle -- diff --git a/gradle/test.gradle b/gradle/test.gradle index 2dd7521..96fbfc5 100644 --- a/gradle/test.gradle +++ b/gradle/test.gradle @@ -211,6 +211,10 @@ subprojects { if (logLevel != null) { systemProperty 'logLevel', logLevel } +def log4jLocation = System.getProperty('log4j.configurationFile') +if (log4jLocation != null) { + systemProperty 'log4j.configurationFile', log4jLocation +} def eol = System.getProperty('line.separator') def progress = new File(resultsDir, "$test.name-progress.txt")
incubator-geode git commit: GEODE-1183: enhance the test case
Repository: incubator-geode Updated Branches: refs/heads/develop aca7b288f -> 4ad4d63ca GEODE-1183: enhance the test case Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/4ad4d63c Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/4ad4d63c Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/4ad4d63c Branch: refs/heads/develop Commit: 4ad4d63ca7b40c1450df1253ece0912f8529220f Parents: aca7b28 Author: zhouxhAuthored: Thu May 5 21:18:54 2016 -0700 Committer: zhouxh Committed: Thu May 5 21:19:50 2016 -0700 -- .../cache/wan/Simple2CacheServerDUnitTest.java | 24 1 file changed, 5 insertions(+), 19 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4ad4d63c/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/Simple2CacheServerDUnitTest.java -- diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/Simple2CacheServerDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/Simple2CacheServerDUnitTest.java index 684660b..4fdd88d 100755 --- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/Simple2CacheServerDUnitTest.java +++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/Simple2CacheServerDUnitTest.java @@ -17,6 +17,7 @@ package com.gemstone.gemfire.internal.cache.wan; import java.util.Iterator; +import java.util.concurrent.TimeUnit; import org.junit.experimental.categories.Category; @@ -33,6 +34,7 @@ import com.gemstone.gemfire.test.dunit.Wait; import com.gemstone.gemfire.test.dunit.WaitCriterion; import com.gemstone.gemfire.internal.cache.GemFireCacheImpl; import com.gemstone.gemfire.test.junit.categories.FlakyTest; +import com.jayway.awaitility.Awaitility; public class Simple2CacheServerDUnitTest extends WANTestBase { private static final int NUM_KEYS = 10; @@ -75,17 +77,11 @@ public class Simple2CacheServerDUnitTest extends WANTestBase { } else { vm2.invoke(() -> checkResultAndUnsetClientServerObserver()); } - -boolean vm0_proxy = checkProxyIsPrimary(vm0); -boolean vm1_proxy = checkProxyIsPrimary(vm1); -assertTrue(vm1_proxy || vm0_proxy); +Awaitility.waitAtMost(20, TimeUnit.SECONDS).until(() -> { return checkProxyIsPrimary(vm0) || checkProxyIsPrimary(vm1); }); // close the current primary cache server, then re-test vm1.invoke(()-> CacheClientNotifierDUnitTest.closeACacheServer(serverPort2)); -vm0_proxy = checkProxyIsPrimary(vm0); -vm1_proxy = checkProxyIsPrimary(vm1); -assertTrue(vm1_proxy || vm0_proxy); - +Awaitility.waitAtMost(20, TimeUnit.SECONDS).until(() -> { return checkProxyIsPrimary(vm0) || checkProxyIsPrimary(vm1); }); disconnectAllFromDS(); } @@ -135,19 +131,9 @@ public class Simple2CacheServerDUnitTest extends WANTestBase { @Override public Object call() throws Exception { final CacheClientNotifier ccn = CacheClientNotifier.getInstance(); +Awaitility.waitAtMost(20, TimeUnit.SECONDS).until(() -> { return (ccn.getClientProxies().size() == 1); }); -Wait.waitForCriterion(new WaitCriterion() { - public boolean done() { -return ccn.getClientProxies().size() == 1; - } - public String description() { -return null; - } -}, 2, 100, false); -assertEquals(1, ccn.getClientProxies().size()); - Iterator iter_prox = ccn.getClientProxies().iterator(); -assertEquals(1, ccn.getClientProxies().size()); CacheClientProxy proxy = (CacheClientProxy)iter_prox.next(); return proxy.isPrimary(); }
incubator-geode git commit: GEODE-1212: clean up replicate region support for lucene
Repository: incubator-geode Updated Branches: refs/heads/develop 3ac910449 -> 86ab7cda3 GEODE-1212: clean up replicate region support for lucene Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/86ab7cda Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/86ab7cda Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/86ab7cda Branch: refs/heads/develop Commit: 86ab7cda3378e062769b32c2b36504567fc8c752 Parents: 3ac9104 Author: zhouxhAuthored: Tue Apr 12 09:56:39 2016 -0700 Committer: zhouxh Committed: Tue Apr 12 09:57:31 2016 -0700 -- .../LuceneIndexForPartitionedRegion.java | 19 +-- .../cache/lucene/internal/LuceneServiceImpl.java | 2 +- .../internal/LuceneQueryImplJUnitTest.java | 2 +- .../internal/LuceneServiceImplJUnitTest.java | 10 ++ 4 files changed, 13 insertions(+), 20 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/86ab7cda/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexForPartitionedRegion.java -- diff --git a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexForPartitionedRegion.java b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexForPartitionedRegion.java index 7002567..25b63a4 100644 --- a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexForPartitionedRegion.java +++ b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexForPartitionedRegion.java @@ -52,23 +52,14 @@ public class LuceneIndexForPartitionedRegion extends LuceneIndexImpl { assert dataRegion != null; RegionAttributes ra = dataRegion.getAttributes(); DataPolicy dp = ra.getDataPolicy(); - final boolean isPartitionedRegion = (ra.getPartitionAttributes() == null) ? false : true; final boolean withPersistence = dp.withPersistence(); - final boolean withStorage = isPartitionedRegion?ra.getPartitionAttributes().getLocalMaxMemory()>0:dp.withStorage(); + final boolean withStorage = ra.getPartitionAttributes().getLocalMaxMemory()>0; RegionShortcut regionShortCut; - if (isPartitionedRegion) { -if (withPersistence) { - // TODO: add PartitionedRegionAttributes instead - regionShortCut = RegionShortcut.PARTITION_PERSISTENT; -} else { - regionShortCut = RegionShortcut.PARTITION; -} + if (withPersistence) { +// TODO: add PartitionedRegionAttributes instead +regionShortCut = RegionShortcut.PARTITION_PERSISTENT; } else { -if (withPersistence) { - regionShortCut = RegionShortcut.REPLICATE_PERSISTENT; -} else { - regionShortCut = RegionShortcut.REPLICATE; -} +regionShortCut = RegionShortcut.PARTITION; } // final boolean isOffHeap = ra.getOffHeap(); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/86ab7cda/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneServiceImpl.java -- diff --git a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneServiceImpl.java b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneServiceImpl.java index 1a5dd1a..9d6aed4 100644 --- a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneServiceImpl.java +++ b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneServiceImpl.java @@ -182,7 +182,7 @@ public class LuceneServiceImpl implements InternalLuceneService { index = new LuceneIndexForPartitionedRegion(indexName, regionPath, cache); } else { // replicated region - index = new LuceneIndexForReplicatedRegion(indexName, regionPath, cache); + throw new UnsupportedOperationException("Lucene indexes on replicated regions are not supported"); } return index; } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/86ab7cda/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/LuceneQueryImplJUnitTest.java -- diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/LuceneQueryImplJUnitTest.java b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/LuceneQueryImplJUnitTest.java index 3975ac3..2439645 100644 --- a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/LuceneQueryImplJUnitTest.java +++
incubator-geode git commit: GEODE-920: lazily create HaContainer for cache server
Repository: incubator-geode Updated Branches: refs/heads/develop 066a9d57a -> 49e3f523d GEODE-920: lazily create HaContainer for cache server The CacheClientNotifier instance might have been created by gateway receicver. Then not to create the HaContainer until a cache server starts and amend the CacheClientNotifier instance by initialize the HaContainer. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/49e3f523 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/49e3f523 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/49e3f523 Branch: refs/heads/develop Commit: 49e3f523d16389f5e84847c6dcfd6ab45427f8c2 Parents: 066a9d5 Author: zhouxhAuthored: Fri Mar 25 10:04:35 2016 -0700 Committer: zhouxh Committed: Mon Apr 4 15:48:57 2016 -0700 -- .../internal/cache/InitialImageOperation.java | 15 +- .../gemfire/internal/cache/LocalRegion.java | 3 + .../internal/cache/ha/HAContainerRegion.java| 5 + .../cache/tier/sockets/CacheClientNotifier.java | 58 +++-- .../cache/wan/CacheClientNotifierDUnitTest.java | 225 +++ 5 files changed, 279 insertions(+), 27 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/49e3f523/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/InitialImageOperation.java -- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/InitialImageOperation.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/InitialImageOperation.java index 9bd3faf..a72ca8e 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/InitialImageOperation.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/InitialImageOperation.java @@ -2179,9 +2179,11 @@ public class InitialImageOperation { if (logger.isDebugEnabled()) { try { CacheClientNotifier ccn = CacheClientNotifier.getInstance(); -CacheClientProxy proxy = ((HAContainerWrapper)ccn.getHaContainer()).getProxy( -region.getName()); -logger.debug("Processing FilterInfo for proxy: {} : {}", proxy, msg); +if (ccn != null && ccn.getHaContainer() != null) { + CacheClientProxy proxy = ((HAContainerWrapper)ccn.getHaContainer()).getProxy( + region.getName()); + logger.debug("Processing FilterInfo for proxy: {} : {}", proxy, msg); +} } catch (Exception ex) { // Ignore. } @@ -3705,8 +3707,13 @@ public class InitialImageOperation { */ public void registerFilters(LocalRegion region) { CacheClientNotifier ccn = CacheClientNotifier.getInstance(); + CacheClientProxy proxy; try { +if (ccn == null || ccn.getHaContainer() == null) { + logger.info("Found null cache client notifier. Failed to register Filters during HARegion GII. Region :{}", region.getName()); + return; +} proxy = ((HAContainerWrapper)ccn.getHaContainer()).getProxy( region.getName()); } catch (Exception ex) { @@ -3716,7 +3723,7 @@ public class InitialImageOperation { } if (proxy == null) { -logger.info("Found null client proxy. Failed to register Filters during HARegion GII. Region :{}", region.getName()); +logger.info("Found null client proxy. Failed to register Filters during HARegion GII. Region :{}, HaContainer :{}", region.getName(), ccn.getHaContainer()); return; } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/49e3f523/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java -- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java index 8e30a7a..3ff48bb 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java @@ -4576,6 +4576,9 @@ public class LocalRegion extends AbstractRegion public void refreshEntriesFromServerKeys(Connection con, List serverKeys, InterestResultPolicy pol) { +if (serverKeys == null) { + return; +} ServerRegionProxy proxy = getServerProxy(); if (logger.isDebugEnabled()) { logKeys(serverKeys, pol); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/49e3f523/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/ha/HAContainerRegion.java
incubator-geode git commit: GEODE-589: revoke the previous change of DistributedTestCase
Repository: incubator-geode Updated Branches: refs/heads/develop f486b700c -> 374d2f435 GEODE-589: revoke the previous change of DistributedTestCase The fix of GEODE-1052 for DistributedTestCase.java part is not necessary. And it caused side-effect to ClientMembershipDUnitTest. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/374d2f43 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/374d2f43 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/374d2f43 Branch: refs/heads/develop Commit: 374d2f435ef5c291ebd3c3a4573110cb1298f290 Parents: f486b70 Author: zhouxhAuthored: Wed Mar 9 15:11:19 2016 -0800 Committer: zhouxh Committed: Thu Mar 10 14:11:38 2016 -0800 -- .../com/gemstone/gemfire/test/dunit/DistributedTestCase.java | 4 1 file changed, 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/374d2f43/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/DistributedTestCase.java -- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/DistributedTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/DistributedTestCase.java index 1203570..c7227a2 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/DistributedTestCase.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/DistributedTestCase.java @@ -241,11 +241,7 @@ public abstract class DistributedTestCase extends TestCase implements java.io.Se * @since 3.0 */ public Properties getDistributedSystemProperties() { -String logLevel = System.getProperty("logLevel"); Properties props = new Properties(); -if (logLevel != null) { - props.setProperty("log-level", logLevel); -} return props; }
incubator-geode git commit: GEODE-1042: add junit test for the fix in processChunk()
Repository: incubator-geode Updated Branches: refs/heads/develop 6c74e5ab1 -> 70ca9214f GEODE-1042: add junit test for the fix in processChunk() Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/70ca9214 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/70ca9214 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/70ca9214 Branch: refs/heads/develop Commit: 70ca9214ffede4ec56a0e80e192a52895faf7735 Parents: 6c74e5a Author: zhouxhAuthored: Tue Mar 8 15:31:26 2016 -0800 Committer: zhouxh Committed: Wed Mar 9 10:42:53 2016 -0800 -- .../gemfire/internal/cache/LocalRegion.java | 2 +- .../cache/partitioned/FetchEntriesMessage.java | 8 +- .../FetchEntriesMessageJUnitTest.java | 93 3 files changed, 98 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70ca9214/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java -- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java index 966130a..830d47d 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java @@ -556,7 +556,7 @@ public class LocalRegion extends AbstractRegion * CompactCompositeRegionKey that points to the raw row bytes and * so requires a handle to table schema for interpretation of those bytes. */ - public final boolean keyRequiresRegionContext() { + public boolean keyRequiresRegionContext() { return this.keyRequiresRegionContext; } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70ca9214/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/FetchEntriesMessage.java -- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/FetchEntriesMessage.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/FetchEntriesMessage.java index fda15c4..8360a1e 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/FetchEntriesMessage.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/FetchEntriesMessage.java @@ -195,7 +195,7 @@ public final class FetchEntriesMessage extends PartitionMessage public FetchEntriesReplyMessage() { } -private FetchEntriesReplyMessage(InternalDistributedMember dest, +protected FetchEntriesReplyMessage(InternalDistributedMember dest, int processorId, int buckId, HeapDataOutputStream chunk, int seriesNum, int msgNum, int numSeries, boolean lastInSeries, boolean hasRVV) { setRecipient(dest); @@ -455,9 +455,9 @@ public final class FetchEntriesMessage extends PartitionMessage private final PartitionedRegion pr; -private volatile RegionVersionVector returnRVV; -private final HashMap
incubator-geode git commit: GEODE-1052
Repository: incubator-geode Updated Branches: refs/heads/develop 79e2a4311 -> c9f1e04eb GEODE-1052 specify logLevel in command line of gradle for running dunit test Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/c9f1e04e Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/c9f1e04e Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/c9f1e04e Branch: refs/heads/develop Commit: c9f1e04eb4ee042368682da548da1f7872fe48bc Parents: 79e2a43 Author: zhouxhAuthored: Fri Mar 4 17:47:11 2016 -0800 Committer: zhouxh Committed: Tue Mar 8 11:37:11 2016 -0800 -- .../com/gemstone/gemfire/test/dunit/DistributedTestCase.java | 7 ++- gradle/test.gradle| 4 2 files changed, 10 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/c9f1e04e/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/DistributedTestCase.java -- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/DistributedTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/DistributedTestCase.java index 65224e8..1203570 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/DistributedTestCase.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/DistributedTestCase.java @@ -241,7 +241,12 @@ public abstract class DistributedTestCase extends TestCase implements java.io.Se * @since 3.0 */ public Properties getDistributedSystemProperties() { -return new Properties(); +String logLevel = System.getProperty("logLevel"); +Properties props = new Properties(); +if (logLevel != null) { + props.setProperty("log-level", logLevel); +} +return props; } public static void disconnectAllFromDS() { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/c9f1e04e/gradle/test.gradle -- diff --git a/gradle/test.gradle b/gradle/test.gradle index d8af4ba..6153212 100644 --- a/gradle/test.gradle +++ b/gradle/test.gradle @@ -204,6 +204,10 @@ subprojects { systemProperty 'gemfire.DEFAULT_MAX_OPLOG_SIZE', '10' systemProperty 'gemfire.disallowMcastDefaults', 'true' systemProperty 'jline.terminal', 'jline.UnsupportedTerminal' +def logLevel = System.getProperty('logLevel') +if (logLevel != null) { + systemProperty 'logLevel', logLevel +} def eol = System.getProperty('line.separator') def progress = new File(resultsDir, "$test.name-progress.txt")
incubator-geode git commit: GEODE-1042
Repository: incubator-geode Updated Branches: refs/heads/develop 0ca2f2ea1 -> e7e1fc666 GEODE-1042 shadowPR's entries will not have version tag. So enforce checking if versionTag is null. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/e7e1fc66 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/e7e1fc66 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/e7e1fc66 Branch: refs/heads/develop Commit: e7e1fc6660fc54ae449abed82fd0edbe06531050 Parents: 0ca2f2e Author: zhouxhAuthored: Wed Mar 2 17:02:49 2016 -0800 Committer: zhouxh Committed: Wed Mar 2 17:02:49 2016 -0800 -- .../gemfire/internal/cache/partitioned/FetchEntriesMessage.java| 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e7e1fc66/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/FetchEntriesMessage.java -- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/FetchEntriesMessage.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/FetchEntriesMessage.java index 0342164..fda15c4 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/FetchEntriesMessage.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/FetchEntriesMessage.java @@ -559,7 +559,7 @@ public final class FetchEntriesMessage extends PartitionMessage VersionTag versionTag = DataSerializer.readObject(in); //Fix for 47260 - canonicalize the mebmer ids to avoid an OOME - VersionSource id = versionTag.getMemberID(); + VersionSource id = versionTag==null?null:versionTag.getMemberID(); if (id != null) { if(canonicalMembers.containsKey(id)) { versionTag.setMemberID(canonicalMembers.get(id));
incubator-geode git commit: GEODE-774
Repository: incubator-geode Updated Branches: refs/heads/develop 64855a26f -> 1e31fa646 GEODE-774 Add and enhance junit tests for previous fix. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/1e31fa64 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/1e31fa64 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/1e31fa64 Branch: refs/heads/develop Commit: 1e31fa646f414aeea28c7fa28096b70dc2ccd120 Parents: 64855a2 Author: zhouxhAuthored: Fri Feb 26 16:21:04 2016 -0800 Committer: zhouxh Committed: Mon Feb 29 12:37:09 2016 -0800 -- .../gemfire/internal/cache/BucketRegion.java| 25 ++- .../internal/cache/DistributedRegion.java | 2 +- .../AbstractDistributedRegionJUnitTest.java | 166 + .../internal/cache/BucketRegionJUnitTest.java | 186 +-- .../cache/DistributedRegionJUnitTest.java | 101 ++ .../com/gemstone/gemfire/test/fake/Fakes.java | 5 +- 6 files changed, 339 insertions(+), 146 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1e31fa64/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/BucketRegion.java -- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/BucketRegion.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/BucketRegion.java index 69f61c4..5b17040 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/BucketRegion.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/BucketRegion.java @@ -922,13 +922,7 @@ implements Bucket logger.trace(LogMarker.DM, "LR.basicInvalidate: this cache has already seen this event {}", event); } if (!getConcurrencyChecksEnabled() || event.hasValidVersionTag()) { - if (!event.isOriginRemote() - && getBucketAdvisor().isPrimary()) { -// This cache has processed the event, forward operation -// and event messages to backup buckets -new InvalidateOperation(event).distribute(); - } - event.invokeCallbacks(this,true, false); + distributeInvalidateOperation(event); } return; } @@ -936,6 +930,17 @@ implements Bucket endLocalWrite(event); } } + + protected void distributeInvalidateOperation(EntryEventImpl event) { +if (!event.isOriginRemote() +&& getBucketAdvisor().isPrimary()) { + // This cache has processed the event, forward operation + // and event messages to backup buckets + new InvalidateOperation(event).distribute(); +} +event.invokeCallbacks(this,true, false); + } + @Override void basicInvalidatePart2(final RegionEntry re, final EntryEventImpl event, boolean clearConflict, boolean invokeCallbacks) @@ -1312,7 +1317,7 @@ implements Bucket // This cache has processed the event, forward operation // and event messages to backup buckets if (!getConcurrencyChecksEnabled() || event.hasValidVersionTag()) { - new UpdateEntryVersionOperation(event).distribute(); + distributeUpdateEntryVersionOperation(event); } } return; @@ -1321,6 +1326,10 @@ implements Bucket } } + protected void distributeUpdateEntryVersionOperation(EntryEventImpl event) { +new UpdateEntryVersionOperation(event).distribute(); + } + public int getRedundancyLevel() { return this.redundancy; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1e31fa64/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistributedRegion.java -- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistributedRegion.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistributedRegion.java index 021eba6..19496da 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistributedRegion.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistributedRegion.java @@ -2057,7 +2057,7 @@ public class DistributedRegion extends LocalRegion implements } } - private void distributeUpdateEntryVersion(EntryEventImpl event) { + protected void distributeUpdateEntryVersion(EntryEventImpl event) { if (!this.regionInvalid && event.isDistributed() && !event.isOriginRemote() && !isTX() /* only distribute if non-tx */) { if (event.isDistributed() && !event.isOriginRemote()) {
incubator-geode git commit: GEODE-774
Repository: incubator-geode Updated Branches: refs/heads/develop 478e50d3a -> 4285d63a9 GEODE-774 When wan event was retried, the version tag might not be created. Do not distribute such event. Also add a unit test for the fix. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/4285d63a Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/4285d63a Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/4285d63a Branch: refs/heads/develop Commit: 4285d63a96d1dff3014433117c4a9793ff3fdcf9 Parents: 478e50d Author: zhouxhAuthored: Thu Feb 18 14:03:10 2016 -0800 Committer: zhouxh Committed: Thu Feb 18 14:21:22 2016 -0800 -- .../membership/InternalDistributedMember.java | 2 +- .../gemfire/internal/cache/BucketAdvisor.java | 2 +- .../gemfire/internal/cache/BucketRegion.java| 26 ++- .../internal/cache/DistributedRegion.java | 22 +- .../gemfire/internal/cache/EntryEventImpl.java | 7 + .../internal/cache/BucketRegionJUnitTest.java | 208 +++ 6 files changed, 249 insertions(+), 18 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4285d63a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/InternalDistributedMember.java -- diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/InternalDistributedMember.java b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/InternalDistributedMember.java index 8b5c279..81058f8 100755 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/InternalDistributedMember.java +++ b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/InternalDistributedMember.java @@ -53,7 +53,7 @@ import com.gemstone.gemfire.internal.i18n.LocalizedStrings; * This is the fundamental representation of a member of a GemFire distributed * system. */ -public final class InternalDistributedMember +public class InternalDistributedMember implements DistributedMember, Externalizable, DataSerializableFixedID, ProfileId, VersionSource http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4285d63a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/BucketAdvisor.java -- diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/BucketAdvisor.java b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/BucketAdvisor.java index 98e72bd..a6649c3 100644 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/BucketAdvisor.java +++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/BucketAdvisor.java @@ -77,7 +77,7 @@ import com.gemstone.gemfire.internal.util.StopWatch; * @author Kirk Lund */ @SuppressWarnings("synthetic-access") -public final class BucketAdvisor extends CacheDistributionAdvisor { +public class BucketAdvisor extends CacheDistributionAdvisor { private static final Logger logger = LogService.getLogger(); public static final boolean ENFORCE_SAFE_CLOSE = false; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4285d63a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/BucketRegion.java -- diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/BucketRegion.java b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/BucketRegion.java index fae381f..69f61c4 100644 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/BucketRegion.java +++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/BucketRegion.java @@ -536,7 +536,9 @@ implements Bucket if (logger.isTraceEnabled(LogMarker.DM)) { logger.trace(LogMarker.DM, "BR.virtualPut: this cache has already seen this event {}", event); } - distributeUpdateOperation(event, lastModified); + if (!getConcurrencyChecksEnabled() || event.hasValidVersionTag()) { +distributeUpdateOperation(event, lastModified); + } return true; } finally { endLocalWrite(event); @@ -919,13 +921,15 @@ implements Bucket if (logger.isTraceEnabled(LogMarker.DM)) { logger.trace(LogMarker.DM, "LR.basicInvalidate: this cache has already seen this event {}", event); } -if (!event.isOriginRemote() -&& getBucketAdvisor().isPrimary()) { - // This cache has processed the event, forward operation - // and event messages to backup buckets - new
incubator-geode git commit: GEODE-669 Add CacheObserver for ShutdownAll
Repository: incubator-geode Updated Branches: refs/heads/develop 0b288a21d -> ae2d52940 GEODE-669 Add CacheObserver for ShutdownAll Let GatewayReceiverCommand to throw CacheClosedException instead of RegionDestroyedException when ShutdownAll happened. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/ae2d5294 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/ae2d5294 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/ae2d5294 Branch: refs/heads/develop Commit: ae2d529405f28caa0ab9fc1a3d309ebddbda4920 Parents: 0b288a2 Author: zhouxhAuthored: Tue Dec 15 11:21:32 2015 -0800 Committer: zhouxh Committed: Tue Dec 15 11:22:56 2015 -0800 -- .../gemfire/internal/cache/CacheObserver.java | 5 .../internal/cache/CacheObserverAdapter.java| 4 .../internal/cache/GemFireCacheImpl.java| 7 ++ .../sockets/command/GatewayReceiverCommand.java | 24 +--- 4 files changed, 32 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ae2d5294/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/CacheObserver.java -- diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/CacheObserver.java b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/CacheObserver.java index 9cd6c28..6b18d86 100644 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/CacheObserver.java +++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/CacheObserver.java @@ -183,4 +183,9 @@ public interface CacheObserver */ public void beforeDeletingEmptyOplog(Oplog emptyOplog); + /** + * Invoked just before ShutdownAll operation + * @param emptyOplog + */ + void beforeShutdownAll(); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ae2d5294/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/CacheObserverAdapter.java -- diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/CacheObserverAdapter.java b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/CacheObserverAdapter.java index 82c4507..ef66739 100644 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/CacheObserverAdapter.java +++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/CacheObserverAdapter.java @@ -147,4 +147,8 @@ public class CacheObserverAdapter implements CacheObserver { public void beforeDeletingEmptyOplog(Oplog emptyOplog) { } + + @Override + public void beforeShutdownAll() { + } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ae2d5294/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/GemFireCacheImpl.java -- diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/GemFireCacheImpl.java b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/GemFireCacheImpl.java index 27bb813..506bd7a 100644 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/GemFireCacheImpl.java +++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/GemFireCacheImpl.java @@ -1639,6 +1639,13 @@ public class GemFireCacheImpl implements InternalCache, ClientCache, HasCachePer // it's already doing shutdown by another thread return; } +if (LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER) { + try { +CacheObserverHolder.getInstance().beforeShutdownAll(); + } finally { +LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER = false; + } +} this.isShutDownAll = true; // bug 44031 requires multithread shutdownall should be grouped http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ae2d5294/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/command/GatewayReceiverCommand.java -- diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/command/GatewayReceiverCommand.java b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/command/GatewayReceiverCommand.java index 6d252e4..e2fb686 100644 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/command/GatewayReceiverCommand.java +++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/command/GatewayReceiverCommand.java @@ -24,6 +24,7 @@ import java.util.ArrayList; import java.util.List; import com.gemstone.gemfire.CancelException;
incubator-geode git commit: GEODE-371: The unfinished destroy operation is overwritten by the GII but the tombstone is left in cache. TombstoneGC on different members are not finished at the same time
Repository: incubator-geode Updated Branches: refs/heads/feature/GEODE-409 0cc9d895b -> a1162db7d GEODE-371: The unfinished destroy operation is overwritten by the GII but the tombstone is left in cache. TombstoneGC on different members are not finished at the same time. When GII happened in this window, the expected deltaGII will become full GII. However, after discussed with the team, we decide not to fix, only to enhance the test to wait until the time window is over. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/a1162db7 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/a1162db7 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/a1162db7 Branch: refs/heads/feature/GEODE-409 Commit: a1162db7dccf82ed5987b650dbe7b5c27d4e932f Parents: 0cc9d89 Author: zhouxhAuthored: Wed Oct 28 22:47:41 2015 -0700 Committer: zhouxh Committed: Thu Oct 29 10:36:20 2015 -0700 -- .../com/gemstone/gemfire/internal/cache/GIIDeltaDUnitTest.java | 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a1162db7/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIDeltaDUnitTest.java -- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIDeltaDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIDeltaDUnitTest.java index 38fc3ab..69894e1 100644 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIDeltaDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIDeltaDUnitTest.java @@ -416,6 +416,8 @@ public class GIIDeltaDUnitTest extends CacheTestCase { // restart R, to make sure the unfinished op is handled correctly forceGC(R, 1); // for bug 47616 +waitForToVerifyRVV(P, memberR, 6, null, 5); // P's rvv=R6, gc=5 +waitForToVerifyRVV(R, memberR, 6, null, 5); // P's rvv=R6, gc=5 closeCache(R); createDistributedRegion(R);
Git Push Summary
Repository: incubator-geode Updated Branches: refs/heads/feature/GEODE-329 [deleted] b3a3668e4
incubator-geode git commit: [GEODE-329] fix ShutdownAllDUnitTest failure
Repository: incubator-geode Updated Branches: refs/heads/develop f50ca04c9 -> 27eceb1f4 [GEODE-329] fix ShutdownAllDUnitTest failure There's a race condition that there will be 2 distributed systems are created in one JVM. When a DS is disconnecting, the current thread stays in wait(500) and release the lock. Thread2 comes and found a disconnected DS, so it will create a new DS. When the current thread waked up, it should double check if the DS has been changed. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/27eceb1f Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/27eceb1f Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/27eceb1f Branch: refs/heads/develop Commit: 27eceb1f49647df2207bcc966ba11631a4f5832e Parents: f50ca04 Author: zhouxhAuthored: Mon Sep 21 14:56:17 2015 -0700 Committer: zhouxh Committed: Tue Sep 29 15:21:55 2015 -0700 -- .../gemfire/distributed/DistributedSystem.java | 38 ++-- 1 file changed, 20 insertions(+), 18 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/27eceb1f/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/DistributedSystem.java -- diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/DistributedSystem.java b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/DistributedSystem.java index b7b2cd8..21be43f 100644 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/DistributedSystem.java +++ b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/DistributedSystem.java @@ -1584,32 +1584,34 @@ public abstract class DistributedSystem implements StatisticsFactory { } } else { -if (!existingSystems.isEmpty()) { +boolean existingSystemDisconnecting = true; +while (!existingSystems.isEmpty() && existingSystemDisconnecting) { Assert.assertTrue(existingSystems.size() == 1); InternalDistributedSystem existingSystem = -(InternalDistributedSystem) existingSystems.get(0); - if (existingSystem.isDisconnecting()) { -while (existingSystem.isConnected()) { - boolean interrupted = Thread.interrupted(); - try { -existingSystemsLock.wait(500); - } - catch (InterruptedException ex) { -interrupted = true; - } - finally { -if (interrupted) { - Thread.currentThread().interrupt(); -} + (InternalDistributedSystem) existingSystems.get(0); + existingSystemDisconnecting = existingSystem.isDisconnecting(); + if (existingSystemDisconnecting) { +boolean interrupted = Thread.interrupted(); +try { + // no notify for existingSystemsLock, just to release the sync + existingSystemsLock.wait(50); +} +catch (InterruptedException ex) { + interrupted = true; +} +finally { + if (interrupted) { +Thread.currentThread().interrupt(); } } - } - - if (existingSystem.isConnected()) { + } else if (existingSystem.isConnected()) { existingSystem.validateSameProperties(config, existingSystem.isConnected()); return existingSystem; + } else { + // This should not happen: existingSystem.isConnected()==false && existingSystem.isDisconnecting()==false +throw new AssertionError("system should not be disconnecting==false and isConnected==falsed"); } } }
incubator-geode git commit: fix the hang
Repository: incubator-geode Updated Branches: refs/heads/feature/GEODE-329 1fcec0336 -> b3a3668e4 fix the hang Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/b3a3668e Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/b3a3668e Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/b3a3668e Branch: refs/heads/feature/GEODE-329 Commit: b3a3668e458bb40e0d673a743418580c0cb6dd03 Parents: 1fcec03 Author: zhouxhAuthored: Mon Sep 28 16:27:17 2015 -0700 Committer: zhouxh Committed: Mon Sep 28 16:27:17 2015 -0700 -- .../gemfire/distributed/DistributedSystem.java | 39 ++-- 1 file changed, 19 insertions(+), 20 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b3a3668e/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/DistributedSystem.java -- diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/DistributedSystem.java b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/DistributedSystem.java index befcf1c..21be43f 100644 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/DistributedSystem.java +++ b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/DistributedSystem.java @@ -1584,35 +1584,34 @@ public abstract class DistributedSystem implements StatisticsFactory { } } else { -boolean existingSystemConnected = true; -while (!existingSystems.isEmpty() && existingSystemConnected) { +boolean existingSystemDisconnecting = true; +while (!existingSystems.isEmpty() && existingSystemDisconnecting) { Assert.assertTrue(existingSystems.size() == 1); - existingSystemConnected = false; InternalDistributedSystem existingSystem = (InternalDistributedSystem) existingSystems.get(0); - if (existingSystem.isDisconnecting()) { -while (existingSystem.isConnected()) { - boolean interrupted = Thread.interrupted(); - try { -existingSystemsLock.wait(500); - } - catch (InterruptedException ex) { -interrupted = true; - } - finally { -if (interrupted) { - Thread.currentThread().interrupt(); -} + existingSystemDisconnecting = existingSystem.isDisconnecting(); + if (existingSystemDisconnecting) { +boolean interrupted = Thread.interrupted(); +try { + // no notify for existingSystemsLock, just to release the sync + existingSystemsLock.wait(50); +} +catch (InterruptedException ex) { + interrupted = true; +} +finally { + if (interrupted) { +Thread.currentThread().interrupt(); } - existingSystemConnected = true; } - } - - if (existingSystem.isConnected()) { + } else if (existingSystem.isConnected()) { existingSystem.validateSameProperties(config, existingSystem.isConnected()); return existingSystem; + } else { + // This should not happen: existingSystem.isConnected()==false && existingSystem.isDisconnecting()==false +throw new AssertionError("system should not be disconnecting==false and isConnected==falsed"); } } }
incubator-geode git commit: fix the hang in my previous fix
Repository: incubator-geode Updated Branches: refs/heads/feature/GEODE-329 d20ecb50e -> 1fcec0336 fix the hang in my previous fix Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/1fcec033 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/1fcec033 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/1fcec033 Branch: refs/heads/feature/GEODE-329 Commit: 1fcec0336e09db054cb4e46f5645b873359d245b Parents: d20ecb5 Author: zhouxhAuthored: Fri Sep 25 15:54:22 2015 -0700 Committer: zhouxh Committed: Fri Sep 25 15:54:22 2015 -0700 -- .../gemfire/distributed/DistributedSystem.java | 52 ++-- 1 file changed, 25 insertions(+), 27 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1fcec033/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/DistributedSystem.java -- diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/DistributedSystem.java b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/DistributedSystem.java index 7ea9c20..befcf1c 100644 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/DistributedSystem.java +++ b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/DistributedSystem.java @@ -1584,39 +1584,37 @@ public abstract class DistributedSystem implements StatisticsFactory { } } else { -boolean existingSystemDisconnected = false; -do { - existingSystemDisconnected = false; - if (!existingSystems.isEmpty()) { -Assert.assertTrue(existingSystems.size() == 1); +boolean existingSystemConnected = true; +while (!existingSystems.isEmpty() && existingSystemConnected) { + Assert.assertTrue(existingSystems.size() == 1); + existingSystemConnected = false; -InternalDistributedSystem existingSystem = -(InternalDistributedSystem) existingSystems.get(0); -if (existingSystem.isDisconnecting()) { - while (existingSystem.isConnected()) { -boolean interrupted = Thread.interrupted(); -try { - existingSystemsLock.wait(500); -} -catch (InterruptedException ex) { - interrupted = true; -} -finally { - if (interrupted) { -Thread.currentThread().interrupt(); - } + InternalDistributedSystem existingSystem = + (InternalDistributedSystem) existingSystems.get(0); + if (existingSystem.isDisconnecting()) { +while (existingSystem.isConnected()) { + boolean interrupted = Thread.interrupted(); + try { +existingSystemsLock.wait(500); + } + catch (InterruptedException ex) { +interrupted = true; + } + finally { +if (interrupted) { + Thread.currentThread().interrupt(); } -existingSystemDisconnected = true; } + existingSystemConnected = true; } + } -if (existingSystem.isConnected()) { - existingSystem.validateSameProperties(config, - existingSystem.isConnected()); - return existingSystem; -} + if (existingSystem.isConnected()) { +existingSystem.validateSameProperties(config, +existingSystem.isConnected()); +return existingSystem; } -} while (existingSystemDisconnected && !existingSystems.isEmpty()); +} } // Make a new connection to the distributed system
incubator-geode git commit: add tests for analyzer specify LuceneSerialier for RepositoryManager
Repository: incubator-geode Updated Branches: refs/heads/feature/GEODE-11 db5db7a17 -> 58f13e265 add tests for analyzer specify LuceneSerialier for RepositoryManager Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/58f13e26 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/58f13e26 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/58f13e26 Branch: refs/heads/feature/GEODE-11 Commit: 58f13e2659e3f0ed8d3feac927bbadde363f1fb5 Parents: db5db7a Author: zhouxhAuthored: Wed Sep 23 11:49:09 2015 -0700 Committer: zhouxh Committed: Wed Sep 23 12:09:31 2015 -0700 -- .../LuceneIndexForPartitionedRegion.java| 4 +- .../internal/LuceneServiceImplJUnitTest.java| 43 2 files changed, 46 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/58f13e26/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexForPartitionedRegion.java -- diff --git a/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexForPartitionedRegion.java b/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexForPartitionedRegion.java index cbab401..1eff49a 100644 --- a/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexForPartitionedRegion.java +++ b/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexForPartitionedRegion.java @@ -20,6 +20,7 @@ import com.gemstone.gemfire.cache.lucene.LuceneIndex; import com.gemstone.gemfire.cache.lucene.internal.filesystem.ChunkKey; import com.gemstone.gemfire.cache.lucene.internal.filesystem.File; import com.gemstone.gemfire.cache.lucene.internal.repository.IndexRepository; +import com.gemstone.gemfire.cache.lucene.internal.repository.serializer.HeterogenousLuceneSerializer; import com.gemstone.gemfire.cache.lucene.internal.repository.serializer.LuceneSerializer; import com.gemstone.gemfire.cache.partition.PartitionRegionHelper; import com.gemstone.gemfire.internal.cache.PartitionedRegion; @@ -94,7 +95,8 @@ public class LuceneIndexForPartitionedRegion extends LuceneIndexImpl { } // we will create RegionDirectorys on the fly when data coming - repositoryManager = new PartitionedRepositoryManager(dataRegion, (PartitionedRegion)fileRegion, (PartitionedRegion)chunkRegion, null, analyzer); + HeterogenousLuceneSerializer mapper = new HeterogenousLuceneSerializer(getFieldNames()); + repositoryManager = new PartitionedRepositoryManager(dataRegion, (PartitionedRegion)fileRegion, (PartitionedRegion)chunkRegion, mapper, analyzer); hasInitialized = true; } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/58f13e26/gemfire-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/LuceneServiceImplJUnitTest.java -- diff --git a/gemfire-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/LuceneServiceImplJUnitTest.java b/gemfire-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/LuceneServiceImplJUnitTest.java index 65fad5d..a7ed00d 100644 --- a/gemfire-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/LuceneServiceImplJUnitTest.java +++ b/gemfire-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/LuceneServiceImplJUnitTest.java @@ -6,8 +6,13 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import java.io.IOException; +import java.util.HashMap; +import java.util.Map; import org.apache.logging.log4j.Logger; +import org.apache.lucene.analysis.Analyzer; +import org.apache.lucene.analysis.core.KeywordAnalyzer; +import org.apache.lucene.analysis.miscellaneous.PerFieldAnalyzerWrapper; import org.apache.lucene.analysis.standard.StandardAnalyzer; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.queryparser.classic.ParseException; @@ -23,6 +28,7 @@ import com.gemstone.gemfire.cache.execute.Function; import com.gemstone.gemfire.cache.execute.FunctionService; import com.gemstone.gemfire.cache.lucene.LuceneServiceProvider; import com.gemstone.gemfire.cache.lucene.internal.distributed.LuceneFunction; +import com.gemstone.gemfire.cache.lucene.internal.repository.RepositoryManager; import com.gemstone.gemfire.cache.lucene.internal.repository.serializer.HeterogenousLuceneSerializer; import com.gemstone.gemfire.internal.cache.GemFireCacheImpl; import com.gemstone.gemfire.internal.cache.LocalRegion; @@ -124,6 +130,10 @@ public class LuceneServiceImplJUnitTest {
incubator-geode git commit: [GEODE-329] fix ShutdownAllDUnitTest failure
Repository: incubator-geode Updated Branches: refs/heads/feature/GEODE-329 [created] 1ff59f744 [GEODE-329] fix ShutdownAllDUnitTest failure There's a race condition that there will be 2 distributed systems are created in one JVM. When a DS is disconnecting, the current thread stays in wait(500) and release the lock. Thread2 comes and found a disconnected DS, so it will create a new DS. When the current thread waked up, it should double check if the DS has been changed. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/1ff59f74 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/1ff59f74 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/1ff59f74 Branch: refs/heads/feature/GEODE-329 Commit: 1ff59f7440709c11b5f09d11ed08190e225cc8e3 Parents: 4708d4e Author: zhouxhAuthored: Mon Sep 21 14:56:17 2015 -0700 Committer: zhouxh Committed: Mon Sep 21 14:56:17 2015 -0700 -- .../gemfire/distributed/DistributedSystem.java | 48 +++- 1 file changed, 26 insertions(+), 22 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1ff59f74/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/DistributedSystem.java -- diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/DistributedSystem.java b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/DistributedSystem.java index b7b2cd8..312d283 100644 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/DistributedSystem.java +++ b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/DistributedSystem.java @@ -1584,34 +1584,38 @@ public abstract class DistributedSystem implements StatisticsFactory { } } else { -if (!existingSystems.isEmpty()) { - Assert.assertTrue(existingSystems.size() == 1); +boolean existingSystemDisconnected = false; +do { + if (!existingSystems.isEmpty()) { +Assert.assertTrue(existingSystems.size() == 1); - InternalDistributedSystem existingSystem = -(InternalDistributedSystem) existingSystems.get(0); - if (existingSystem.isDisconnecting()) { -while (existingSystem.isConnected()) { - boolean interrupted = Thread.interrupted(); - try { -existingSystemsLock.wait(500); - } - catch (InterruptedException ex) { -interrupted = true; - } - finally { -if (interrupted) { - Thread.currentThread().interrupt(); +InternalDistributedSystem existingSystem = +(InternalDistributedSystem) existingSystems.get(0); +if (existingSystem.isDisconnecting()) { + while (existingSystem.isConnected()) { +boolean interrupted = Thread.interrupted(); +try { + existingSystemsLock.wait(500); +} +catch (InterruptedException ex) { + interrupted = true; +} +finally { + if (interrupted) { +Thread.currentThread().interrupt(); + } } } + existingSystemDisconnected = true; } - } - if (existingSystem.isConnected()) { -existingSystem.validateSameProperties(config, -existingSystem.isConnected()); -return existingSystem; +if (existingSystem.isConnected()) { + existingSystem.validateSameProperties(config, + existingSystem.isConnected()); + return existingSystem; +} } -} +} while (existingSystemDisconnected); } // Make a new connection to the distributed system