[geode] branch develop updated (e2d66c4 -> 068c613)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a change to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git. from e2d66c4 GEODE-9658: refactor test AuthInit to not use static field for credentials. (#6922) add 068c613 GEODE-8200: After checking locator presence store the status in OperationStateStore (#6914) No new revisions were added by this update. Summary of changes: .../rest/RestoreRedundancyManagementDUnitTest.java | 34 .../operation/OperationHistoryManager.java | 13 +++--- .../internal/operation/OperationState.java | 13 ++ .../operation/OperationHistoryManagerTest.java | 11 -- .../internal/operation/OperationStateTest.java | 46 ++ 5 files changed, 107 insertions(+), 10 deletions(-)
[geode] branch feature/introduce-codeowners updated: I volunteered
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/introduce-codeowners in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/feature/introduce-codeowners by this push: new 659b7e1 I volunteered 659b7e1 is described below commit 659b7e1016b08c61e6f313a8d7d1a0801f11f4cb Author: anilkumar gingade AuthorDate: Mon Dec 14 09:08:48 2020 -0800 I volunteered --- CODEOWNERS | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/CODEOWNERS b/CODEOWNERS index 8d18fdb..24666fc 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -56,8 +56,8 @@ CODEOWNERS @apache/geode-committers #-- # Client Queues #-- -#geode-core/**/org/apache/geode/internal/cache/ha/** -#geode-core/**/org/apache/geode/internal/cache/tier/CacheClient* +geode-core/**/org/apache/geode/internal/cache/ha/** @agingade +geode-core/**/org/apache/geode/internal/cache/tier/CacheClient* @agingade # # Experimental Protobuf based Client/Server @@ -102,7 +102,7 @@ CODEOWNERS @apache/geode-committers # # Event tracking # -#geode-core/**/org/apache/geode/internal/cache/event/** +geode-core/**/org/apache/geode/internal/cache/event/** @agingade # # Eviction @@ -179,7 +179,7 @@ geode-web-api/** @jdeppe-pivotal # #geode-core/**/org/apache/geode/cache/persistence/** #geode-core/**/org/apache/geode/internal/cache/persistence/** -#geode-core/**/org/apache/geode/internal/cache/backup/** +geode-core/**/org/apache/geode/internal/cache/backup/** @agingade # # Region Version Vectors - used for sychronization on @@ -247,15 +247,15 @@ geode-core/**/org/apache/geode/internal/cache/operations/** @jdeppe-pivotal # # Region Snapshots # -#geode-core/**/org/apache/geode/cache/snapshot/** -#geode-core/**/org/apache/geode/internal/cache/snapshot/** +geode-core/**/org/apache/geode/cache/snapshot/** @agingade +geode-core/**/org/apache/geode/internal/cache/snapshot/**@agingade # # JDBC connector # #geode-connectors/** -#geode-core/**/org/apache/geode/datasource/** -#geode-core/**/org/apache/geode/internal/datasource/** +geode-core/**/org/apache/geode/datasource/** @agingade +geode-core/**/org/apache/geode/internal/datasource/**@agingade #
[geode] branch support/1.12 updated: GEODE-8394: Rewind the message Part on command failure (#5424)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch support/1.12 in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/support/1.12 by this push: new b94e793 GEODE-8394: Rewind the message Part on command failure (#5424) b94e793 is described below commit b94e793768b681c7ca2ea3df002ff7ae77e54122 Author: agingade AuthorDate: Fri Aug 7 10:12:27 2020 -0700 GEODE-8394: Rewind the message Part on command failure (#5424) GEODE-8394: Rewind the message Part on failure Co-authored-by: anilkumar gingade (cherry picked from commit 83d1e28a953b7d73e7f499f9013540bedd0bd472) --- .../ClientServerCacheOperationDUnitTest.java | 203 + .../geode/internal/cache/tier/sockets/Part.java| 21 ++- .../internal/cache/tier/sockets/PartTest.java | 105 +++ 3 files changed, 323 insertions(+), 6 deletions(-) diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache30/ClientServerCacheOperationDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache30/ClientServerCacheOperationDUnitTest.java new file mode 100644 index 000..9662e97 --- /dev/null +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache30/ClientServerCacheOperationDUnitTest.java @@ -0,0 +1,203 @@ +/* + * 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 org.apache.geode.cache30; + +import static org.apache.geode.cache.RegionShortcut.REPLICATE; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; + +import java.io.IOException; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import org.apache.geode.cache.Region; +import org.apache.geode.cache.RegionFactory; +import org.apache.geode.cache.client.ClientRegionShortcut; +import org.apache.geode.cache.client.Pool; +import org.apache.geode.cache.client.PoolManager; +import org.apache.geode.cache.client.ServerConnectivityException; +import org.apache.geode.cache.server.CacheServer; +import org.apache.geode.test.dunit.DistributedTestUtils; +import org.apache.geode.test.dunit.VM; +import org.apache.geode.test.dunit.rules.CacheRule; +import org.apache.geode.test.dunit.rules.ClientCacheRule; +import org.apache.geode.test.dunit.rules.DistributedRule; +import org.apache.geode.test.junit.categories.ClientServerTest; + +@Category({ClientServerTest.class}) +public class ClientServerCacheOperationDUnitTest implements Serializable { + + private String regionName = "CsTestRegion"; + + @Rule + public DistributedRule distributedRule = new DistributedRule(); + + @Rule + public CacheRule cacheRule = new CacheRule(); + + @Rule + public ClientCacheRule clientCacheRule = new ClientCacheRule(); + + @Test + public void largeObjectPutWithReadTimeoutThrowsException() { +VM server1 = VM.getVM(0); +VM server2 = VM.getVM(1); +VM client = VM.getVM(2); + +final int byteSize = 40 * 1000 * 1000; +final int listSize = 2; +final int locatorPort = DistributedTestUtils.getLocatorPort(); + +server1.invoke(() -> createServerCache()); +server2.invoke(() -> createServerCache()); + +server1.invoke(() -> { + RegionFactory regionFactory = cacheRule.getCache().createRegionFactory(REPLICATE); + regionFactory.create(regionName); +}); + +server2.invoke(() -> { + RegionFactory regionFactory = cacheRule.getCache().createRegionFactory(REPLICATE); + regionFactory.create(regionName); +}); + +List list = new ArrayList(listSize); + +for (int i = 0; i < listSize; i++) { + list.add(new byte[byteSize]); +} + +client.invoke(() -> { + clientCacheRule.createClientCache(); + + Pool pool = PoolManager.createFactory() + .addLocator("localhost", locatorPort) + .setSocketBufferSize(50) + .setReadTimeout(40) + .setPingInterval(200) + .setSocketConnectTimeout(50) + .create("test
[geode] branch support/1.12 updated: Revert "GEODE-8394: Rewind the message Part on command failure (#5424)"
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch support/1.12 in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/support/1.12 by this push: new 5998900 Revert "GEODE-8394: Rewind the message Part on command failure (#5424)" 5998900 is described below commit 5998900a396ebaf02422fb0fe7d394ba0d12d3d7 Author: anilkumar gingade AuthorDate: Fri Aug 7 17:26:35 2020 -0700 Revert "GEODE-8394: Rewind the message Part on command failure (#5424)" This reverts commit a6332c4576e82b5620d53ed78b768b2c47570d55. --- .../ClientServerCacheOperationDUnitTest.java | 204 - .../geode/internal/cache/tier/sockets/Part.java| 21 +-- .../internal/cache/tier/sockets/PartTest.java | 105 --- 3 files changed, 6 insertions(+), 324 deletions(-) diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache30/ClientServerCacheOperationDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache30/ClientServerCacheOperationDUnitTest.java deleted file mode 100644 index 4bfa3cc..000 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache30/ClientServerCacheOperationDUnitTest.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * 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 org.apache.geode.cache30; - -import static org.apache.geode.cache.RegionShortcut.REPLICATE; -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatThrownBy; - -import java.io.IOException; -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -import org.junit.Rule; -import org.junit.Test; -import org.junit.experimental.categories.Category; - -import org.apache.geode.cache.Region; -import org.apache.geode.cache.RegionFactory; -import org.apache.geode.cache.client.ClientRegionShortcut; -import org.apache.geode.cache.client.Pool; -import org.apache.geode.cache.client.PoolManager; -import org.apache.geode.cache.client.ServerConnectivityException; -import org.apache.geode.cache.server.CacheServer; -import org.apache.geode.test.dunit.DistributedTestUtils; -import org.apache.geode.test.dunit.VM; -import org.apache.geode.test.dunit.rules.CacheRule; -import org.apache.geode.test.dunit.rules.ClientCacheRule; -import org.apache.geode.test.dunit.rules.DistributedRule; -import org.apache.geode.test.junit.categories.ClientServerTest; - -@Category({ClientServerTest.class}) -public class ClientServerCacheOperationDUnitTest implements Serializable { - - private String regionName = "CsTestRegion"; - - @Rule - public DistributedRule distributedRule = new DistributedRule(); - - @Rule - public CacheRule cacheRule = new CacheRule(); - - @Rule - public ClientCacheRule clientCacheRule = new ClientCacheRule(); - - @Test - public void largeObjectPutWithReadTimeoutThrowsException() { -VM server1 = VM.getVM(0); -VM server2 = VM.getVM(1); -VM client = VM.getVM(2); - -final int byteSize = 40 * 1000 * 1000; -final int listSize = 2; -final int locatorPort = DistributedTestUtils.getLocatorPort(); - -server1.invoke(() -> createServerCache()); -server2.invoke(() -> createServerCache()); - -server1.invoke(() -> { - RegionFactory regionFactory = cacheRule.getCache().createRegionFactory(REPLICATE); - regionFactory.create(regionName); -}); - -server2.invoke(() -> { - RegionFactory regionFactory = cacheRule.getCache().createRegionFactory(REPLICATE); - regionFactory.create(regionName); -}); - -List list = new ArrayList(listSize); - -for (int i = 0; i < listSize; i++) { - list.add(new byte[byteSize]); -} - -client.invoke(() -> { - clientCacheRule.createClientCache(); - - Pool pool = PoolManager.createFactory() - .addLocator("localhost", locatorPort) - .setSocketBufferSize(50) - .setReadTimeout(40) - .setPingInterval(200) - .setSocketConnectTimeout(50) - .setServerConnectionTimeout(50) -
[geode] branch support/1.12 updated: GEODE-8394: Rewind the message Part on command failure (#5424)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch support/1.12 in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/support/1.12 by this push: new a6332c4 GEODE-8394: Rewind the message Part on command failure (#5424) a6332c4 is described below commit a6332c4576e82b5620d53ed78b768b2c47570d55 Author: agingade AuthorDate: Fri Aug 7 10:12:27 2020 -0700 GEODE-8394: Rewind the message Part on command failure (#5424) GEODE-8394: Rewind the message Part on failure Co-authored-by: anilkumar gingade (cherry picked from commit 83d1e28a953b7d73e7f499f9013540bedd0bd472) --- .../ClientServerCacheOperationDUnitTest.java | 204 + .../geode/internal/cache/tier/sockets/Part.java| 21 ++- .../internal/cache/tier/sockets/PartTest.java | 105 +++ 3 files changed, 324 insertions(+), 6 deletions(-) diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache30/ClientServerCacheOperationDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache30/ClientServerCacheOperationDUnitTest.java new file mode 100644 index 000..4bfa3cc --- /dev/null +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache30/ClientServerCacheOperationDUnitTest.java @@ -0,0 +1,204 @@ +/* + * 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 org.apache.geode.cache30; + +import static org.apache.geode.cache.RegionShortcut.REPLICATE; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; + +import java.io.IOException; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import org.apache.geode.cache.Region; +import org.apache.geode.cache.RegionFactory; +import org.apache.geode.cache.client.ClientRegionShortcut; +import org.apache.geode.cache.client.Pool; +import org.apache.geode.cache.client.PoolManager; +import org.apache.geode.cache.client.ServerConnectivityException; +import org.apache.geode.cache.server.CacheServer; +import org.apache.geode.test.dunit.DistributedTestUtils; +import org.apache.geode.test.dunit.VM; +import org.apache.geode.test.dunit.rules.CacheRule; +import org.apache.geode.test.dunit.rules.ClientCacheRule; +import org.apache.geode.test.dunit.rules.DistributedRule; +import org.apache.geode.test.junit.categories.ClientServerTest; + +@Category({ClientServerTest.class}) +public class ClientServerCacheOperationDUnitTest implements Serializable { + + private String regionName = "CsTestRegion"; + + @Rule + public DistributedRule distributedRule = new DistributedRule(); + + @Rule + public CacheRule cacheRule = new CacheRule(); + + @Rule + public ClientCacheRule clientCacheRule = new ClientCacheRule(); + + @Test + public void largeObjectPutWithReadTimeoutThrowsException() { +VM server1 = VM.getVM(0); +VM server2 = VM.getVM(1); +VM client = VM.getVM(2); + +final int byteSize = 40 * 1000 * 1000; +final int listSize = 2; +final int locatorPort = DistributedTestUtils.getLocatorPort(); + +server1.invoke(() -> createServerCache()); +server2.invoke(() -> createServerCache()); + +server1.invoke(() -> { + RegionFactory regionFactory = cacheRule.getCache().createRegionFactory(REPLICATE); + regionFactory.create(regionName); +}); + +server2.invoke(() -> { + RegionFactory regionFactory = cacheRule.getCache().createRegionFactory(REPLICATE); + regionFactory.create(regionName); +}); + +List list = new ArrayList(listSize); + +for (int i = 0; i < listSize; i++) { + list.add(new byte[byteSize]); +} + +client.invoke(() -> { + clientCacheRule.createClientCache(); + + Pool pool = PoolManager.createFactory() + .addLocator("localhost", locatorPort) + .setSocketBufferSize(50) + .setReadTimeout(40) + .setPingInterval(200) + .setSocketConnectTimeout(50) + .s
[geode] branch support/1.13 updated: GEODE-8394: Rewind the message Part on command failure (#5424)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch support/1.13 in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/support/1.13 by this push: new 0fe6518 GEODE-8394: Rewind the message Part on command failure (#5424) 0fe6518 is described below commit 0fe6518851d7bdd85d544b8f3c0647ab9053c891 Author: agingade AuthorDate: Fri Aug 7 10:12:27 2020 -0700 GEODE-8394: Rewind the message Part on command failure (#5424) GEODE-8394: Rewind the message Part on failure Co-authored-by: anilkumar gingade (cherry picked from commit 83d1e28a953b7d73e7f499f9013540bedd0bd472) --- .../ClientServerCacheOperationDUnitTest.java | 204 + .../geode/internal/cache/tier/sockets/Part.java| 21 ++- .../internal/cache/tier/sockets/PartTest.java | 105 +++ 3 files changed, 324 insertions(+), 6 deletions(-) diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache30/ClientServerCacheOperationDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache30/ClientServerCacheOperationDUnitTest.java new file mode 100644 index 000..4bfa3cc --- /dev/null +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache30/ClientServerCacheOperationDUnitTest.java @@ -0,0 +1,204 @@ +/* + * 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 org.apache.geode.cache30; + +import static org.apache.geode.cache.RegionShortcut.REPLICATE; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; + +import java.io.IOException; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import org.apache.geode.cache.Region; +import org.apache.geode.cache.RegionFactory; +import org.apache.geode.cache.client.ClientRegionShortcut; +import org.apache.geode.cache.client.Pool; +import org.apache.geode.cache.client.PoolManager; +import org.apache.geode.cache.client.ServerConnectivityException; +import org.apache.geode.cache.server.CacheServer; +import org.apache.geode.test.dunit.DistributedTestUtils; +import org.apache.geode.test.dunit.VM; +import org.apache.geode.test.dunit.rules.CacheRule; +import org.apache.geode.test.dunit.rules.ClientCacheRule; +import org.apache.geode.test.dunit.rules.DistributedRule; +import org.apache.geode.test.junit.categories.ClientServerTest; + +@Category({ClientServerTest.class}) +public class ClientServerCacheOperationDUnitTest implements Serializable { + + private String regionName = "CsTestRegion"; + + @Rule + public DistributedRule distributedRule = new DistributedRule(); + + @Rule + public CacheRule cacheRule = new CacheRule(); + + @Rule + public ClientCacheRule clientCacheRule = new ClientCacheRule(); + + @Test + public void largeObjectPutWithReadTimeoutThrowsException() { +VM server1 = VM.getVM(0); +VM server2 = VM.getVM(1); +VM client = VM.getVM(2); + +final int byteSize = 40 * 1000 * 1000; +final int listSize = 2; +final int locatorPort = DistributedTestUtils.getLocatorPort(); + +server1.invoke(() -> createServerCache()); +server2.invoke(() -> createServerCache()); + +server1.invoke(() -> { + RegionFactory regionFactory = cacheRule.getCache().createRegionFactory(REPLICATE); + regionFactory.create(regionName); +}); + +server2.invoke(() -> { + RegionFactory regionFactory = cacheRule.getCache().createRegionFactory(REPLICATE); + regionFactory.create(regionName); +}); + +List list = new ArrayList(listSize); + +for (int i = 0; i < listSize; i++) { + list.add(new byte[byteSize]); +} + +client.invoke(() -> { + clientCacheRule.createClientCache(); + + Pool pool = PoolManager.createFactory() + .addLocator("localhost", locatorPort) + .setSocketBufferSize(50) + .setReadTimeout(40) + .setPingInterval(200) + .setSocketConnectTimeout(50) + .s
[geode] branch develop updated (fbcf0c6 -> 83d1e28)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a change to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git. from fbcf0c6 GEODE-8406: Enable early-return in CI scripts for CI-only changes (#5427) add 83d1e28 GEODE-8394: Rewind the message Part on command failure (#5424) No new revisions were added by this update. Summary of changes: .../ClientServerCacheOperationDUnitTest.java | 204 + .../geode/internal/cache/tier/sockets/Part.java| 21 ++- .../internal/cache/tier/sockets/PartTest.java | 105 +++ 3 files changed, 324 insertions(+), 6 deletions(-) create mode 100644 geode-core/src/distributedTest/java/org/apache/geode/cache30/ClientServerCacheOperationDUnitTest.java
[geode] branch develop updated (fbcf0c6 -> 83d1e28)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a change to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git. from fbcf0c6 GEODE-8406: Enable early-return in CI scripts for CI-only changes (#5427) add 83d1e28 GEODE-8394: Rewind the message Part on command failure (#5424) No new revisions were added by this update. Summary of changes: .../ClientServerCacheOperationDUnitTest.java | 204 + .../geode/internal/cache/tier/sockets/Part.java| 21 ++- .../internal/cache/tier/sockets/PartTest.java | 105 +++ 3 files changed, 324 insertions(+), 6 deletions(-) create mode 100644 geode-core/src/distributedTest/java/org/apache/geode/cache30/ClientServerCacheOperationDUnitTest.java
[geode] branch feature/GEODE-7665 updated: GEODE-8173: Add unit test (coverage) for PartitionedRegionClear class. (#5208)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/GEODE-7665 in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/feature/GEODE-7665 by this push: new be392db GEODE-8173: Add unit test (coverage) for PartitionedRegionClear class. (#5208) be392db is described below commit be392dbd193b2af2858116b32e4f3001c448a605 Author: agingade AuthorDate: Mon Jun 8 10:23:50 2020 -0700 GEODE-8173: Add unit test (coverage) for PartitionedRegionClear class. (#5208) * GEODE-8173: Add unit test (coverage) for PartitionedRegionClear class. Co-authored-by: anilkumar gingade --- .../cache/PRCacheListenerDistributedTest.java | 337 +++- .../ReplicateCacheListenerDistributedTest.java | 4 +- .../geode/internal/cache/PartitionedRegion.java| 2 +- .../internal/cache/PartitionedRegionClear.java | 83 ++- .../internal/cache/PartitionedRegionClearTest.java | 611 + 5 files changed, 999 insertions(+), 38 deletions(-) diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache/PRCacheListenerDistributedTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache/PRCacheListenerDistributedTest.java index f4a9ac9..7d95473 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache/PRCacheListenerDistributedTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache/PRCacheListenerDistributedTest.java @@ -17,10 +17,18 @@ package org.apache.geode.cache; import static org.apache.geode.test.dunit.VM.getVM; import static org.apache.geode.test.dunit.VM.getVMCount; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; +import static org.hamcrest.Matchers.anyOf; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.not; +import static org.hamcrest.Matchers.nullValue; +import java.io.Serializable; import java.util.Arrays; import java.util.Collection; +import org.junit.Before; +import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; @@ -28,7 +36,13 @@ import org.junit.runners.Parameterized.Parameter; import org.junit.runners.Parameterized.Parameters; import org.junit.runners.Parameterized.UseParametersRunnerFactory; +import org.apache.geode.cache.util.CacheListenerAdapter; import org.apache.geode.logging.internal.log4j.api.LogService; +import org.apache.geode.test.dunit.rules.CacheRule; +import org.apache.geode.test.dunit.rules.DistributedRule; +import org.apache.geode.test.dunit.rules.SharedCountersRule; +import org.apache.geode.test.dunit.rules.SharedErrorCollector; +import org.apache.geode.test.junit.rules.serializable.SerializableTestName; import org.apache.geode.test.junit.runners.CategoryWithParameterizedRunnerFactory; /** @@ -43,7 +57,28 @@ import org.apache.geode.test.junit.runners.CategoryWithParameterizedRunnerFactor @RunWith(Parameterized.class) @UseParametersRunnerFactory(CategoryWithParameterizedRunnerFactory.class) @SuppressWarnings("serial") -public class PRCacheListenerDistributedTest extends ReplicateCacheListenerDistributedTest { +public class PRCacheListenerDistributedTest implements Serializable { + + protected static final String CLEAR = "CLEAR"; + protected static final String REGION_DESTROY = "REGION_DESTROY"; + private static final String CREATES = "CREATES"; + private static final String UPDATES = "UPDATES"; + private static final String INVALIDATES = "INVALIDATES"; + private static final String DESTROYS = "DESTROYS"; + private static final int ENTRY_VALUE = 0; + private static final int UPDATED_ENTRY_VALUE = 1; + private static final String KEY = "key-1"; + @Rule + public DistributedRule distributedRule = new DistributedRule(); + @Rule + public CacheRule cacheRule = CacheRule.builder().createCacheInAll().build(); + @Rule + public SerializableTestName testName = new SerializableTestName(); + @Rule + public SharedCountersRule sharedCountersRule = new SharedCountersRule(); + @Rule + public SharedErrorCollector errorCollector = new SharedErrorCollector(); + protected String regionName; @Parameters public static Collection data() { @@ -59,7 +94,6 @@ public class PRCacheListenerDistributedTest extends ReplicateCacheListenerDistri @Parameter(1) public Boolean withData; - @Override protected Region createRegion(final String name, final CacheListener listener) { return createPartitionedRegion(name, listener, false); @@ -99,22 +133,18 @@ public class PRCacheListenerDistributedTest extends ReplicateCacheListenerDistri } } - @Override protected int expectedCreates() { return 1; } - @Override protected int expectedUpdates() { retu
[geode] branch feature/GEODE-7665 updated: GEODE-7678 (2nd PR) - Support for cache-listener and client-notification for Partitioned Region Clear operation (#5124)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/GEODE-7665 in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/feature/GEODE-7665 by this push: new e960021 GEODE-7678 (2nd PR) - Support for cache-listener and client-notification for Partitioned Region Clear operation (#5124) e960021 is described below commit e9600213fef5d6adb4fcef4e3ed63fd0cc21 Author: agingade AuthorDate: Wed May 20 16:08:07 2020 -0700 GEODE-7678 (2nd PR) - Support for cache-listener and client-notification for Partitioned Region Clear operation (#5124) * GEODE-7678: Add support for cache listener and client notification for PR clear The changes are made to PR clear messaging and locking mechanism to preserve cache-listener and client-events ordering during concurrent cache operation while clear in progress. --- .../integrationTest/resources/assembly_content.txt | 1 + .../cache/PRCacheListenerDistributedTest.java | 250 +++- .../ReplicateCacheListenerDistributedTest.java | 111 +- ...ionedRegionAfterClearNotificationDUnitTest.java | 372 ++ .../cache/PartitionedRegionClearDUnitTest.java | 1 - ...titionedRegionClearWithExpirationDUnitTest.java | 69 ++-- ...itionedRegionClearWithExpirationDUnitTest.java} | 58 +-- .../cache/PartitionedRegionIntegrationTest.java| 45 +++ .../codeAnalysis/sanctionedDataSerializables.txt | 8 + .../PartitionedRegionPartialClearException.java| 37 ++ .../main/java/org/apache/geode/cache/Region.java | 4 +- .../org/apache/geode/internal/DSFIDFactory.java| 5 + .../apache/geode/internal/cache/BucketAdvisor.java | 2 +- .../apache/geode/internal/cache/BucketRegion.java | 17 +- .../internal/cache/DistributedClearOperation.java | 10 +- .../geode/internal/cache/DistributedRegion.java| 9 +- .../geode/internal/cache/InternalRegion.java | 3 + .../apache/geode/internal/cache/LocalRegion.java | 3 +- .../geode/internal/cache/PartitionedRegion.java| 217 ++- .../internal/cache/PartitionedRegionClear.java | 419 + .../cache/PartitionedRegionClearMessage.java | 287 ++ .../internal/cache/PartitionedRegionDataStore.java | 8 + .../internal/cache/partitioned/RegionAdvisor.java | 11 + .../sanctioned-geode-core-serializables.txt| 2 + .../internal/cache/BucketRegionJUnitTest.java | 4 +- .../internal/cache/PartitionedRegionTest.java | 39 -- .../serialization/DataSerializableFixedID.java | 2 + 27 files changed, 1679 insertions(+), 315 deletions(-) diff --git a/geode-assembly/src/integrationTest/resources/assembly_content.txt b/geode-assembly/src/integrationTest/resources/assembly_content.txt index 5beafe5..ae5243c 100644 --- a/geode-assembly/src/integrationTest/resources/assembly_content.txt +++ b/geode-assembly/src/integrationTest/resources/assembly_content.txt @@ -221,6 +221,7 @@ javadoc/org/apache/geode/cache/PartitionAttributes.html javadoc/org/apache/geode/cache/PartitionAttributesFactory.html javadoc/org/apache/geode/cache/PartitionResolver.html javadoc/org/apache/geode/cache/PartitionedRegionDistributionException.html +javadoc/org/apache/geode/cache/PartitionedRegionPartialClearException.html javadoc/org/apache/geode/cache/PartitionedRegionStorageException.html javadoc/org/apache/geode/cache/Region.Entry.html javadoc/org/apache/geode/cache/Region.html diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache/PRCacheListenerDistributedTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache/PRCacheListenerDistributedTest.java index 559def7..f4a9ac9 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache/PRCacheListenerDistributedTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache/PRCacheListenerDistributedTest.java @@ -14,14 +14,21 @@ */ package org.apache.geode.cache; +import static org.apache.geode.test.dunit.VM.getVM; +import static org.apache.geode.test.dunit.VM.getVMCount; +import static org.assertj.core.api.Assertions.assertThat; + import java.util.Arrays; +import java.util.Collection; +import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameter; import org.junit.runners.Parameterized.Parameters; import org.junit.runners.Parameterized.UseParametersRunnerFactory; +import org.apache.geode.logging.internal.log4j.api.LogService; import org.apache.geode.test.junit.runners.CategoryWithParameterizedRunnerFactory; /** @@ -38,28 +45,60 @@ import org.apache.geode.test.junit.runners.CategoryWithParameterizedRunnerFactor @SuppressWarnings("serial") public class PRCacheListenerDistributedTest extends ReplicateCacheListenerDistributedTest { - @Parameters(name = "{index}
[geode] branch develop updated (1165869 -> d013311)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a change to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git. from 1165869 GEODE-7867 Add more unit tests to geode-tcp-server (#4796) add d013311 GEODE-7880: revert changes related to GEODE-6536 (#4810) No new revisions were added by this update. Summary of changes: .../apache/geode/cache30/CacheXml66DUnitTest.java | 5 +- .../cache/tier/sockets/AcceptorImplDUnitTest.java | 1 - .../cache/ConnectionPoolFactoryJUnitTest.java | 16 --- .../AutoConnectionSourceImplJUnitTest.java | 5 - .../internal/ConnectionPoolImplJUnitTest.java | 1 - .../client/internal/QueueManagerJUnitTest.java | 5 - .../pooling/ConnectionManagerImplTest.java | 45 +++ .../pooling/ConnectionManagerJUnitTest.java| 131 + .../codeAnalysis/sanctionedDataSerializables.txt | 6 +- .../geode/cache/client/ClientCacheFactory.java | 20 .../java/org/apache/geode/cache/client/Pool.java | 7 -- .../org/apache/geode/cache/client/PoolFactory.java | 27 - .../cache/client/internal/OpExecutorImpl.java | 7 +- .../geode/cache/client/internal/PoolImpl.java | 22 +--- .../client/internal/pooling/ConnectionManager.java | 5 +- .../internal/pooling/ConnectionManagerImpl.java| 79 - .../apache/geode/cache/configuration/PoolType.java | 25 .../geode/internal/cache/PoolFactoryImpl.java | 23 +--- .../geode/internal/cache/xmlcache/CacheXml.java| 1 - .../internal/cache/xmlcache/CacheXmlGenerator.java | 4 - .../internal/cache/xmlcache/CacheXmlParser.java| 4 - .../geode.apache.org/schema/cache/cache-1.0.xsd| 1 - .../schema.pivotal.io/gemfire/cache/cache-8.1.xsd | 1 - .../org/apache/geode/cache/doc-files/cache7_0.dtd | 1 - .../org/apache/geode/cache/doc-files/cache8_0.dtd | 1 - .../sanctioned-geode-core-serializables.txt| 2 +- .../client/internal/OpExecutorImplJUnitTest.java | 25 ++-- .../cache/client/internal/TXFailoverOpTest.java| 2 - geode-docs/reference/topics/cache_xml.html.md.erb | 7 +- .../reference/topics/client-cache.html.md.erb | 7 +- .../cache/tier/sockets/CacheServerTestUtil.java| 1 - 31 files changed, 67 insertions(+), 420 deletions(-)
[geode] branch feature/GEODE-7465 updated (386e73c -> c835a66)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a change to branch feature/GEODE-7465 in repository https://gitbox.apache.org/repos/asf/geode.git. from 386e73c GEODE-7465: Updated test add c835a66 Add unit tests. No new revisions were added by this update. Summary of changes: .../internal/SerialAsyncEventQueueImpl.java| 27 +++-- .../internal/cache/wan/AbstractGatewaySender.java | 4 +- .../wan/AbstractGatewaySenderEventProcessor.java | 6 +- ...currentParallelGatewaySenderEventProcessor.java | 8 +- ...oncurrentSerialGatewaySenderEventProcessor.java | 8 +- .../cache/wan/serial/SerialGatewaySenderQueue.java | 2 +- .../internal/SerialAsyncEventQueueImplTest.java| 118 + 7 files changed, 151 insertions(+), 22 deletions(-) create mode 100644 geode-core/src/test/java/org/apache/geode/cache/asyncqueue/internal/SerialAsyncEventQueueImplTest.java
[geode] branch feature/GEODE-7465 updated (4ecfd68 -> b72d505)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a change to branch feature/GEODE-7465 in repository https://gitbox.apache.org/repos/asf/geode.git. from 4ecfd68 GEODE-7465: Set eventProcessor to null in serial AEQ when it is stopped add b72d505 Add integration and dunit test. No new revisions were added by this update. Summary of changes: .../AsyncEventListenerDistributedTest.java | 25 .../SerialAsyncEventQueueImplJUnitTest.java| 27 ++ 2 files changed, 52 insertions(+)
[geode] branch develop updated (1ea556f -> 76d794f)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a change to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git. from 1ea556f GEODE-7322: improvements to script to generate management REST wiki (#4274) add 76d794f GEODE-7367: Increased max and init memory for ServerContainer (#4251) No new revisions were added by this update. Summary of changes: .../src/main/java/org/apache/geode/session/tests/ServerContainer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
[geode] branch develop updated (09d4d70 -> 1a1d221)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a change to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git. from 09d4d70 GEODE-7185: Partial revert of a7e0b2edefc6f52315ce92ea3b8cd29d5be3fd1c. (#4062) add 1a1d221 GEODE-7202 Add null check before closing GatewayReceiverServers (#4051) No new revisions were added by this update. Summary of changes: .../internal/cache/GemfireCacheImplDUnitTest.java | 26 +- .../geode/internal/cache/GemFireCacheImpl.java | 16 - 2 files changed, 31 insertions(+), 11 deletions(-) copy geode-dunit/src/distributedTest/java/org/apache/geode/test/dunit/rules/tests/DistributedRuleDistributedTest.java => geode-core/src/distributedTest/java/org/apache/geode/internal/cache/GemfireCacheImplDUnitTest.java (62%)
[geode] branch develop updated (4068903 -> 3d9627f)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a change to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git. from 4068903 GEODE-7191: Duplicated info about JVM GC parameters (#4042) add 3d9627f GEODE-7149: Changes to support AsyncEventQueue's dispatcher status with AsyncEventQueue beans (#4029) No new revisions were added by this update. Summary of changes: .../geode/management/AsyncEventQueueMXBean.java| 8 + .../internal/beans/AsyncEventQueueMBean.java | 5 + .../internal/beans/AsyncEventQueueMBeanBridge.java | 4 + .../AsyncEventQueueMBeanTest.java} | 37 +- .../geode/management/AEQManagementDUnitTest.java | 415 + 5 files changed, 453 insertions(+), 16 deletions(-) copy geode-core/src/test/java/org/apache/geode/management/internal/{cli/util/ExportLogsCacheWriterTest.java => beans/AsyncEventQueueMBeanTest.java} (50%) create mode 100644 geode-wan/src/distributedTest/java/org/apache/geode/management/AEQManagementDUnitTest.java
[geode] branch develop updated (a9ce0eb -> 0b2f2c2)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a change to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git. from a9ce0eb GEODE-6918: Rename CacheCreationTest add 0b2f2c2 GEODE-6798: Refactor client function execution (#3745) No new revisions were added by this update. Summary of changes: .../execute/FunctionOnServersRetryDUnitTest.java | 20 +- .../cache/execute/FunctionRetryTestBase.java | 2 +- .../cache/client/internal/ExecuteFunctionOp.java | 249 +++-- .../client/internal/ExecuteRegionFunctionOp.java | 78 ++- .../internal/ExecuteRegionFunctionSingleHopOp.java | 99 ++-- .../cache/client/internal/ServerRegionProxy.java | 145 +--- .../cache/execute/ServerFunctionExecutor.java | 57 - .../internal/ExecuteFunctionOpRetryTest.java | 174 -- .../internal/ExecuteRegionFunctionOpRetryTest.java | 40 ++-- .../ExecuteRegionFunctionSingleHopOpRetryTest.java | 31 ++- 10 files changed, 339 insertions(+), 556 deletions(-)
[geode] branch develop updated (487d7ca -> 5b6bcbf)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a change to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git. from 487d7ca GEODE-6783: Remove Thread.sleep() from GatewayReceiverMetricsTest @before method add 5b6bcbf GEODE-6677: Eliminate Infinite Function Retry (#3690) No new revisions were added by this update. Summary of changes: .../execute/FunctionOnRegionRetryDUnitTest.java| 126 +++ .../execute/FunctionOnServerRetryDUnitTest.java| 115 ++ .../execute/FunctionOnServersRetryDUnitTest.java | 115 ++ .../cache/execute/FunctionRetryTestBase.java | 386 .../cache/client/internal/ExecuteFunctionOp.java | 174 - .../client/internal/ExecuteRegionFunctionOp.java | 159 .../internal/ExecuteRegionFunctionSingleHopOp.java | 57 ++- .../geode/cache/client/internal/GetAllOp.java | 5 +- .../geode/cache/client/internal/PutAllOp.java | 5 +- .../geode/cache/client/internal/RemoveAllOp.java | 5 +- .../client/internal/SingleHopClientExecutor.java | 47 ++- .../internal/ExecuteFunctionOpRetryTest.java | 334 + .../internal/ExecuteFunctionTestSupport.java | 209 +++ .../internal/ExecuteRegionFunctionOpRetryTest.java | 405 + .../internal/ExecuteRegionFunctionOpTest.java | 7 + .../ExecuteRegionFunctionSingleHopOpRetryTest.java | 219 +++ 16 files changed, 2115 insertions(+), 253 deletions(-) create mode 100644 geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/FunctionOnRegionRetryDUnitTest.java create mode 100644 geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/FunctionOnServerRetryDUnitTest.java create mode 100644 geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/FunctionOnServersRetryDUnitTest.java create mode 100644 geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/FunctionRetryTestBase.java create mode 100644 geode-core/src/test/java/org/apache/geode/cache/client/internal/ExecuteFunctionOpRetryTest.java create mode 100644 geode-core/src/test/java/org/apache/geode/cache/client/internal/ExecuteFunctionTestSupport.java create mode 100644 geode-core/src/test/java/org/apache/geode/cache/client/internal/ExecuteRegionFunctionOpRetryTest.java create mode 100644 geode-core/src/test/java/org/apache/geode/cache/client/internal/ExecuteRegionFunctionSingleHopOpRetryTest.java
[geode] branch develop updated: GEODE-6665: Avoid creating regions on Locator (#3480)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new cee84bb GEODE-6665: Avoid creating regions on Locator (#3480) cee84bb is described below commit cee84bbc53c707b2ca13ca664fb3087fec1c71ed Author: agingade AuthorDate: Thu Apr 18 10:58:06 2019 -0700 GEODE-6665: Avoid creating regions on Locator (#3480) * GEODE-6665: Avoid creating regions on Locator --- .../modules/util/BootstrappingFunctionTest.java| 129 + .../geode/modules/util/BootstrappingFunction.java | 18 ++- 2 files changed, 143 insertions(+), 4 deletions(-) diff --git a/extensions/geode-modules/src/integrationTest/java/org/apache/geode/modules/util/BootstrappingFunctionTest.java b/extensions/geode-modules/src/integrationTest/java/org/apache/geode/modules/util/BootstrappingFunctionTest.java new file mode 100644 index 000..5a48cd5 --- /dev/null +++ b/extensions/geode-modules/src/integrationTest/java/org/apache/geode/modules/util/BootstrappingFunctionTest.java @@ -0,0 +1,129 @@ +/* + * 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 org.apache.geode.modules.util; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import org.apache.geode.cache.execute.FunctionContext; +import org.apache.geode.cache.execute.ResultSender; +import org.apache.geode.distributed.internal.ClusterDistributionManager; +import org.apache.geode.distributed.internal.DistributionManager; +import org.apache.geode.distributed.internal.InternalDistributedSystem; +import org.apache.geode.distributed.internal.membership.InternalDistributedMember; +import org.apache.geode.internal.cache.GemFireCacheImpl; +import org.apache.geode.test.junit.categories.SecurityTest; + +@Category({SecurityTest.class}) +public class BootstrappingFunctionTest { + + @Test + public void isLocatorReturnsTrueForLocatorMember() { +BootstrappingFunction bootstrappingFunction = new BootstrappingFunction(); +GemFireCacheImpl gemFireCacheImpl = mock(GemFireCacheImpl.class); +InternalDistributedSystem distributedSystem = mock(InternalDistributedSystem.class); +InternalDistributedMember internalDistributedMember = mock(InternalDistributedMember.class); +DistributionManager distributionManager = mock(DistributionManager.class); + + when(gemFireCacheImpl.getDistributedSystem()).thenReturn(distributedSystem); + when(distributedSystem.getDistributionManager()).thenReturn(distributionManager); + when(distributedSystem.getDistributedMember()).thenReturn(internalDistributedMember); +when(internalDistributedMember.getVmKind()) +.thenReturn(ClusterDistributionManager.LOCATOR_DM_TYPE); + +assertThat(bootstrappingFunction.isLocator(gemFireCacheImpl)).isTrue(); + } + + @Test + public void isLocatorReturnsFalseForNonLocatorMember() { +BootstrappingFunction bootstrappingFunction = new BootstrappingFunction(); +GemFireCacheImpl gemFireCacheImpl = mock(GemFireCacheImpl.class); +InternalDistributedSystem distributedSystem = mock(InternalDistributedSystem.class); +InternalDistributedMember internalDistributedMember = mock(InternalDistributedMember.class); +DistributionManager distributionManager = mock(DistributionManager.class); + + when(gemFireCacheImpl.getDistributedSystem()).thenReturn(distributedSystem); + when(distributedSystem.getDistributionManager()).thenReturn(distributionManager); + when(distributedSystem.getDistributedMember()).thenReturn(internalDistributedMember); +when(internalDistributedMember.getVmKind()) +.thenReturn(ClusterDistributionManager.NORMAL_DM_TYPE
[geode] branch develop updated: GEODE-6152: Removed use of futures (optimized get) for proxy region. (#3371)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new 045bb67 GEODE-6152: Removed use of futures (optimized get) for proxy region. (#3371) 045bb67 is described below commit 045bb67c7e480bc21a9904c940cc43680a38356b Author: agingade AuthorDate: Wed Apr 10 10:13:23 2019 -0700 GEODE-6152: Removed use of futures (optimized get) for proxy region. (#3371) * GEODE-6152: Removed use of futures (optimized get) for proxy region. --- .../cache/RegionConcurrentOperationDUnitTest.java | 145 ++ .../sockets/ClientRegionGetRegressionTest.java | 212 + .../apache/geode/internal/cache/LocalRegion.java | 118 +++- 3 files changed, 431 insertions(+), 44 deletions(-) diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/RegionConcurrentOperationDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/RegionConcurrentOperationDUnitTest.java new file mode 100755 index 000..d0ccd1d --- /dev/null +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/RegionConcurrentOperationDUnitTest.java @@ -0,0 +1,145 @@ +/* + * 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 org.apache.geode.internal.cache; + +import static org.apache.geode.cache.RegionShortcut.REPLICATE; +import static org.apache.geode.cache.RegionShortcut.REPLICATE_PROXY; +import static org.apache.geode.test.dunit.VM.getVM; +import static org.assertj.core.api.Assertions.assertThat; + +import java.io.Serializable; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; + +import org.junit.After; +import org.junit.Rule; +import org.junit.Test; + +import org.apache.geode.cache.CacheLoader; +import org.apache.geode.cache.DataPolicy; +import org.apache.geode.cache.LoaderHelper; +import org.apache.geode.cache.Region; +import org.apache.geode.cache.Scope; +import org.apache.geode.test.dunit.DUnitBlackboard; +import org.apache.geode.test.dunit.VM; +import org.apache.geode.test.dunit.rules.CacheRule; +import org.apache.geode.test.dunit.rules.DistributedRule; +import org.apache.geode.test.junit.rules.ExecutorServiceRule; + +public class RegionConcurrentOperationDUnitTest implements Serializable { + + private static DUnitBlackboard blackboard; + + Object key = "KEY"; + String value = "VALUE"; + + private static DUnitBlackboard getBlackboard() { +if (blackboard == null) { + blackboard = new DUnitBlackboard(); +} +return blackboard; + } + + @Rule + public DistributedRule distributedRule = new DistributedRule(); + + @Rule + public CacheRule cacheRule = new CacheRule(); + + @Rule + public ExecutorServiceRule executorServiceRule = new ExecutorServiceRule(); + + @After + public void tearDown() { +blackboard.initBlackboard(); + } + + @Test + public void getOnProxyRegionFromMultipleThreadsReturnsDifferentObjects() throws Exception { +VM member1 = getVM(0); +String regionName = getClass().getSimpleName(); + +cacheRule.createCache(); + cacheRule.getCache().createRegionFactory(REPLICATE_PROXY).create(regionName); + +member1.invoke(() -> { + cacheRule.createCache(); + cacheRule.getCache().createRegionFactory(REPLICATE) + .setCacheLoader(new TestCacheLoader()).create(regionName); +}); + +Future get1 = executorServiceRule.submit(() -> { + Region region = cacheRule.getCache().getRegion(regionName); + return region.get(key); +}); + +Future get2 = executorServiceRule.submit(() -> { + Region region = cacheRule.getCache().getRegion(regionName); + getBlackboard().waitForGate("Loader", 60, TimeUnit.SECONDS); + return region.get(key); +}); + +Object get1value = get1.get(); +Object get2value = get2.get(); + +assertThat(get1value).isNotSameAs(get2value); + } + + @Test + public void getOnPreLoadedRegionFromMultipleThreadsReturnSameObject() throws Exception { +VM member1 =
[geode] branch develop updated: GEODE-6526: Removing call to removeTombstone during entry destroy (#3348)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new 905e921 GEODE-6526: Removing call to removeTombstone during entry destroy (#3348) 905e921 is described below commit 905e921169f643e916f56ea391f6891cd1d3ca7c Author: agingade AuthorDate: Tue Mar 26 11:44:45 2019 -0700 GEODE-6526: Removing call to removeTombstone during entry destroy (#3348) * GEODE-6526: Removing call to removeTombstone during entry destroy During destroy entry (tombstone) under region entry lock, if the entry had a lower region version than the recorded gc version for that member, the entry was removed immediately which could result in dead-lock with tombstone gc thread. Instead of removing the entry during destroy, it was scheduled to remove during tombstone gc. --- .../cache/versions/TombstoneDUnitTest.java | 135 +++-- .../geode/internal/cache/InternalRegion.java | 2 + .../apache/geode/internal/cache/LocalRegion.java | 3 +- .../cache/entries/AbstractRegionEntry.java | 30 ++--- 4 files changed, 141 insertions(+), 29 deletions(-) diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/versions/TombstoneDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/versions/TombstoneDUnitTest.java index 5c8153c..cf4dcb6 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/versions/TombstoneDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/versions/TombstoneDUnitTest.java @@ -17,10 +17,21 @@ package org.apache.geode.internal.cache.versions; import static org.apache.geode.test.awaitility.GeodeAwaitility.await; import static org.junit.Assert.assertEquals; +import java.io.Serializable; +import java.util.Properties; +import java.util.concurrent.CountDownLatch; + import org.junit.Test; import org.apache.geode.cache.Region; import org.apache.geode.cache.RegionShortcut; +import org.apache.geode.distributed.internal.ClusterDistributionManager; +import org.apache.geode.distributed.internal.DistributionMessage; +import org.apache.geode.distributed.internal.DistributionMessageObserver; +import org.apache.geode.internal.cache.DestroyOperation; +import org.apache.geode.internal.cache.DistributedTombstoneOperation; +import org.apache.geode.internal.cache.LocalRegion; +import org.apache.geode.test.dunit.AsyncInvocation; import org.apache.geode.test.dunit.Host; import org.apache.geode.test.dunit.VM; import org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase; @@ -50,7 +61,7 @@ public class TombstoneDUnitTest extends JUnit4CacheTestCase { Region region = getCache().getRegion("TestRegion"); region.destroy("K1"); assertEquals(1, getGemfireCache().getCachePerfStats().getTombstoneCount()); - performGC(region); + performGC(); }); vm1.invoke(() -> { @@ -61,7 +72,7 @@ public class TombstoneDUnitTest extends JUnit4CacheTestCase { // Send tombstone gc message to vm0. Region region = getCache().getRegion("TestRegion"); region.destroy("K2"); - performGC(region); + performGC(); }); vm0.invoke(() -> { @@ -71,11 +82,118 @@ public class TombstoneDUnitTest extends JUnit4CacheTestCase { }); } + @Test + public void testTombstonesWithLowerVersionThanTheRecordedVersionGetsGCed() throws Exception { +Host host = Host.getHost(0); +VM vm0 = host.getVM(0); +VM vm1 = host.getVM(1); + +createCache(vm0); +createCache(vm1); + +vm0.invoke(() -> { + createRegion("TestRegion", true); + Region region = getCache().getRegion("TestRegion"); + region.put("K1", "V1"); + region.put("K2", "V2"); +}); + +vm1.invoke(() -> { + createRegion("TestRegion", false); + DistributionMessageObserver.setInstance(new RegionObserver()); +}); + +AsyncInvocation vm0Async1 = vm0.invokeAsync(() -> { + Region region = getCache().getRegion("TestRegion"); + region.destroy("K1"); +}); + +AsyncInvocation vm0Async2 = vm0.invokeAsync(() -> { + Region region = getCache().getRegion("TestRegion"); + region.destroy("K2"); +}); + +AsyncInvocation vm0Async3 = vm0.invokeAsync(() -> { + waitForTombstoneCount(2); + performGC(2); +}); + +vm1.invoke(() -> { + await().until(() -> getCache().getCachePerfStats().getTombstoneGCCount() == 1); +}); + +vm0Async1.join(); +vm0Async2.join(); +vm0Async3.join(); + +vm1.invoke(() -> { + Region region = getCache().getRegi
[geode] branch develop updated: GEODE-92: Fix deadlock issue from previous commit (#3061)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new 56529bf GEODE-92: Fix deadlock issue from previous commit (#3061) 56529bf is described below commit 56529bf406e44bc6f1147e3204670f11c9aed7f0 Author: agingade AuthorDate: Wed Jan 9 16:48:43 2019 -0800 GEODE-92: Fix deadlock issue from previous commit (#3061) The commit f4b0643 introduced deadlock between concurrent updates with custom expiry which invoked getValue() from the region entry. * The issue was fixed by making sure lruUpdateCallback is deferred/called at the higher/caller level (before synchronizing region entry). --- .../RegionEntryEvictionIntegrationTest.java| 74 -- .../internal/cache/map/AbstractRegionMapPut.java | 7 +- .../geode/internal/cache/map/FocusedRegionMap.java | 7 +- .../internal/cache/map/RegionMapCommitPut.java | 2 +- .../geode/internal/cache/map/RegionMapPut.java | 21 -- .../cache/map/AbstractRegionMapPutTest.java| 27 +++- .../geode/internal/cache/map/RegionMapPutTest.java | 38 ++- 7 files changed, 154 insertions(+), 22 deletions(-) diff --git a/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/eviction/RegionEntryEvictionIntegrationTest.java b/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/eviction/RegionEntryEvictionIntegrationTest.java index 476fd39..a0bc0f0 100644 --- a/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/eviction/RegionEntryEvictionIntegrationTest.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/eviction/RegionEntryEvictionIntegrationTest.java @@ -16,6 +16,13 @@ package org.apache.geode.internal.cache.eviction; import static org.assertj.core.api.Assertions.assertThat; +import java.util.ArrayList; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; + +import org.junit.After; import org.junit.Before; import org.junit.Rule; import org.junit.Test; @@ -24,25 +31,38 @@ import org.junit.rules.TestName; import org.apache.geode.cache.Cache; import org.apache.geode.cache.CacheFactory; +import org.apache.geode.cache.CustomExpiry; import org.apache.geode.cache.EvictionAttributes; +import org.apache.geode.cache.ExpirationAttributes; import org.apache.geode.cache.Region; import org.apache.geode.cache.RegionShortcut; import org.apache.geode.test.junit.categories.EvictionTest; @Category({EvictionTest.class}) public class RegionEntryEvictionIntegrationTest { + + private Cache cache; + private Region region; @Rule public TestName testName = new TestName(); @Before - public void setUp() throws Exception { -region = createRegion(); + public void setup() { +cache = new CacheFactory().set("locators", "").set("mcast-port", "0").create(); + } + + @After + public void cleaup() { +if (cache != null && !cache.isClosed()) { + cache.close(); +} } @Test public void verifyMostRecentEntryIsNotEvicted() { +region = createRegion(); region.create("one", "one"); region.create("twoo", "twoo"); region.put("one", "one"); @@ -53,11 +73,57 @@ public class RegionEntryEvictionIntegrationTest { assertThat(region.containsKey("threee")).isTrue(); } - private Region createRegion() throws Exception { -Cache cache = new CacheFactory().set("locators", "").set("mcast-port", "0").create(); + @Test + public void evictionWithCustomExpiryCallingGetValueDoesNotDeadLock() throws Exception { +int numThreads = 2; +int entries = 1000; +int evictionCount = 1; +region = createRegionWithCustomExpiration(evictionCount); + +ExecutorService executorService = Executors.newFixedThreadPool(numThreads); +ArrayList futures = new ArrayList<>(); + +for (int i = 0; i < numThreads; i++) { + futures.add(executorService.submit(() -> doCreates(region, entries))); +} + +for (int i = 0; i < numThreads; i++) { + int ops = (Integer) futures.get(i).get(2, TimeUnit.MINUTES); + assertThat(ops).isEqualTo(entries); +} + +executorService.shutdown(); + } + + private int doCreates(Region region, int entries) { +String key = Thread.currentThread().getName(); +for (int i = 1; i < entries; i++) { + region.create(key + i, "value " + i); +} +return entries; + } + + + private Region createRegion() { return cache.createRegionFactory(RegionShortcut.REPLICATE) .setEvictionAttributes(EvictionAttributes.crea
[geode] branch develop updated: GEODE-6032: Updated javadoc to clarify what is communicated with hasD… (#2953)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new 53b1433 GEODE-6032: Updated javadoc to clarify what is communicated with hasD… (#2953) 53b1433 is described below commit 53b1433079f98316c0e6cb3d911777efb7920dad Author: agingade AuthorDate: Mon Dec 10 16:52:51 2018 -0800 GEODE-6032: Updated javadoc to clarify what is communicated with hasD… (#2953) GEODE-6032: Updated javadoc to clarify what is communicated with hasDelta() --- geode-core/src/main/java/org/apache/geode/Delta.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/geode-core/src/main/java/org/apache/geode/Delta.java b/geode-core/src/main/java/org/apache/geode/Delta.java index eef59d8..6104a48 100755 --- a/geode-core/src/main/java/org/apache/geode/Delta.java +++ b/geode-core/src/main/java/org/apache/geode/Delta.java @@ -32,7 +32,8 @@ import java.io.IOException; public interface Delta { /** - * Returns true if this object has pending changes it can write out. + * Returns true if this object has pending changes it can write out as a delta. + * Returns false if this object must be transmitted in its entirety. */ boolean hasDelta();
[geode] branch develop updated: GEODE-6013: Use expected initial image requester's rvv information (#2857)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new b40303d GEODE-6013: Use expected initial image requester's rvv information (#2857) b40303d is described below commit b40303ddfdaa428321ed541805abb62d4c68c461 Author: agingade AuthorDate: Wed Nov 28 17:39:11 2018 -0800 GEODE-6013: Use expected initial image requester's rvv information (#2857) Re-submitting after fixing NPE from previous checkin. Made changes to use the expected initial image requester's rvv information instead of the image provider's local rvv while determining full or delta GII. There was logical error where it was using provider's local exception(rvv) instead of using requester's local exception(rvv). This could result in performing Delta GII instead of Full GII. --- .../cache/PersistentRegionRecoveryDUnitTest.java | 86 +++ .../internal/cache/InitialImageOperation.java | 1 - .../cache/versions/RegionVersionVector.java| 25 ++-- .../cache/versions/RegionVersionVectorTest.java| 161 + 4 files changed, 260 insertions(+), 13 deletions(-) diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PersistentRegionRecoveryDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PersistentRegionRecoveryDUnitTest.java index 670622f..01d3f4b 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PersistentRegionRecoveryDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PersistentRegionRecoveryDUnitTest.java @@ -29,6 +29,7 @@ import org.junit.Before; import org.junit.Rule; import org.junit.Test; +import org.apache.geode.cache.DiskStore; import org.apache.geode.cache.DiskStoreFactory; import org.apache.geode.cache.Region; import org.apache.geode.cache.RegionFactory; @@ -409,6 +410,91 @@ public class PersistentRegionRecoveryDUnitTest extends JUnit4DistributedTestCase }); } + @Test + public void testRecoveryFromBackupAndRequestingDeltaGiiDoesFullGiiIfTombstoneGCVersionDiffers() + throws Exception { +getBlackboard().initBlackboard(); +vm1.invoke(() -> cacheRule.createCache()); + +vm0.invoke(() -> createAsyncDiskRegion(true)); +vm0.invoke(() -> { + Region region = cacheRule.getCache().getRegion(regionName); + region.put("KEY-1", "VALUE-1"); + region.put("KEY-2", "VALUE-2"); + flushAsyncDiskRegion(); +}); + +vm1.invoke(() -> createAsyncDiskRegion(true)); +vm1.invoke(() -> { + Region region = cacheRule.getCache().getRegion(regionName); + region.put("KEY-1", "VALUE-1"); + region.put("KEY-2", "VALUE-2"); + region.put("KEY-1", "VALUE-3"); + region.put("KEY-2", "VALUE-4"); + flushAsyncDiskRegion(); +}); + +vm0.invoke(() -> { + Region region = cacheRule.getCache().getRegion(regionName); + region.destroy("KEY-1"); +}); + +vm0.bounceForcibly(); + +vm1.invoke(() -> flushAsyncDiskRegion()); + +vm1.invoke(() -> { + DistributionMessageObserver.setInstance( + new DistributionMessageObserver() { +@Override +public void beforeProcessMessage(ClusterDistributionManager dm, +DistributionMessage message) { + if (message instanceof InitialImageOperation.RequestImageMessage) { +InitialImageOperation.RequestImageMessage rim = +(InitialImageOperation.RequestImageMessage) message; +if (rim.regionPath.contains(regionName)) { + getBlackboard().signalGate("GotRegionIIRequest"); + await().until(() -> getBlackboard().isGateSignaled("TombstoneGCDone")); +} + } +} + }); +}); + +AsyncInvocation vm0createRegion = vm0.invokeAsync(() -> createAsyncDiskRegion(true)); + +vm1.invoke(() -> { + await().until(() -> getBlackboard().isGateSignaled("GotRegionIIRequest")); + cacheRule.getCache().getTombstoneService().forceBatchExpirationForTests(1); + flushAsyncDiskRegion(); + getBlackboard().signalGate("TombstoneGCDone"); +}); + +vm0createRegion.await(); + +vm1.invoke(() -> { + Region region = cacheRule.getCache().getRegion(regionName); + assertThat(region.get("KEY-1")).isEqualTo(null); + assertThat(region.get("KEY-2")).isEqualTo("VALUE-4"); +}); + +vm0.invoke(() -> { +
[geode] branch develop updated: Revert "GEODE-6013: Made changes to use the expected initial image requester's rvv information (#2819)"
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new 09dd194 Revert "GEODE-6013: Made changes to use the expected initial image requester's rvv information (#2819)" 09dd194 is described below commit 09dd194f5a423ea591c0f47d3114df46d23435e8 Author: Anil AuthorDate: Wed Nov 14 10:06:36 2018 -0800 Revert "GEODE-6013: Made changes to use the expected initial image requester's rvv information (#2819)" This reverts commit b4befb99626e85045379e5b6fb8804b9db2a3eb9. --- .../cache/PersistentRegionRecoveryDUnitTest.java | 86 - .../internal/cache/InitialImageOperation.java | 1 + .../cache/versions/RegionVersionVector.java| 27 ++-- .../cache/versions/RegionVersionVectorTest.java| 139 - 4 files changed, 14 insertions(+), 239 deletions(-) diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PersistentRegionRecoveryDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PersistentRegionRecoveryDUnitTest.java index 01d3f4b..670622f 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PersistentRegionRecoveryDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PersistentRegionRecoveryDUnitTest.java @@ -29,7 +29,6 @@ import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.apache.geode.cache.DiskStore; import org.apache.geode.cache.DiskStoreFactory; import org.apache.geode.cache.Region; import org.apache.geode.cache.RegionFactory; @@ -410,91 +409,6 @@ public class PersistentRegionRecoveryDUnitTest extends JUnit4DistributedTestCase }); } - @Test - public void testRecoveryFromBackupAndRequestingDeltaGiiDoesFullGiiIfTombstoneGCVersionDiffers() - throws Exception { -getBlackboard().initBlackboard(); -vm1.invoke(() -> cacheRule.createCache()); - -vm0.invoke(() -> createAsyncDiskRegion(true)); -vm0.invoke(() -> { - Region region = cacheRule.getCache().getRegion(regionName); - region.put("KEY-1", "VALUE-1"); - region.put("KEY-2", "VALUE-2"); - flushAsyncDiskRegion(); -}); - -vm1.invoke(() -> createAsyncDiskRegion(true)); -vm1.invoke(() -> { - Region region = cacheRule.getCache().getRegion(regionName); - region.put("KEY-1", "VALUE-1"); - region.put("KEY-2", "VALUE-2"); - region.put("KEY-1", "VALUE-3"); - region.put("KEY-2", "VALUE-4"); - flushAsyncDiskRegion(); -}); - -vm0.invoke(() -> { - Region region = cacheRule.getCache().getRegion(regionName); - region.destroy("KEY-1"); -}); - -vm0.bounceForcibly(); - -vm1.invoke(() -> flushAsyncDiskRegion()); - -vm1.invoke(() -> { - DistributionMessageObserver.setInstance( - new DistributionMessageObserver() { -@Override -public void beforeProcessMessage(ClusterDistributionManager dm, -DistributionMessage message) { - if (message instanceof InitialImageOperation.RequestImageMessage) { -InitialImageOperation.RequestImageMessage rim = -(InitialImageOperation.RequestImageMessage) message; -if (rim.regionPath.contains(regionName)) { - getBlackboard().signalGate("GotRegionIIRequest"); - await().until(() -> getBlackboard().isGateSignaled("TombstoneGCDone")); -} - } -} - }); -}); - -AsyncInvocation vm0createRegion = vm0.invokeAsync(() -> createAsyncDiskRegion(true)); - -vm1.invoke(() -> { - await().until(() -> getBlackboard().isGateSignaled("GotRegionIIRequest")); - cacheRule.getCache().getTombstoneService().forceBatchExpirationForTests(1); - flushAsyncDiskRegion(); - getBlackboard().signalGate("TombstoneGCDone"); -}); - -vm0createRegion.await(); - -vm1.invoke(() -> { - Region region = cacheRule.getCache().getRegion(regionName); - assertThat(region.get("KEY-1")).isEqualTo(null); - assertThat(region.get("KEY-2")).isEqualTo("VALUE-4"); -}); - -vm0.invoke(() -> { - Region region = cacheRule.getCache().getRegion(regionName); - assertThat(region.get("KEY-1")).isEqualTo(null); - assertThat(region.get("KEY-2")).isEqualTo("VALUE-4"); - - CachePerfStats stats = ((LocalRegion) region).getRegionPerfStats(); - assertThat(stats.getDelt
[geode] branch develop updated: GEODE-6013: Made changes to use the expected initial image requester's rvv information (#2819)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new b4befb9 GEODE-6013: Made changes to use the expected initial image requester's rvv information (#2819) b4befb9 is described below commit b4befb99626e85045379e5b6fb8804b9db2a3eb9 Author: agingade AuthorDate: Mon Nov 12 16:50:47 2018 -0800 GEODE-6013: Made changes to use the expected initial image requester's rvv information (#2819) * GEODE-6013: Made changes to use the expected initial image requester's rvv information instead of the image provider's local rvv while determining full or delta GII. There was logical error where it was using provider's local exception(rvv) instead of using requester's local exception(rvv). This could result in performing Delta GII instead of Full GII. --- .../cache/PersistentRegionRecoveryDUnitTest.java | 86 + .../internal/cache/InitialImageOperation.java | 1 - .../cache/versions/RegionVersionVector.java| 27 ++-- .../cache/versions/RegionVersionVectorTest.java| 139 + 4 files changed, 239 insertions(+), 14 deletions(-) diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PersistentRegionRecoveryDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PersistentRegionRecoveryDUnitTest.java index 670622f..01d3f4b 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PersistentRegionRecoveryDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PersistentRegionRecoveryDUnitTest.java @@ -29,6 +29,7 @@ import org.junit.Before; import org.junit.Rule; import org.junit.Test; +import org.apache.geode.cache.DiskStore; import org.apache.geode.cache.DiskStoreFactory; import org.apache.geode.cache.Region; import org.apache.geode.cache.RegionFactory; @@ -409,6 +410,91 @@ public class PersistentRegionRecoveryDUnitTest extends JUnit4DistributedTestCase }); } + @Test + public void testRecoveryFromBackupAndRequestingDeltaGiiDoesFullGiiIfTombstoneGCVersionDiffers() + throws Exception { +getBlackboard().initBlackboard(); +vm1.invoke(() -> cacheRule.createCache()); + +vm0.invoke(() -> createAsyncDiskRegion(true)); +vm0.invoke(() -> { + Region region = cacheRule.getCache().getRegion(regionName); + region.put("KEY-1", "VALUE-1"); + region.put("KEY-2", "VALUE-2"); + flushAsyncDiskRegion(); +}); + +vm1.invoke(() -> createAsyncDiskRegion(true)); +vm1.invoke(() -> { + Region region = cacheRule.getCache().getRegion(regionName); + region.put("KEY-1", "VALUE-1"); + region.put("KEY-2", "VALUE-2"); + region.put("KEY-1", "VALUE-3"); + region.put("KEY-2", "VALUE-4"); + flushAsyncDiskRegion(); +}); + +vm0.invoke(() -> { + Region region = cacheRule.getCache().getRegion(regionName); + region.destroy("KEY-1"); +}); + +vm0.bounceForcibly(); + +vm1.invoke(() -> flushAsyncDiskRegion()); + +vm1.invoke(() -> { + DistributionMessageObserver.setInstance( + new DistributionMessageObserver() { +@Override +public void beforeProcessMessage(ClusterDistributionManager dm, +DistributionMessage message) { + if (message instanceof InitialImageOperation.RequestImageMessage) { +InitialImageOperation.RequestImageMessage rim = +(InitialImageOperation.RequestImageMessage) message; +if (rim.regionPath.contains(regionName)) { + getBlackboard().signalGate("GotRegionIIRequest"); + await().until(() -> getBlackboard().isGateSignaled("TombstoneGCDone")); +} + } +} + }); +}); + +AsyncInvocation vm0createRegion = vm0.invokeAsync(() -> createAsyncDiskRegion(true)); + +vm1.invoke(() -> { + await().until(() -> getBlackboard().isGateSignaled("GotRegionIIRequest")); + cacheRule.getCache().getTombstoneService().forceBatchExpirationForTests(1); + flushAsyncDiskRegion(); + getBlackboard().signalGate("TombstoneGCDone"); +}); + +vm0createRegion.await(); + +vm1.invoke(() -> { + Region region = cacheRule.getCache().getRegion(regionName); + assertThat(region.get("KEY-1")).isEqualTo(null); + assertThat(region.get("KEY-2")).isEqualTo("VALUE-4"); +}); + +vm0.invoke(() -> { + Region region = cacheRule.getCache().ge
[geode] branch feature/GEODE-3869 deleted (was 2ccf8af)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a change to branch feature/GEODE-3869 in repository https://gitbox.apache.org/repos/asf/geode.git. was 2ccf8af Add test category. The revisions that were on this branch are still contained in other references; therefore, this change does not discard any commits from the repository.
[geode] branch feature/GEODE-3979 deleted (was 72dc8c6)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a change to branch feature/GEODE-3979 in repository https://gitbox.apache.org/repos/asf/geode.git. was 72dc8c6 GEODE-3979: fix flaky test The revisions that were on this branch are still contained in other references; therefore, this change does not discard any commits from the repository.
[geode] branch feature/GEODE-4033 deleted (was 1e7351a)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a change to branch feature/GEODE-4033 in repository https://gitbox.apache.org/repos/asf/geode.git. was 1e7351a GEODE-4033: Rewrite test to make it simpler The revisions that were on this branch are still contained in other references; therefore, this change does not discard any commits from the repository.
[geode] branch feature/GEODE-3978 deleted (was 087d548)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a change to branch feature/GEODE-3978 in repository https://gitbox.apache.org/repos/asf/geode.git. was 087d548 GEODE-3978: add wait with respect to region size The revisions that were on this branch are still contained in other references; therefore, this change does not discard any commits from the repository.
[geode] branch develop updated: GEODE-5828: Add dunit test reproducing the issue and incorporate review changes (#2584)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new 0e550cc GEODE-5828: Add dunit test reproducing the issue and incorporate review changes (#2584) 0e550cc is described below commit 0e550cce06dbf3c5d0dfddffa20a6bca743179a0 Author: agingade AuthorDate: Wed Oct 10 12:09:09 2018 -0700 GEODE-5828: Add dunit test reproducing the issue and incorporate review changes (#2584) This ticket is already closed by the checkin db8ba67 As part of this checkin dunit test is added reproduce the issue and verify the previous checking fixed the issue. Incorporate review comments missed in the previous checkin. --- ...ntServerTransactionFailoverDistributedTest.java | 124 - .../geode/internal/cache/TXCommitMessage.java | 2 +- 2 files changed, 124 insertions(+), 2 deletions(-) diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ClientServerTransactionFailoverDistributedTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ClientServerTransactionFailoverDistributedTest.java index 9f411f4..c8acb15 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ClientServerTransactionFailoverDistributedTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ClientServerTransactionFailoverDistributedTest.java @@ -14,8 +14,12 @@ */ package org.apache.geode.internal.cache; +import static java.util.concurrent.TimeUnit.SECONDS; import static org.apache.geode.test.dunit.VM.getHostName; import static org.apache.geode.test.dunit.VM.getVM; +import static org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase.getBlackboard; +import static org.assertj.core.api.Assertions.assertThat; +import static org.awaitility.Awaitility.await; import static org.junit.Assert.assertEquals; import java.io.Serializable; @@ -26,6 +30,7 @@ import org.junit.Before; import org.junit.Rule; import org.junit.Test; +import org.apache.geode.cache.CacheTransactionManager; import org.apache.geode.cache.PartitionAttributes; import org.apache.geode.cache.PartitionAttributesFactory; import org.apache.geode.cache.Region; @@ -38,11 +43,16 @@ import org.apache.geode.cache.client.PoolManager; import org.apache.geode.cache.client.internal.PoolImpl; import org.apache.geode.cache.server.CacheServer; import org.apache.geode.distributed.DistributedMember; +import org.apache.geode.distributed.internal.ClusterDistributionManager; +import org.apache.geode.distributed.internal.DistributionMessage; +import org.apache.geode.distributed.internal.DistributionMessageObserver; import org.apache.geode.distributed.internal.ServerLocation; +import org.apache.geode.distributed.internal.membership.InternalDistributedMember; import org.apache.geode.internal.cache.tier.sockets.CacheServerTestUtil; import org.apache.geode.internal.cache.tier.sockets.ClientHealthMonitor; import org.apache.geode.internal.cache.tier.sockets.ClientProxyMembershipID; import org.apache.geode.internal.logging.LogService; +import org.apache.geode.test.dunit.AsyncInvocation; import org.apache.geode.test.dunit.VM; import org.apache.geode.test.dunit.rules.CacheRule; import org.apache.geode.test.dunit.rules.ClientCacheRule; @@ -113,8 +123,13 @@ public class ClientServerTransactionFailoverDistributedTest implements Serializa } private int createServerRegion(int totalNumBuckets, boolean isAccessor) throws Exception { +return createServerRegion(totalNumBuckets, isAccessor, 0); + } + + private int createServerRegion(int totalNumBuckets, boolean isAccessor, int redundancy) + throws Exception { PartitionAttributesFactory factory = new PartitionAttributesFactory(); -factory.setTotalNumBuckets(totalNumBuckets); +factory.setTotalNumBuckets(totalNumBuckets).setRedundantCopies(redundancy); if (isAccessor) { factory.setLocalMaxMemory(0); } @@ -338,4 +353,111 @@ public class ClientServerTransactionFailoverDistributedTest implements Serializa Thread.sleep(1000); } } + + @Test + public void txCommitGetsAppliedOnAllTheReplicasAfterHostIsShutDownAndIfOneOfTheNodeHasCommitted() + throws Exception { +getBlackboard().initBlackboard(); +VM client = server4; + +port1 = server1.invoke(() -> createServerRegion(1, false, 2)); + +server1.invoke(() -> { + Region region = cacheRule.getCache().getRegion(regionName); + region.put("Key-1", "Value-1"); + region.put("Key-2", "Value-2"); +}); + +port2 = server2.invoke(() -> createServerRegion(1, false, 2)); + +server3.invoke(() -> createServerRegion(1, false, 2)); + +client.invoke(() -> createC
[geode] branch develop updated: GEODE-5605: After removeAll/PutAll messages are processed on replicas, check for cache close is done. (#2481)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new a6ebaa0 GEODE-5605: After removeAll/PutAll messages are processed on replicas, check for cache close is done. (#2481) a6ebaa0 is described below commit a6ebaa0053e3f21236ba0cd16f8f0984b1d86907 Author: agingade AuthorDate: Mon Sep 17 10:53:34 2018 -0700 GEODE-5605: After removeAll/PutAll messages are processed on replicas, check for cache close is done. (#2481) --- .../geode/internal/cache/DistributedRegion.java| 4 ++ .../cache/partitioned/PutAllPRMessage.java | 28 - .../cache/partitioned/RemoveAllPRMessage.java | 28 - .../cache/partitioned/PutAllPRMessageTest.java | 49 ++ .../cache/partitioned/RemoveAllPRMessageTest.java | 28 + 5 files changed, 115 insertions(+), 22 deletions(-) diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedRegion.java b/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedRegion.java index d9f5903..42dcd98 100755 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedRegion.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedRegion.java @@ -2477,6 +2477,10 @@ public class DistributedRegion extends LocalRegion implements InternalDistribute this.getFullPath()), ex); } } +waitForCurrentOperations(); + } + + protected void waitForCurrentOperations() { // Fix for #48066 - make sure that region operations are completely // distributed to peers before destroying the region. Boolean flushOnClose = diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PutAllPRMessage.java b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PutAllPRMessage.java index b6450b3..a56ea79 100755 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PutAllPRMessage.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PutAllPRMessage.java @@ -507,17 +507,7 @@ public class PutAllPRMessage extends PartitionMessageWithDirectReply { // encounter cacheWriter exception partialKeys.saveFailedKey(key, cwe); } finally { -try { - // Only PutAllPRMessage knows if the thread id is fake. Event has no idea. - // So we have to manually set useFakeEventId for this DPAO - dpao.setUseFakeEventId(true); - r.checkReadiness(); - bucketRegion.getDataView().postPutAll(dpao, this.versions, bucketRegion); -} finally { - if (lockedForPrimary) { -bucketRegion.doUnlockForPrimary(); - } -} +doPostPutAll(r, dpao, bucketRegion, lockedForPrimary); } if (partialKeys.hasFailure()) { partialKeys.addKeysAndVersions(this.versions); @@ -559,6 +549,22 @@ public class PutAllPRMessage extends PartitionMessageWithDirectReply { return true; } + void doPostPutAll(PartitionedRegion r, DistributedPutAllOperation dpao, + BucketRegion bucketRegion, boolean lockedForPrimary) { +try { + // Only PutAllPRMessage knows if the thread id is fake. Event has no idea. + // So we have to manually set useFakeEventId for this DPAO + dpao.setUseFakeEventId(true); + r.checkReadiness(); + bucketRegion.getDataView().postPutAll(dpao, this.versions, bucketRegion); + r.checkReadiness(); +} finally { + if (lockedForPrimary) { +bucketRegion.doUnlockForPrimary(); + } +} + } + public VersionedObjectList getVersions() { return this.versions; } diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/RemoveAllPRMessage.java b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/RemoveAllPRMessage.java index d9f1f47..bfc009d 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/RemoveAllPRMessage.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/RemoveAllPRMessage.java @@ -516,17 +516,7 @@ public class RemoveAllPRMessage extends PartitionMessageWithDirectReply { // encounter cacheWriter exception partialKeys.saveFailedKey(key, cwe); } finally { -try { - // Only RemoveAllPRMessage knows if the thread id is fake. Event has no idea. - // So we have to manually set useFakeEventId for this op - op.setUseFakeEventId(true); - r.checkReadiness(); - bucketRegion.getDataView().postRemoveAll(op, this.versions, bucketRegion); -} finally { - if (lockedForPrimary
[geode] branch develop updated: Revert "GEODE-5605: After removeAll/PutAll messages are processed on replicas, check for cache close is done. (#2450)"
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new 61a3d7d Revert "GEODE-5605: After removeAll/PutAll messages are processed on replicas, check for cache close is done. (#2450)" 61a3d7d is described below commit 61a3d7ddbd75786101897fc4ff6a355bca9b2f74 Author: Anil AuthorDate: Fri Sep 14 12:20:51 2018 -0700 Revert "GEODE-5605: After removeAll/PutAll messages are processed on replicas, check for cache close is done. (#2450)" This reverts commit d9bb24d95bd7d310ae0ce693fe1d84774c2f521c. --- .../geode/internal/cache/DistributedRegion.java| 4 -- .../geode/internal/cache/PartitionedRegion.java| 12 -- .../cache/partitioned/PutAllPRMessage.java | 28 + .../cache/partitioned/RemoveAllPRMessage.java | 28 + .../internal/cache/PartitionedRegionTest.java | 45 .../cache/partitioned/PutAllPRMessageTest.java | 49 -- .../cache/partitioned/RemoveAllPRMessageTest.java | 28 - 7 files changed, 22 insertions(+), 172 deletions(-) diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedRegion.java b/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedRegion.java index 42dcd98..d9f5903 100755 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedRegion.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedRegion.java @@ -2477,10 +2477,6 @@ public class DistributedRegion extends LocalRegion implements InternalDistribute this.getFullPath()), ex); } } -waitForCurrentOperations(); - } - - protected void waitForCurrentOperations() { // Fix for #48066 - make sure that region operations are completely // distributed to peers before destroying the region. Boolean flushOnClose = diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java index 61829b8..86b35dc 100755 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java @@ -5307,18 +5307,6 @@ public class PartitionedRegion extends LocalRegion retryTime = new RetryTimeKeeper(this.retryTimeout); } currentTarget = getOrCreateNodeForBucketWrite(bucketId, retryTime); - } catch (EntryNotFoundException entryNotFoundException) { -if (!event.isPossibleDuplicate()) { - throw entryNotFoundException; -} -// EntryNotFoundException during retry attempt. The operation -// may have been applied during the initial attempt. -if (logger.isDebugEnabled()) { - logger.debug( - "EntryNotFoundException is ignored during retry attempt for destroy operation. " - + event); -} -return; } // If we get here, the attempt failed. diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PutAllPRMessage.java b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PutAllPRMessage.java index a56ea79..b6450b3 100755 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PutAllPRMessage.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PutAllPRMessage.java @@ -507,7 +507,17 @@ public class PutAllPRMessage extends PartitionMessageWithDirectReply { // encounter cacheWriter exception partialKeys.saveFailedKey(key, cwe); } finally { -doPostPutAll(r, dpao, bucketRegion, lockedForPrimary); +try { + // Only PutAllPRMessage knows if the thread id is fake. Event has no idea. + // So we have to manually set useFakeEventId for this DPAO + dpao.setUseFakeEventId(true); + r.checkReadiness(); + bucketRegion.getDataView().postPutAll(dpao, this.versions, bucketRegion); +} finally { + if (lockedForPrimary) { +bucketRegion.doUnlockForPrimary(); + } +} } if (partialKeys.hasFailure()) { partialKeys.addKeysAndVersions(this.versions); @@ -549,22 +559,6 @@ public class PutAllPRMessage extends PartitionMessageWithDirectReply { return true; } - void doPostPutAll(PartitionedRegion r, DistributedPutAllOperation dpao, - BucketRegion bucketRegion, boolean lockedForPrimary) { -try { - // Only PutAllPRMessage knows if the thread id is fake. Event has no idea. - // So we have to manually set useFakeEventId for this DPAO
[geode] branch develop updated: GEODE-5605: After removeAll/PutAll messages are processed on replicas, check for cache close is done. (#2450)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new d9bb24d GEODE-5605: After removeAll/PutAll messages are processed on replicas, check for cache close is done. (#2450) d9bb24d is described below commit d9bb24d95bd7d310ae0ce693fe1d84774c2f521c Author: agingade AuthorDate: Wed Sep 12 11:47:57 2018 -0700 GEODE-5605: After removeAll/PutAll messages are processed on replicas, check for cache close is done. (#2450) GEODE-5605: After removeAll/PutAll messages are processed on replicas, check for cache close is done. --- .../geode/internal/cache/DistributedRegion.java| 4 ++ .../geode/internal/cache/PartitionedRegion.java| 12 ++ .../cache/partitioned/PutAllPRMessage.java | 28 - .../cache/partitioned/RemoveAllPRMessage.java | 28 - .../internal/cache/PartitionedRegionTest.java | 45 .../cache/partitioned/PutAllPRMessageTest.java | 49 ++ .../cache/partitioned/RemoveAllPRMessageTest.java | 28 + 7 files changed, 172 insertions(+), 22 deletions(-) diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedRegion.java b/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedRegion.java index d9f5903..42dcd98 100755 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedRegion.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedRegion.java @@ -2477,6 +2477,10 @@ public class DistributedRegion extends LocalRegion implements InternalDistribute this.getFullPath()), ex); } } +waitForCurrentOperations(); + } + + protected void waitForCurrentOperations() { // Fix for #48066 - make sure that region operations are completely // distributed to peers before destroying the region. Boolean flushOnClose = diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java index 86b35dc..61829b8 100755 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java @@ -5307,6 +5307,18 @@ public class PartitionedRegion extends LocalRegion retryTime = new RetryTimeKeeper(this.retryTimeout); } currentTarget = getOrCreateNodeForBucketWrite(bucketId, retryTime); + } catch (EntryNotFoundException entryNotFoundException) { +if (!event.isPossibleDuplicate()) { + throw entryNotFoundException; +} +// EntryNotFoundException during retry attempt. The operation +// may have been applied during the initial attempt. +if (logger.isDebugEnabled()) { + logger.debug( + "EntryNotFoundException is ignored during retry attempt for destroy operation. " + + event); +} +return; } // If we get here, the attempt failed. diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PutAllPRMessage.java b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PutAllPRMessage.java index b6450b3..a56ea79 100755 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PutAllPRMessage.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PutAllPRMessage.java @@ -507,17 +507,7 @@ public class PutAllPRMessage extends PartitionMessageWithDirectReply { // encounter cacheWriter exception partialKeys.saveFailedKey(key, cwe); } finally { -try { - // Only PutAllPRMessage knows if the thread id is fake. Event has no idea. - // So we have to manually set useFakeEventId for this DPAO - dpao.setUseFakeEventId(true); - r.checkReadiness(); - bucketRegion.getDataView().postPutAll(dpao, this.versions, bucketRegion); -} finally { - if (lockedForPrimary) { -bucketRegion.doUnlockForPrimary(); - } -} +doPostPutAll(r, dpao, bucketRegion, lockedForPrimary); } if (partialKeys.hasFailure()) { partialKeys.addKeysAndVersions(this.versions); @@ -559,6 +549,22 @@ public class PutAllPRMessage extends PartitionMessageWithDirectReply { return true; } + void doPostPutAll(PartitionedRegion r, DistributedPutAllOperation dpao, + BucketRegion bucketRegion, boolean lockedForPrimary) { +try { + // Only PutAllPRMessage knows if the thread id is fake. Event has no idea. + // So we have to manually set useFakeEventId for
[geode] branch develop updated: GEODE-5513: Changes to build register interest initial snapshot from primary bucket (#2246)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new 4abb1d0 GEODE-5513: Changes to build register interest initial snapshot from primary bucket (#2246) 4abb1d0 is described below commit 4abb1d024977fa62bb617facd40bc899f9ebf1bc Author: agingade AuthorDate: Thu Aug 2 13:31:28 2018 -0700 GEODE-5513: Changes to build register interest initial snapshot from primary bucket (#2246) * Changes to build register interest initial snapshot from primary bucket --- .../geode/internal/cache/PartitionedRegion.java| 22 ++- .../internal/cache/PartitionedRegionTest.java | 178 + 2 files changed, 195 insertions(+), 5 deletions(-) diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java index da3fcad..77175a3 100755 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java @@ -3364,7 +3364,7 @@ public class PartitionedRegion extends LocalRegion } allowRetry = false; } else { -targetNode = getNodeForBucketReadOrLoad(bucketId); +targetNode = getBucketNodeForReadOrWrite(bucketId, clientEvent); allowRetry = true; } if (targetNode == null) { @@ -3382,6 +3382,18 @@ public class PartitionedRegion extends LocalRegion return obj; } + InternalDistributedMember getBucketNodeForReadOrWrite(int bucketId, + EntryEventImpl clientEvent) { +InternalDistributedMember targetNode; +if (clientEvent != null && clientEvent.getOperation() != null +&& clientEvent.getOperation().isGetForRegisterInterest()) { + targetNode = getNodeForBucketWrite(bucketId, null); +} else { + targetNode = getNodeForBucketReadOrLoad(bucketId); +} +return targetNode; + } + /** * Execute the provided named function in all locations that contain the given keys. So function * can be executed on just one fabric node, executed in parallel on a subset of nodes in parallel @@ -4434,11 +4446,11 @@ public class PartitionedRegion extends LocalRegion } } - private void updateNodeToBucketMap( + void updateNodeToBucketMap( HashMap> nodeToBuckets, HashMap bucketKeys) { for (int id : bucketKeys.keySet()) { - InternalDistributedMember node = getOrCreateNodeForBucketRead(id); + InternalDistributedMember node = getOrCreateNodeForBucketWrite(id, null); if (nodeToBuckets.containsKey(node)) { nodeToBuckets.get(node).put(id, bucketKeys.get(id)); } else { @@ -4594,10 +4606,10 @@ public class PartitionedRegion extends LocalRegion } } - private void updateNodeToBucketMap( + void updateNodeToBucketMap( HashMap> nodeToBuckets, Set buckets) { for (int id : buckets) { - InternalDistributedMember node = getOrCreateNodeForBucketRead(id); + InternalDistributedMember node = getOrCreateNodeForBucketWrite(id, null); if (nodeToBuckets.containsKey(node)) { nodeToBuckets.get(node).add(id); } else { diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionTest.java new file mode 100644 index 000..2e1db35 --- /dev/null +++ b/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionTest.java @@ -0,0 +1,178 @@ +/* + * 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 org.apache.geode.internal.cache; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyInt; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.ArgumentMatchers.isNull; +import static org.mockito.Mockito.RETURNS_DEEP_STUBS; +import static org.mockito.Mockito.doRetur
[geode] branch develop updated (112cd71 -> 3827332)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a change to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git. from 112cd71 GEODE-4858 refactor jdbc describe & list commands to use result model (#1939) add 3827332 GEODE-5184 Add unit tests for PersistenceInitialImageAdvisor (#1934) No new revisions were added by this update. Summary of changes: .../PersistenceInitialImageAdvisorTest.java| 265 ++--- 1 file changed, 237 insertions(+), 28 deletions(-) -- To stop receiving notification emails like this one, please contact aging...@apache.org.
[geode] branch develop updated: Revert "GEODE-5057: Removed experimental tag from Jdbc connector code base (#1789)" (#1936)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new e941250 Revert "GEODE-5057: Removed experimental tag from Jdbc connector code base (#1789)" (#1936) e941250 is described below commit e9412509e8a94ed17f5e510f8c7986f540638d9e Author: agingade AuthorDate: Wed May 9 10:33:37 2018 -0700 Revert "GEODE-5057: Removed experimental tag from Jdbc connector code base (#1789)" (#1936) This reverts commit 4e249f7c2f834a056a85b14de8728bce60d73e27. --- .../org/apache/geode/connectors/jdbc/JdbcAsyncWriter.java| 6 +++--- .../apache/geode/connectors/jdbc/JdbcConnectorException.java | 8 .../java/org/apache/geode/connectors/jdbc/JdbcLoader.java| 3 ++- .../java/org/apache/geode/connectors/jdbc/JdbcWriter.java| 3 ++- .../geode/connectors/jdbc/internal/AbstractJdbcCallback.java | 3 ++- .../jdbc/internal/ConnectionConfigExistsException.java | 3 +++ .../jdbc/internal/ConnectionConfigNotFoundException.java | 3 +++ .../geode/connectors/jdbc/internal/JdbcConnectorService.java | 3 ++- .../connectors/jdbc/internal/JdbcConnectorServiceImpl.java | 3 ++- .../jdbc/internal/RegionMappingExistsException.java | 3 +++ .../jdbc/internal/RegionMappingNotFoundException.java| 3 +++ .../apache/geode/connectors/jdbc/internal/SqlHandler.java| 3 ++- .../connectors/jdbc/internal/SqlToPdxInstanceCreator.java| 3 ++- .../connectors/jdbc/internal/cli/AlterConnectionCommand.java | 6 -- .../jdbc/internal/cli/AlterConnectionFunction.java | 4 ++-- .../connectors/jdbc/internal/cli/AlterMappingCommand.java| 7 +-- .../connectors/jdbc/internal/cli/AlterMappingFunction.java | 3 ++- .../jdbc/internal/cli/CreateConnectionCommand.java | 9 +++-- .../connectors/jdbc/internal/cli/CreateMappingCommand.java | 6 -- .../connectors/jdbc/internal/cli/CreateMappingFunction.java | 2 ++ .../jdbc/internal/cli/DescribeConnectionCommand.java | 9 +++-- .../connectors/jdbc/internal/cli/DescribeMappingCommand.java | 8 ++-- .../jdbc/internal/cli/DestroyConnectionCommand.java | 7 +-- .../jdbc/internal/cli/DestroyConnectionFunction.java | 3 ++- .../connectors/jdbc/internal/cli/DestroyMappingCommand.java | 6 -- .../connectors/jdbc/internal/cli/DestroyMappingFunction.java | 3 +++ .../connectors/jdbc/internal/cli/ListConnectionCommand.java | 11 +++ .../connectors/jdbc/internal/cli/ListMappingCommand.java | 10 ++ .../jdbc/internal/configuration/ConnectorService.java| 2 ++ .../connectors/jdbc/JdbcAsyncWriterIntegrationTest.java | 11 ++- .../geode/connectors/jdbc/JdbcConnectorExceptionTest.java| 2 +- .../geode/connectors/jdbc/internal/SqlHandlerTest.java | 1 + .../jdbc/internal/cli/AlterConnectionCommandDUnitTest.java | 12 +--- .../jdbc/internal/cli/AlterConnectionFunctionTest.java | 10 +- .../jdbc/internal/cli/AlterMappingFunctionTest.java | 10 +- .../internal/cli/CreateConnectionCommandIntegrationTest.java | 1 + .../internal/cli/DescribeConnectionCommandDUnitTest.java | 3 ++- .../jdbc/internal/cli/DescribeMappingCommandDUnitTest.java | 3 ++- .../jdbc/internal/cli/ListConnectionCommandTest.java | 4 ++-- .../connectors/jdbc/internal/cli/ListMappingCommandTest.java | 4 ++-- 40 files changed, 117 insertions(+), 87 deletions(-) diff --git a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/JdbcAsyncWriter.java b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/JdbcAsyncWriter.java index 169e65d..e36469d 100644 --- a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/JdbcAsyncWriter.java +++ b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/JdbcAsyncWriter.java @@ -21,6 +21,7 @@ import java.util.concurrent.atomic.LongAdder; import org.apache.logging.log4j.Logger; import org.apache.geode.CopyHelper; +import org.apache.geode.annotations.Experimental; import org.apache.geode.cache.asyncqueue.AsyncEvent; import org.apache.geode.cache.asyncqueue.AsyncEventListener; import org.apache.geode.connectors.jdbc.internal.AbstractJdbcCallback; @@ -30,12 +31,11 @@ import org.apache.geode.internal.logging.LogService; import org.apache.geode.pdx.PdxInstance; /** - * This class provides write behind cache semantics for a JDBC data source using - * AsyncEventListener. + * This class provides write behind cache semantics for a JDBC data source using AsyncEventListener. * * @since Geode 1.4 */ - +@Experimental public class JdbcAsyncWriter extends AbstractJdbcCallback implements AsyncEventListener { private static final Logger logger = LogService.getLogger(); diff --git
[geode] branch develop updated: GEODE-5111: Set offline members to null only when done waiting for them (#1873)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new 1f77a60 GEODE-5111: Set offline members to null only when done waiting for them (#1873) 1f77a60 is described below commit 1f77a603e5766ed14e980c2ca52902219c2bdab0 Author: Dale Emery AuthorDate: Tue May 1 09:55:01 2018 -0700 GEODE-5111: Set offline members to null only when done waiting for them (#1873) * GEODE-5111: Set offline members to null only when done waiting for them --- .../internal/cache/BucketPersistenceAdvisor.java | 57 +- .../internal/cache/CacheDistributionAdvisor.java | 2 +- .../persistence/InternalPersistenceAdvisor.java| 44 + .../persistence/MembershipChangeListener.java | 127 +++ .../cache/persistence/PersistenceAdvisor.java | 11 +- .../cache/persistence/PersistenceAdvisorImpl.java | 949 - .../PersistenceInitialImageAdvisor.java| 229 + .../geode/internal/lang/SystemPropertyHelper.java | 4 + .../PersistenceInitialImageAdvisorTest.java| 120 +++ 9 files changed, 932 insertions(+), 611 deletions(-) diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/BucketPersistenceAdvisor.java b/geode-core/src/main/java/org/apache/geode/internal/cache/BucketPersistenceAdvisor.java index e3602d2..00b53f2 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/BucketPersistenceAdvisor.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/BucketPersistenceAdvisor.java @@ -31,6 +31,7 @@ import org.apache.geode.distributed.internal.ReplyException; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; import org.apache.geode.internal.cache.PartitionedRegion.BucketLock; import org.apache.geode.internal.cache.partitioned.RedundancyAlreadyMetException; +import org.apache.geode.internal.cache.persistence.MembershipChangeListener; import org.apache.geode.internal.cache.persistence.PersistenceAdvisorImpl; import org.apache.geode.internal.cache.persistence.PersistentMemberID; import org.apache.geode.internal.cache.persistence.PersistentMemberManager; @@ -74,7 +75,7 @@ public class BucketPersistenceAdvisor extends PersistenceAdvisorImpl { public void recoveryDone(RuntimeException e) { this.recovering = false; if (!getPersistedMembers().isEmpty()) { - ((BucketAdvisor) advisor).setHadPrimary(); + ((BucketAdvisor) cacheDistributionAdvisor).setHadPrimary(); } // Make sure any removes that we saw during recovery are // applied. @@ -94,7 +95,8 @@ public class BucketPersistenceAdvisor extends PersistenceAdvisorImpl { } } - protected void checkInterruptedByShutdownAll() { + @Override + public void checkInterruptedByShutdownAll() { // when ShutdownAll is on-going, break all the GII for BR if (proxyBucket.getCache().isCacheAtShutdownAll()) { throw proxyBucket.getCache().getCacheClosedException("Cache is being closed by ShutdownAll"); @@ -107,7 +109,7 @@ public class BucketPersistenceAdvisor extends PersistenceAdvisorImpl { } @Override - protected void beginWaitingForMembershipChange(Set membersToWaitFor) { + public void beginWaitingForMembershipChange(Set membersToWaitFor) { if (recovering) { bucketLock.unlock(); } else { @@ -121,14 +123,13 @@ public class BucketPersistenceAdvisor extends PersistenceAdvisorImpl { } @Override - protected void logWaitingForMember(Set allMembersToWaitFor, - Set offlineMembersToWaitFor) { + public void logWaitingForMembers() { // We only log the bucket level information at fine level. if (logger.isDebugEnabled(LogMarker.PERSIST_ADVISOR_VERBOSE)) { Set membersToWaitForPrettyFormat = new HashSet(); - if (offlineMembersToWaitFor != null && !offlineMembersToWaitFor.isEmpty()) { -TransformUtils.transform(offlineMembersToWaitFor, membersToWaitForPrettyFormat, + if (offlineMembersWaitingFor != null && !offlineMembersWaitingFor.isEmpty()) { +TransformUtils.transform(offlineMembersWaitingFor, membersToWaitForPrettyFormat, TransformUtils.persistentMemberIdToLogEntryTransformer); logger.debug(LogMarker.PERSIST_ADVISOR_VERBOSE, LocalizedMessage.create( LocalizedStrings.BucketPersistenceAdvisor_WAITING_FOR_LATEST_MEMBER, @@ -137,7 +138,7 @@ public class BucketPersistenceAdvisor extends PersistenceAdvisorImpl { TransformUtils.persistentMemberIdToLogEntryTransformer.transform(getPersistentID()), membersToWaitForPrettyFormat})); } else { -TransformUtils.transform(allMembersToWaitFor, membersToWaitForPrettyFormat, +TransformUtils.transform(allMembersWaitingFor, me
[geode] branch develop updated: GEODE-5057: Removed experimental tag from Jdbc connector code base (#1789)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new 4e249f7 GEODE-5057: Removed experimental tag from Jdbc connector code base (#1789) 4e249f7 is described below commit 4e249f7c2f834a056a85b14de8728bce60d73e27 Author: agingade AuthorDate: Mon Apr 16 10:23:09 2018 -0700 GEODE-5057: Removed experimental tag from Jdbc connector code base (#1789) * GEODE-5057: Removed experimental tag from Jdbc connector --- geode-connectors/build.gradle | 3 ++- .../org/apache/geode/connectors/jdbc/JdbcAsyncWriter.java | 6 +++--- .../geode/connectors/jdbc/JdbcConnectorException.java | 8 .../java/org/apache/geode/connectors/jdbc/JdbcLoader.java | 3 +-- .../java/org/apache/geode/connectors/jdbc/JdbcWriter.java | 3 +-- .../connectors/jdbc/internal/AbstractJdbcCallback.java | 3 +-- .../jdbc/internal/ConnectionConfigExistsException.java | 3 --- .../jdbc/internal/ConnectionConfigNotFoundException.java | 3 --- .../connectors/jdbc/internal/JdbcConnectorService.java | 3 +-- .../connectors/jdbc/internal/JdbcConnectorServiceImpl.java | 3 +-- .../jdbc/internal/RegionMappingExistsException.java| 3 --- .../jdbc/internal/RegionMappingNotFoundException.java | 3 --- .../apache/geode/connectors/jdbc/internal/SqlHandler.java | 3 +-- .../connectors/jdbc/internal/SqlToPdxInstanceCreator.java | 3 +-- .../jdbc/internal/cli/AlterConnectionCommand.java | 8 ++-- .../jdbc/internal/cli/AlterConnectionFunction.java | 4 ++-- .../connectors/jdbc/internal/cli/AlterMappingCommand.java | 9 ++--- .../connectors/jdbc/internal/cli/AlterMappingFunction.java | 3 +-- .../jdbc/internal/cli/CreateConnectionCommand.java | 11 ++- .../jdbc/internal/cli/CreateConnectionFunction.java| 3 +-- .../connectors/jdbc/internal/cli/CreateMappingCommand.java | 6 ++ .../jdbc/internal/cli/CreateMappingFunction.java | 2 -- .../jdbc/internal/cli/DescribeConnectionCommand.java | 11 +++ .../jdbc/internal/cli/DescribeMappingCommand.java | 12 +++- .../jdbc/internal/cli/DestroyConnectionCommand.java| 9 ++--- .../jdbc/internal/cli/DestroyConnectionFunction.java | 3 +-- .../jdbc/internal/cli/DestroyMappingCommand.java | 6 ++ .../jdbc/internal/cli/DestroyMappingFunction.java | 3 +-- .../connectors/jdbc/internal/cli/JdbcCliFunction.java | 2 -- .../jdbc/internal/cli/ListConnectionCommand.java | 11 --- .../connectors/jdbc/internal/cli/ListMappingCommand.java | 10 -- .../jdbc/internal/configuration/ConnectorService.java | 2 -- .../connectors/jdbc/JdbcAsyncWriterIntegrationTest.java| 11 +-- .../geode/connectors/jdbc/JdbcConnectorExceptionTest.java | 2 +- .../geode/connectors/jdbc/internal/SqlHandlerTest.java | 1 - .../jdbc/internal/cli/AlterConnectionCommandDUnitTest.java | 12 +++- .../jdbc/internal/cli/AlterConnectionFunctionTest.java | 10 +- .../jdbc/internal/cli/AlterMappingFunctionTest.java| 10 +- .../cli/CreateConnectionCommandIntegrationTest.java| 14 -- .../internal/cli/CreateMappingCommandIntegrationTest.java | 14 -- .../internal/cli/DescribeConnectionCommandDUnitTest.java | 3 +-- .../jdbc/internal/cli/DescribeMappingCommandDUnitTest.java | 3 +-- .../jdbc/internal/cli/ListConnectionCommandTest.java | 4 ++-- .../jdbc/internal/cli/ListMappingCommandTest.java | 4 ++-- 44 files changed, 117 insertions(+), 136 deletions(-) diff --git a/geode-connectors/build.gradle b/geode-connectors/build.gradle index f4dbb5e..c5423b9 100644 --- a/geode-connectors/build.gradle +++ b/geode-connectors/build.gradle @@ -17,7 +17,8 @@ repositories { maven { -url 'https://dl.bintray.com/palantir/releases' // docker-compose-rule is published on bintray +url 'https://dl.bintray.com/palantir/releases' +// docker-compose-rule is published on bintray } } diff --git a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/JdbcAsyncWriter.java b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/JdbcAsyncWriter.java index e36469d..169e65d 100644 --- a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/JdbcAsyncWriter.java +++ b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/JdbcAsyncWriter.java @@ -21,7 +21,6 @@ import java.util.concurrent.atomic.LongAdder; import org.apache.logging.log4j.Logger; import org.apache.geode.CopyHelper; -import org.apache.geode.annotations.Experimental; import org.apache.geode.cache.asyncqueue
[geode] branch feature/GEODE-5057 deleted (was 3291e7d)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a change to branch feature/GEODE-5057 in repository https://gitbox.apache.org/repos/asf/geode.git. was 3291e7d Merge branch 'develop' into feature/GEODE-5057 The revisions that were on this branch are still contained in other references; therefore, this change does not discard any commits from the repository. -- To stop receiving notification emails like this one, please contact aging...@apache.org.
[geode] branch feature/GEODE-5057 updated (4dfe460 -> 3291e7d)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a change to branch feature/GEODE-5057 in repository https://gitbox.apache.org/repos/asf/geode.git. from 4dfe460 Merge branch 'develop' into feature/GEODE-5057 add 757e8f9 GEODE-5044: Correctly log stack trace on the protobuf server add 865a7c7 GEODE-4954, GEODE-4955: Remove trivial javadoc stubs and empty blocks: geode-core tests (#1782) add e27691f GEODE-4952: Spotless will now remove unused imports. (#1727) add d4a3689 GEODE-4990: Cluster Config StartUp Race Condition (#1730) add f7bb77c GEODE-5056: when found the dropped events at primary sender, send (#1794) add f984c95 GEODE-4954, GEODE-4955: Remove trivial javadoc stubs and empty blocks: geode-core:internal.cache add 130ed6e GEODE-5035: Explicitly pass java.io.tmpdir to JVMs invoked by Gradle. (#1779) add 6097e3d GEODE-5064: Removed unused code in LocalRegion (#1790) add ad45baa GEODE-4856: Public API for retrieving/persisting Cluster Configuration (#1791) add 2ecb372 GEODE-4863: refactor jdbc commands to use this public cluster configuration api (#1776) add 7960b70 Merge branch 'develop' into feature/GEODE-5057 add 5a07bab Removed commented line add f280247 GEODE-4954, GEODE-4955: Remove trivial javadoc stubs and empty blocks: geode-core:internal (#1784) add ca98d86 GEODE-4954, GEODE-4955: Remove trivial javadoc stubs and empty blocks: non geode-core modules (#1787) add 83c667b GEODE-3926: Catching exception from lucene query computing thread (#1774) add ac7db5b GEODE-4384 Add docs for gfsh destroy jndi-binding command (#1780) add 5707de5 GEODE-4954, GEODE-4955: Remove trivial javadoc stubs and empty blocks: non geode-core module tests (#1788) add 5057348 GEODE-4954, GEODE-4955: Remove trivial javadoc stubs and empty blocks: geode-core (#1786) add 1a2a438 GEODE_3926: applying spotless due to spotless changes occuring after PR add 82092e8 GEODE-5068: bump Jackson version. (#1796) add 4bc6c5a GEODE-4863: refactor jdbc commands to use this public cluster configuration api (#1802) add 3291e7d Merge branch 'develop' into feature/GEODE-5057 No new revisions were added by this update. Summary of changes: .../internal/common/ClientServerSessionCache.java | 2 - .../internal/common/PeerToPeerSessionCache.java| 3 - .../internal/filter/GemfireHttpSession.java| 1 - .../internal/filter/GemfireSessionManager.java | 1 - .../filter/attributes/SessionAttributes.java | 1 - .../session/internal/filter/util/TypeAwareMap.java | 3 - .../session/filter/SessionCachingFilter.java | 2 - .../geode/modules/session/installer/Installer.java | 3 - .../modules/session/installer/args/Argument.java | 1 - .../session/internal/filter/AbstractListener.java | 2 - .../session/internal/filter/BasicServlet.java | 3 - .../filter/HttpSessionAttributeListenerImpl.java | 3 - .../session/internal/filter/RendezvousManager.java | 3 - .../ServletRequestAttributeListenerImpl.java | 2 - .../geode/modules/session/EmbeddedTomcat8.java | 3 - .../geode/modules/session/CommandServlet.java | 7 - .../geode/modules/session/EmbeddedTomcat.java | 3 - .../geode/modules/session/CommandServlet.java | 7 - geode-assembly/src/main/dist/NOTICE| 2 +- .../LauncherLifecycleCommandsDUnitTest.java| 1 - .../source/subnavs/geode-subnav.erb| 3 + .../jdbc/internal/ConnectionConfigBuilder.java | 80 -- .../jdbc/internal/ConnectionConfiguration.java | 108 --- .../jdbc/internal/DataSourceManager.java | 4 +- .../jdbc/internal/HikariJdbcDataSource.java| 4 +- .../jdbc/internal/HikariJdbcDataSourceFactory.java | 4 +- .../jdbc/internal/JdbcConnectorService.java| 23 +- .../jdbc/internal/JdbcConnectorServiceImpl.java| 74 +- .../jdbc/internal/JdbcDataSourceFactory.java | 4 +- .../connectors/jdbc/internal/RegionMapping.java| 290 --- .../jdbc/internal/RegionMappingBuilder.java| 97 --- .../geode/connectors/jdbc/internal/SqlHandler.java | 24 +- .../jdbc/internal/SqlToPdxInstanceCreator.java | 5 +- .../jdbc/internal/cli/AlterConnectionCommand.java | 114 ++- .../jdbc/internal/cli/AlterConnectionFunction.java | 37 +- .../jdbc/internal/cli/AlterMappingCommand.java | 115 ++- .../jdbc/internal/cli/AlterMappingFunction.java| 47 +- .../jdbc/internal/cli/CreateConnectionCommand.java | 88 +-- .../internal/cli/CreateConnectionFunction.java | 10 +- .../jdbc/internal/cli/CreateMappingCommand.java| 87 +-- .../jdbc/internal/cli/CreateMappingFunction.java | 26 +- .../internal/cli/DescribeConnectionCommand.java| 60 +- .../internal/cli/DescribeConnectionFunction.java | 33 - .../jdbc/internal/c
[geode] branch feature/GEODE-5057 updated (5a31c03 -> 4dfe460)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a change to branch feature/GEODE-5057 in repository https://gitbox.apache.org/repos/asf/geode.git. from 5a31c03 GEODE-5057: Removed experimental tag from Jdbc connector and unused imports add 65b52f2 GEODE-4957: fix race in concurrent create on region (#1750) add cd74f9f GEODE-5056: set testParallelPropagationSenderStartAfterStop_Scenario2 to be flaky add 3f503ce GEODE-4874: Inconsistency in gfsh help for create jndi-binding (doc update) add b71b79f GEODE-3926: handle new lucene indexing exception add 3468fb5 GEODE-4962: Fix typo and output format from 'list gateways' gfsh command (#1778) add 34fdc32 GEODE-4874: Inconsistency in gfsh help for create jndi-binding (#1777) add cfcae6b Updated version to 1.7 add 46ee1c8 GEODE-5065: Add awaitability to testServerUpFirstClientLater (#1792) add 3b930b4 GEODE-4952: Remove usused imports from non-geode-core files. (#1724) add a442283 GEODE-4952: Remove unused imports from geode-core:internal. (#1725) add 5307968 GEODE-4952: Remove unused imports from geode-core, excluding geode-core:internal. (#1726) add b94bf44 GEODE-4952: Remove unused imports from test files. (#1723) add e6c7126 GEODE-5051: Improve gfsh destroy jndi-binding help prose (#1775) add 4dfe460 Merge branch 'develop' into feature/GEODE-5057 No new revisions were added by this update. Summary of changes: .../internal/filter/GemfireSessionManager.java | 2 - .../attributes/AbstractSessionAttributes.java | 2 - .../modules/session/filter/SessionListener.java| 1 - .../session/internal/filter/CommonTests.java | 1 - .../geode/modules/session/EmbeddedTomcat8.java | 3 - .../modules/session/TestSessionsTomcat8Base.java | 2 - .../Tomcat8SessionsClientServerDUnitTest.java | 4 - .../modules/session/Tomcat8SessionsDUnitTest.java | 3 - .../gatewaydelta/GatewayDeltaCreateEvent.java | 2 - .../gatewaydelta/GatewayDeltaDestroyEvent.java | 2 - .../session/catalina/DeltaSessionInterface.java| 1 - .../internal/DeltaSessionAttributeEventBatch.java | 1 - .../DeltaSessionDestroyAttributeEvent.java | 3 - .../internal/DeltaSessionUpdateAttributeEvent.java | 1 - .../java/org/apache/geode/modules/util/Banner.java | 3 - .../apache/geode/modules/util/ContextMapper.java | 1 - .../modules/session/Tomcat6SessionsJUnitTest.java | 1 - .../util/ClassLoaderObjectInputStreamTest.java | 1 - .../session/functions/GetMaxInactiveInterval.java | 1 - .../cli/commands/DestroyIndexIfExistsTest.java | 5 - .../shell/StatusLocatorExitCodeAcceptanceTest.java | 6 - .../shell/StatusServerExitCodeAcceptanceTest.java | 5 - .../geode/rest/internal/web/controllers/Item.java | 1 - .../geode/rest/internal/web/controllers/Order.java | 1 - .../rest/internal/web/controllers/Person.java | 1 - .../apache/geode/session/tests/CargoTestBase.java | 1 - .../tests/GenericAppServerClientServerTest.java| 2 - .../tests/Jetty9CachingClientServerTest.java | 3 - .../geode/session/tests/ServerContainer.java | 1 - .../session/tests/Tomcat7ClientServerTest.java | 1 - geode-book/config.yml | 6 +- .../test/concurrency/ConcurrentTestRunner.java | 3 - .../org/apache/geode/SerializationException.java | 1 - .../internal/ConfigurationParameterJmxImpl.java| 1 - .../jmx/internal/StatisticResourceJmxImpl.java | 1 - .../jmx/internal/SystemMemberCacheJmxImpl.java | 1 - .../apache/geode/cache/CacheClosedException.java | 2 - .../org/apache/geode/cache/LowMemoryException.java | 1 - .../client/internal/ClientSideHandshakeImpl.java | 3 - .../geode/cache/client/internal/ProxyCache.java| 2 - .../geode/cache/client/internal/ProxyRegion.java | 1 - .../geode/cache/client/internal/ServerProxy.java | 1 - .../internal/locator/GetAllServersResponse.java| 3 - .../internal/locator/LocatorListResponse.java | 1 - .../execute/EmptyRegionFunctionException.java | 1 - .../org/apache/geode/cache/execute/Function.java | 1 - .../ConflictingPersistentDataException.java| 1 - .../cache/query/MultiIndexCreationException.java | 1 - .../org/apache/geode/cache/query/internal/Bag.java | 4 - .../cache/query/internal/CompiledArithmetic.java | 1 - .../geode/cache/query/internal/CompiledSelect.java | 1 - .../query/internal/CompiledSortCriterion.java | 1 - .../internal/CumulativeNonDistinctResults.java | 2 - .../cache/query/internal/LinkedResultSet.java | 2 - .../cache/query/internal/ProxyQueryService.java| 1 - .../internal/QueryExecutionCanceledException.java | 1 - .../cache/query/internal/cq/CqAttributesImpl.java | 1 - .../query/internal/index/IndexCreati
[geode] branch develop updated: GEODE-4991: do no use hard coded quotes (#1728)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new 3efb4da GEODE-4991: do no use hard coded quotes (#1728) 3efb4da is described below commit 3efb4da0fb79ad418e0b463e31dd31b23788696b Author: Darrel Schneider AuthorDate: Tue Apr 10 10:40:59 2018 -0700 GEODE-4991: do no use hard coded quotes (#1728) java.sql.DatabaseMetaData.getIdentifierQuoteString is now used when quoting identifiers. If this method returns null, an empty string, or a string with all spaces then no quoting will be done. --- .../internal/{ColumnValue.java => ColumnData.java} | 14 +- .../jdbc/internal/DataSourceManager.java | 3 +- .../{ColumnValue.java => EntryColumnData.java} | 41 ++ .../geode/connectors/jdbc/internal/SqlHandler.java | 146 +++-- .../jdbc/internal/SqlStatementFactory.java | 87 ++-- .../jdbc/internal/SqlToPdxInstanceCreator.java | 2 +- .../connectors/jdbc/internal/TableMetaData.java| 9 +- .../jdbc/internal/TableMetaDataManager.java| 6 +- .../jdbc/internal/TableMetaDataView.java | 10 +- .../geode/connectors/jdbc/JdbcDistributedTest.java | 26 +++- .../connectors/jdbc/MySqlJdbcDistributedTest.java | 13 +- .../jdbc/PostgresJdbcDistributedTest.java | 9 +- .../{ColumnValueTest.java => ColumnDataTest.java} | 15 +-- .../connectors/jdbc/internal/SqlHandlerTest.java | 30 +++-- .../jdbc/internal/SqlStatementFactoryTest.java | 34 +++-- .../TableMetaDataManagerIntegrationTest.java | 8 +- .../jdbc/internal/TableMetaDataManagerTest.java| 24 17 files changed, 258 insertions(+), 219 deletions(-) diff --git a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/ColumnValue.java b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/ColumnData.java similarity index 78% copy from geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/ColumnValue.java copy to geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/ColumnData.java index 581b975..e1dba74 100644 --- a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/ColumnValue.java +++ b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/ColumnData.java @@ -16,23 +16,17 @@ package org.apache.geode.connectors.jdbc.internal; import java.sql.JDBCType; -class ColumnValue { - private final boolean isKey; +class ColumnData { private final String columnName; private final Object value; private final int dataType; - ColumnValue(boolean isKey, String columnName, Object value, int dataType) { -this.isKey = isKey; + ColumnData(String columnName, Object value, int dataType) { this.columnName = columnName; this.value = value; this.dataType = dataType; } - boolean isKey() { -return isKey; - } - String getColumnName() { return columnName; } @@ -47,7 +41,7 @@ class ColumnValue { @Override public String toString() { -return "ColumnValue [isKey=" + isKey + ", columnName=" + columnName + ", value=" + value -+ ", dataType=" + JDBCType.valueOf(dataType) + "]"; +return "ColumnData [columnName=" + columnName + ", value=" + value + ", dataType=" ++ JDBCType.valueOf(dataType) + "]"; } } diff --git a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/DataSourceManager.java b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/DataSourceManager.java index b27f1ff..fb4e41c 100644 --- a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/DataSourceManager.java +++ b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/DataSourceManager.java @@ -40,8 +40,7 @@ class DataSourceManager { private void close(JdbcDataSource dataSource) { try { dataSource.close(); -} catch (Exception e) { - // TODO ignored for now; should it be logged? +} catch (Exception ignore) { } } } diff --git a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/ColumnValue.java b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/EntryColumnData.java similarity index 53% rename from geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/ColumnValue.java rename to geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/EntryColumnData.java index 581b975..5630f03 100644 --- a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/ColumnValue.java +++ b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/EntryColumnData.java @@ -1
[geode] branch develop updated: GEODE-4947: JdbcConnector tests run against external database as AcceptanceTest category (#1747)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new d00dbd7 GEODE-4947: JdbcConnector tests run against external database as AcceptanceTest category (#1747) d00dbd7 is described below commit d00dbd735e9d823a0639bcdbbec955d606536391 Author: agingade AuthorDate: Thu Apr 5 16:36:26 2018 -0700 GEODE-4947: JdbcConnector tests run against external database as AcceptanceTest category (#1747) Add test with Postgres and MySQL for JDBC connector Add rule for Postgres, MySQL and Derby standing up Docker instance to enable testing Update integration tests to use mysql and postgres Convert distributed tests to use mysql and postgres Fix issue with null character string in Postgres Add geode-connectors test to acceptance tests --- build.gradle | 1 + ci/pipelines/develop.yml | 2 +- geode-connectors/build.gradle | 10 ++ .../geode/connectors/jdbc/internal/SqlHandler.java | 4 +- .../jdbc/internal/SqlStatementFactory.java | 14 +- .../jdbc/JdbcAsyncWriterIntegrationTest.java | 18 ++- ...JdbcDUnitTest.java => JdbcDistributedTest.java} | 168 + .../connectors/jdbc/JdbcLoaderIntegrationTest.java | 35 +++-- .../connectors/jdbc/JdbcWriterIntegrationTest.java | 18 ++- .../jdbc/MySqlJdbcAsyncWriterIntegrationTest.java | 47 ++ .../connectors/jdbc/MySqlJdbcDistributedTest.java | 100 .../jdbc/MySqlJdbcLoaderIntegrationTest.java | 58 +++ .../jdbc/MySqlJdbcWriterIntegrationTest.java | 47 ++ .../PostgresJdbcAsyncWriterIntegrationTest.java| 47 ++ .../jdbc/PostgresJdbcDistributedTest.java | 88 +++ .../jdbc/PostgresJdbcLoaderIntegrationTest.java| 57 +++ .../jdbc/PostgresJdbcWriterIntegrationTest.java| 47 ++ .../MySqlTableMetaDataManagerIntegrationTest.java | 42 ++ ...ostgresTableMetaDataManagerIntegrationTest.java | 43 ++ .../jdbc/internal/SqlStatementFactoryTest.java | 17 +-- .../TableMetaDataManagerIntegrationTest.java | 28 ++-- .../jdbc/internal/TestConfigService.java | 14 +- .../test/junit/rules/DatabaseConnectionRule.java | 26 .../junit/rules/InMemoryDerbyConnectionRule.java | 42 ++ .../test/junit/rules/MySqlConnectionRule.java | 72 + .../test/junit/rules/PostgresConnectionRule.java | 45 ++ .../junit/rules/SqlDatabaseConnectionRule.java | 123 +++ .../geode/connectors/jdbc/internal/mysql.yml | 28 .../geode/connectors/jdbc/internal/postgres.yml| 27 .../org/apache/geode/connectors/jdbc/mysql.yml | 28 .../org/apache/geode/connectors/jdbc/postgres.yml | 27 31 files changed, 1159 insertions(+), 164 deletions(-) diff --git a/build.gradle b/build.gradle index cd76ede..c3f1604 100755 --- a/build.gradle +++ b/build.gradle @@ -18,6 +18,7 @@ buildscript { repositories { maven { url "https://plugins.gradle.org/m2/"; } +maven { url "https://dl.bintray.com/palantir/releases"; } jcenter() } diff --git a/ci/pipelines/develop.yml b/ci/pipelines/develop.yml index a969f1e..564c870 100644 --- a/ci/pipelines/develop.yml +++ b/ci/pipelines/develop.yml @@ -246,7 +246,7 @@ jobs: CALL_STACK_TIMEOUT: 25200 run: args: - - :geode-assembly:acceptanceTest + - :geode-assembly:acceptanceTest geode-connectors:acceptanceTest - acceptancetestfiles path: geode-ci/ci/scripts/test-run.sh on_failure: diff --git a/geode-connectors/build.gradle b/geode-connectors/build.gradle index c2b55ba..005f498 100644 --- a/geode-connectors/build.gradle +++ b/geode-connectors/build.gradle @@ -15,15 +15,25 @@ * limitations under the License. */ +repositories { +maven { +url 'https://dl.bintray.com/palantir/releases' // docker-compose-rule is published on bintray +} +} + dependencies { compile project(':geode-core') compile project(':geode-common') compile group: 'com.zaxxer', name: 'HikariCP', version: project.'HikariCP.version' + testCompile project(':geode-junit') //Connectors test framework. testRuntime 'org.apache.derby:derby:' + project.'derby.version' +testCompile group: 'mysql', name: 'mysql-connector-java', version: '5.1.46' +testCompile group: 'org.postgresql', name: 'postgresql', version: '42.2.2' +testCompile 'com.palantir.docker.compose:docker-compose-rule-junit4:0.31.1' testCompile 'com.pholser:junit-quickchec
[geode] 17/23: GEODE-4947: Remove duplicate code
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/GEODE-4947 in repository https://gitbox.apache.org/repos/asf/geode.git commit b8fe4a0e115484d80dc31404ebe0ab29f7a06e0f Author: Nick Reich AuthorDate: Mon Apr 2 15:21:57 2018 -0700 GEODE-4947: Remove duplicate code --- .../java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java | 5 - 1 file changed, 5 deletions(-) diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java index d3c6f07..bafe015 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java @@ -161,11 +161,6 @@ public abstract class JdbcDistributedTest implements Serializable { statement.execute("Drop table " + TABLE_NAME); } catch (SQLException ignore) { } - -try { - statement.execute("Drop table " + TABLE_NAME + ""); -} catch (SQLException ignore) { -} } } } -- To stop receiving notification emails like this one, please contact aging...@apache.org.
[geode] 22/23: GEODE-4947: Add geode-connectors to acceptance tests
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/GEODE-4947 in repository https://gitbox.apache.org/repos/asf/geode.git commit 9f51db02e21a5ff0d2d86056989eed29cd280d3a Author: Nick Reich AuthorDate: Wed Apr 4 10:41:14 2018 -0700 GEODE-4947: Add geode-connectors to acceptance tests --- ci/pipelines/develop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/pipelines/develop.yml b/ci/pipelines/develop.yml index a969f1e..564c870 100644 --- a/ci/pipelines/develop.yml +++ b/ci/pipelines/develop.yml @@ -246,7 +246,7 @@ jobs: CALL_STACK_TIMEOUT: 25200 run: args: - - :geode-assembly:acceptanceTest + - :geode-assembly:acceptanceTest geode-connectors:acceptanceTest - acceptancetestfiles path: geode-ci/ci/scripts/test-run.sh on_failure: -- To stop receiving notification emails like this one, please contact aging...@apache.org.
[geode] 08/23: GEODE-4947: Fix spotless formatting
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/GEODE-4947 in repository https://gitbox.apache.org/repos/asf/geode.git commit eeb10b351308ecdcfadba38486a998b2303b22fd Author: Nick Reich AuthorDate: Wed Mar 28 15:40:30 2018 -0700 GEODE-4947: Fix spotless formatting --- .../geode/connectors/jdbc/JdbcDistributedTest.java | 72 +++--- .../connectors/jdbc/JdbcLoaderIntegrationTest.java | 4 +- .../connectors/jdbc/MySqlJdbcDistributedTest.java | 14 ++--- .../jdbc/MySqlJdbcLoaderIntegrationTest.java | 13 ++-- .../jdbc/PostgresJdbcDistributedTest.java | 14 ++--- .../jdbc/PostgresJdbcLoaderIntegrationTest.java| 9 ++- .../jdbc/internal/SqlStatementFactoryTest.java | 13 ++-- 7 files changed, 69 insertions(+), 70 deletions(-) diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java index 3688f5d..cfd6562 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java @@ -97,33 +97,32 @@ public abstract class JdbcDistributedTest implements Serializable { private void createTable() throws SQLException { server = startupRule.startServerVM(1, x -> x.withConnectionToLocator(locator.getPort())); - Connection connection = getConnection(); - Statement statement = connection.createStatement(); - statement.execute("Create Table " + TABLE_NAME - + " (id varchar(10) primary key not null, name varchar(10), age int)"); +Connection connection = getConnection(); +Statement statement = connection.createStatement(); +statement.execute("Create Table " + TABLE_NAME ++ " (id varchar(10) primary key not null, name varchar(10), age int)"); } private void createTableForAllSupportedFields() throws SQLException { server = startupRule.startServerVM(1, x -> x.withConnectionToLocator(locator.getPort()).withPDXReadSerialized()); - Connection connection = getConnection(); - Statement statement = connection.createStatement(); - createSupportedFieldsTable(statement, TABLE_NAME); +Connection connection = getConnection(); +Statement statement = connection.createStatement(); +createSupportedFieldsTable(statement, TABLE_NAME); } protected abstract void createSupportedFieldsTable(Statement statement, String tableName) throws SQLException; private void insertNullDataForAllSupportedFieldsTable(String key) throws SQLException { - Connection connection = DriverManager.getConnection(connectionUrl); +Connection connection = DriverManager.getConnection(connectionUrl); - String insertQuery = - "Insert into " + TABLE_NAME + " values (" + "?,?,?,?,?,?,?,?,?,?,?,?,?)"; - System.out.println("### Query is :" + insertQuery); - PreparedStatement statement = connection.prepareStatement(insertQuery); +String insertQuery = "Insert into " + TABLE_NAME + " values (" + "?,?,?,?,?,?,?,?,?,?,?,?,?)"; +System.out.println("### Query is :" + insertQuery); +PreparedStatement statement = connection.prepareStatement(insertQuery); createNullStatement(key, statement); - statement.execute(); +statement.execute(); } protected abstract void createNullStatement(String key, PreparedStatement statement) @@ -131,35 +130,36 @@ public abstract class JdbcDistributedTest implements Serializable { private void insertDataForAllSupportedFieldsTable(String key, ClassWithSupportedPdxFields data) throws SQLException { - Connection connection = DriverManager.getConnection(connectionUrl); +Connection connection = DriverManager.getConnection(connectionUrl); - String insertQuery = - "Insert into " + TABLE_NAME + " values (" + "?,?,?,?,?,?,?,?,?,?,?,?,?)"; - System.out.println("### Query is :" + insertQuery); - PreparedStatement statement = connection.prepareStatement(insertQuery); - statement.setObject(1, key); - statement.setObject(2, data.isAboolean()); - statement.setObject(3, data.getAbyte()); - statement.setObject(4, data.getAshort()); - statement.setObject(5, data.getAnint()); - statement.setObject(6, data.getAlong()); - statement.setObject(7, data.getAfloat()); - statement.setObject(8, data.getAdouble()); - statement.setObject(9, data.getAstring()); - statement.setObject(10, new java.sql.Timestamp(data.getAdate().getTime())); - statement.setObject(11, data.getAnobject()); - statement.setObject(12, data.getAbytearray()); -
[geode] 04/23: GEODE-4947: Update integration tests to use mysql and postgres
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/GEODE-4947 in repository https://gitbox.apache.org/repos/asf/geode.git commit 1f234ca6a1c3eba0d5b65632631d50e1c10e0204 Author: Nick Reich AuthorDate: Wed Mar 28 10:16:46 2018 -0700 GEODE-4947: Update integration tests to use mysql and postgres --- .../jdbc/internal/SqlStatementFactory.java | 14 ++-- .../jdbc/JdbcAsyncWriterIntegrationTest.java | 14 +++- .../connectors/jdbc/JdbcLoaderIntegrationTest.java | 15 - .../connectors/jdbc/JdbcWriterIntegrationTest.java | 13 ++- ...va => MySqlJdbcAsyncWriterIntegrationTest.java} | 22 +- ...st.java => MySqlJdbcLoaderIntegrationTest.java} | 21 - ...st.java => MySqlJdbcWriterIntegrationTest.java} | 21 - ...=> PostgresJdbcAsyncWriterIntegrationTest.java} | 21 - ...java => PostgresJdbcLoaderIntegrationTest.java} | 21 - ...java => PostgresJdbcWriterIntegrationTest.java} | 21 - .../jdbc/internal/TestConfigService.java | 16 ++--- .../test/junit/rules/DatabaseConnectionRule.java | 2 ++ .../junit/rules/InMemoryDerbyConnectionRule.java | 8 +-- .../test/junit/rules/MySqlConnectionRule.java | 26 +- .../test/junit/rules/PostgresConnectionRule.java | 2 +- .../junit/rules/SqlDatabaseConnectionRule.java | 4 ++-- 16 files changed, 140 insertions(+), 101 deletions(-) diff --git a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/SqlStatementFactory.java b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/SqlStatementFactory.java index ac787b8..d5367ef 100644 --- a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/SqlStatementFactory.java +++ b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/SqlStatementFactory.java @@ -22,18 +22,18 @@ class SqlStatementFactory { assert columnList.size() == 1; ColumnValue keyCV = columnList.get(0); assert keyCV.isKey(); -return "SELECT * FROM \"" + tableName + "\" WHERE \"" + keyCV.getColumnName() + "\" = ?"; +return "SELECT * FROM " + tableName + " WHERE " + keyCV.getColumnName() + " = ?"; } String createDestroySqlString(String tableName, List columnList) { assert columnList.size() == 1; ColumnValue keyCV = columnList.get(0); assert keyCV.isKey(); -return "DELETE FROM \"" + tableName + "\" WHERE \"" + keyCV.getColumnName() + "\" = ?"; +return "DELETE FROM " + tableName + " WHERE " + keyCV.getColumnName() + " = ?"; } String createUpdateSqlString(String tableName, List columnList) { -StringBuilder query = new StringBuilder("UPDATE \"" + tableName + "\" SET "); +StringBuilder query = new StringBuilder("UPDATE " + tableName + " SET "); int idx = 0; for (ColumnValue column : columnList) { if (!column.isKey()) { @@ -41,14 +41,14 @@ class SqlStatementFactory { if (idx > 1) { query.append(", "); } -query.append('"').append(column.getColumnName()).append('"'); +query.append(column.getColumnName()); query.append(" = ?"); } } for (ColumnValue column : columnList) { if (column.isKey()) { query.append(" WHERE "); -query.append('"').append(column.getColumnName()).append('"'); +query.append(column.getColumnName()); query.append(" = ?"); // currently only support simple primary key with one column break; @@ -58,13 +58,13 @@ class SqlStatementFactory { } String createInsertSqlString(String tableName, List columnList) { -StringBuilder columnNames = new StringBuilder("INSERT INTO \"" + tableName + "\" ("); +StringBuilder columnNames = new StringBuilder("INSERT INTO " + tableName + " ("); StringBuilder columnValues = new StringBuilder(" VALUES ("); int columnCount = columnList.size(); int idx = 0; for (ColumnValue column : columnList) { idx++; - columnNames.append('"').append(column.getColumnName()).append('"'); + columnNames.append(column.getColumnName()); columnValues.append('?'); if (idx != columnCount) { columnNames.append(", "); diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcAsyncWriterIntegrationTest.java b/geode-connectors/src/test/java/org/apach
[geode] 14/23: GEODE-4947: Fix issue with null character string in Postgres
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/GEODE-4947 in repository https://gitbox.apache.org/repos/asf/geode.git commit 8454a952c9ba87711f5499f7c4a4292aff0513cd Author: Nick Reich AuthorDate: Mon Apr 2 14:05:34 2018 -0700 GEODE-4947: Fix issue with null character string in Postgres --- .../java/org/apache/geode/connectors/jdbc/internal/SqlHandler.java| 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/SqlHandler.java b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/SqlHandler.java index 3e49cf2..8fc2c5e 100644 --- a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/SqlHandler.java +++ b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/SqlHandler.java @@ -113,7 +113,9 @@ public class SqlHandler { index++; Object value = columnValue.getValue(); if (value instanceof Character) { -value = ((Character) value).toString(); +Character character = ((Character) value); +// if null character, set to null string instead of a string with the null character +value = character == Character.valueOf((char) 0) ? null : character.toString(); } else if (value instanceof Date) { Date jdkDate = (Date) value; switch (columnValue.getDataType()) { -- To stop receiving notification emails like this one, please contact aging...@apache.org.
[geode] 12/23: GEODE-4947: Protect against having no connection rule
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/GEODE-4947 in repository https://gitbox.apache.org/repos/asf/geode.git commit ded7309a08f6acf54e1844598164ae235a07c8ea Author: Nick Reich AuthorDate: Thu Mar 29 15:30:18 2018 -0700 GEODE-4947: Protect against having no connection rule --- .../java/org/apache/geode/connectors/jdbc/MySqlJdbcDistributedTest.java | 2 +- .../org/apache/geode/connectors/jdbc/PostgresJdbcDistributedTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcDistributedTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcDistributedTest.java index 347b03d..2576126 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcDistributedTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcDistributedTest.java @@ -56,7 +56,7 @@ public class MySqlJdbcDistributedTest extends JdbcDistributedTest { @Override public String getConnectionUrl() { -return dbRule.getConnectionUrl(); +return dbRule == null ? null : dbRule.getConnectionUrl(); } @Override diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/PostgresJdbcDistributedTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/PostgresJdbcDistributedTest.java index 25f33c9..6643cbe 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/PostgresJdbcDistributedTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/PostgresJdbcDistributedTest.java @@ -56,7 +56,7 @@ public class PostgresJdbcDistributedTest extends JdbcDistributedTest { @Override public String getConnectionUrl() { -return dbRule.getConnectionUrl(); +return dbRule == null ? null : dbRule.getConnectionUrl(); } @Override -- To stop receiving notification emails like this one, please contact aging...@apache.org.
[geode] 23/23: caps
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/GEODE-4947 in repository https://gitbox.apache.org/repos/asf/geode.git commit 473d3799aec600a5885c35b5958a1b376e75ced4 Author: Nick Reich AuthorDate: Wed Apr 4 13:29:50 2018 -0700 caps --- .../test/java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java index 69e3fa9..12fb6fb 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java @@ -53,7 +53,7 @@ import org.apache.geode.test.junit.rules.GfshCommandRule; import org.apache.geode.test.junit.rules.serializable.SerializableTestName; /** - * End-to-end dunits for jdbc connector + * End-to-end dunits for JDBC connector */ @Category(AcceptanceTest.class) public abstract class JdbcDistributedTest implements Serializable { -- To stop receiving notification emails like this one, please contact aging...@apache.org.
[geode] 13/23: GEODE-4947: Fix MySQL test truncating timestamps
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/GEODE-4947 in repository https://gitbox.apache.org/repos/asf/geode.git commit fe91b2586cdebe3c61d7ffbd13ee0820393ab94e Author: Nick Reich AuthorDate: Fri Mar 30 16:04:56 2018 -0700 GEODE-4947: Fix MySQL test truncating timestamps --- .../geode/connectors/jdbc/JdbcDistributedTest.java | 21 +++-- .../connectors/jdbc/MySqlJdbcDistributedTest.java | 12 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java index 3c01a40..d3c6f07 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java @@ -25,8 +25,6 @@ import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; -import java.sql.Types; -import java.time.Instant; import java.util.Date; import java.util.Properties; import java.util.concurrent.TimeUnit; @@ -52,7 +50,6 @@ import org.apache.geode.test.dunit.rules.ClusterStartupRule; import org.apache.geode.test.dunit.rules.DistributedRestoreSystemProperties; import org.apache.geode.test.dunit.rules.MemberVM; import org.apache.geode.test.junit.categories.DistributedTest; -import org.apache.geode.test.junit.rules.DatabaseConnectionRule; import org.apache.geode.test.junit.rules.GfshCommandRule; import org.apache.geode.test.junit.rules.serializable.SerializableTestName; @@ -319,15 +316,10 @@ public abstract class JdbcDistributedTest implements Serializable { } @Test - @Ignore("GEODE-4922: MySQL is truncating the milliseconds from the timestamp") public void verifyDateToTimestamp() throws Exception { server = startupRule.startServerVM(1, x -> x.withConnectionToLocator(locator.getPort())); -server.invoke(() -> { - Connection connection = DriverManager.getConnection(connectionUrl); - Statement statement = connection.createStatement(); - statement.execute("Create Table " + TABLE_NAME - + " (id varchar(10) primary key not null, mytimestamp timestamp)"); -}); +createTableWithTimeStamp(server, connectionUrl, TABLE_NAME); + createRegionUsingGfsh(true, false, true); createJdbcConnection(); createMapping(REGION_NAME, CONNECTION_NAME); @@ -354,6 +346,15 @@ public abstract class JdbcDistributedTest implements Serializable { }); } + protected void createTableWithTimeStamp(MemberVM vm, String connectionUrl, String tableName) { +vm.invoke(() -> { + Connection connection = DriverManager.getConnection(connectionUrl); + Statement statement = connection.createStatement(); + statement.execute("Create Table " + tableName + + " (id varchar(10) primary key not null, mytimestamp timestamp)"); +}); + } + @Test public void putWritesToDB() throws Exception { createTable(); diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcDistributedTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcDistributedTest.java index 2576126..56b32fb 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcDistributedTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcDistributedTest.java @@ -16,6 +16,7 @@ package org.apache.geode.connectors.jdbc; import java.net.URL; import java.sql.Connection; +import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.SQLException; import java.sql.Statement; @@ -24,6 +25,7 @@ import java.sql.Types; import org.junit.ClassRule; import org.junit.experimental.categories.Category; +import org.apache.geode.test.dunit.rules.MemberVM; import org.apache.geode.test.junit.categories.DistributedTest; import org.apache.geode.test.junit.rules.MySqlConnectionRule; import org.apache.geode.test.junit.rules.SqlDatabaseConnectionRule; @@ -85,4 +87,14 @@ public class MySqlJdbcDistributedTest extends JdbcDistributedTest { statement.setNull(12, Types.BLOB); statement.setNull(13, Types.CHAR); } + + @Override + protected void createTableWithTimeStamp(MemberVM vm, String connectionUrl, String tableName) { +vm.invoke(() -> { + Connection connection = DriverManager.getConnection(connectionUrl); + Statement statement = connection.createStatement(); + statement.execute("CREATE TABLE " + tableName + + " (id varchar(10) primary key not null, mytimestamp timestamp(3))"); +}); + } } -- To stop receiving notification emails like this one, please contact aging...@apache.org.
[geode] 16/23: GEODE-4947: Downgrade docker compose version in config files
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/GEODE-4947 in repository https://gitbox.apache.org/repos/asf/geode.git commit 1dd8aaefa51bff625b044a6e76e00f0ec25b4e78 Author: Nick Reich AuthorDate: Mon Apr 2 14:31:53 2018 -0700 GEODE-4947: Downgrade docker compose version in config files --- .../test/resources/org/apache/geode/connectors/jdbc/internal/mysql.yml | 2 +- .../resources/org/apache/geode/connectors/jdbc/internal/postgres.yml| 2 +- .../src/test/resources/org/apache/geode/connectors/jdbc/mysql.yml | 2 +- .../src/test/resources/org/apache/geode/connectors/jdbc/postgres.yml| 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/geode-connectors/src/test/resources/org/apache/geode/connectors/jdbc/internal/mysql.yml b/geode-connectors/src/test/resources/org/apache/geode/connectors/jdbc/internal/mysql.yml index 97e1c32..6b127df 100644 --- a/geode-connectors/src/test/resources/org/apache/geode/connectors/jdbc/internal/mysql.yml +++ b/geode-connectors/src/test/resources/org/apache/geode/connectors/jdbc/internal/mysql.yml @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -version: '3.1' +version: '2.0' services: diff --git a/geode-connectors/src/test/resources/org/apache/geode/connectors/jdbc/internal/postgres.yml b/geode-connectors/src/test/resources/org/apache/geode/connectors/jdbc/internal/postgres.yml index 2380b9e..2320682 100644 --- a/geode-connectors/src/test/resources/org/apache/geode/connectors/jdbc/internal/postgres.yml +++ b/geode-connectors/src/test/resources/org/apache/geode/connectors/jdbc/internal/postgres.yml @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -version: '3.1' +version: '2.0' services: diff --git a/geode-connectors/src/test/resources/org/apache/geode/connectors/jdbc/mysql.yml b/geode-connectors/src/test/resources/org/apache/geode/connectors/jdbc/mysql.yml index 97e1c32..6b127df 100644 --- a/geode-connectors/src/test/resources/org/apache/geode/connectors/jdbc/mysql.yml +++ b/geode-connectors/src/test/resources/org/apache/geode/connectors/jdbc/mysql.yml @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -version: '3.1' +version: '2.0' services: diff --git a/geode-connectors/src/test/resources/org/apache/geode/connectors/jdbc/postgres.yml b/geode-connectors/src/test/resources/org/apache/geode/connectors/jdbc/postgres.yml index 2380b9e..2320682 100644 --- a/geode-connectors/src/test/resources/org/apache/geode/connectors/jdbc/postgres.yml +++ b/geode-connectors/src/test/resources/org/apache/geode/connectors/jdbc/postgres.yml @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -version: '3.1' +version: '2.0' services: -- To stop receiving notification emails like this one, please contact aging...@apache.org.
[geode] 15/23: GEODE-4947: Cleanup
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/GEODE-4947 in repository https://gitbox.apache.org/repos/asf/geode.git commit 75bf59a15f816f8b63909bcfa4478f9796c22d63 Author: Nick Reich AuthorDate: Mon Apr 2 14:29:34 2018 -0700 GEODE-4947: Cleanup --- .../jdbc/JdbcAsyncWriterIntegrationTest.java | 2 -- .../connectors/jdbc/JdbcLoaderIntegrationTest.java | 2 -- .../connectors/jdbc/JdbcWriterIntegrationTest.java | 1 - .../TableMetaDataManagerIntegrationTest.java | 4 ++-- .../jdbc/internal/TestConfigService.java | 2 -- .../apache/geode/connectors/jdbc/docker/mysql.yml | 28 -- .../geode/connectors/jdbc/docker/postgres.yml | 27 - 7 files changed, 2 insertions(+), 64 deletions(-) diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcAsyncWriterIntegrationTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcAsyncWriterIntegrationTest.java index 11767eb..0430f71 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcAsyncWriterIntegrationTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcAsyncWriterIntegrationTest.java @@ -18,7 +18,6 @@ import static org.apache.geode.cache.RegionShortcut.REPLICATE; import static org.assertj.core.api.Assertions.assertThat; import java.sql.Connection; -import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; @@ -64,7 +63,6 @@ public abstract class JdbcAsyncWriterIntegrationTest { cache = (InternalCache) new CacheFactory().set("locators", "").set("mcast-port", "0") .setPdxReadSerialized(false).create(); employees = createRegionWithJDBCAsyncWriter(REGION_TABLE_NAME); -// connection = DriverManager.getConnection(CONNECTION_URL); connection = getConnection(); statement = connection.createStatement(); statement.execute("Create Table " + REGION_TABLE_NAME diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcLoaderIntegrationTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcLoaderIntegrationTest.java index 0a48a9a..6707fdc 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcLoaderIntegrationTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcLoaderIntegrationTest.java @@ -19,11 +19,9 @@ import static org.assertj.core.api.Assertions.assertThat; import java.io.IOException; import java.sql.Connection; -import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.SQLException; import java.sql.Statement; -import java.time.Instant; import java.util.Date; import org.junit.After; diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcWriterIntegrationTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcWriterIntegrationTest.java index 5a489a7..d30b93b 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcWriterIntegrationTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcWriterIntegrationTest.java @@ -19,7 +19,6 @@ import static com.googlecode.catchexception.CatchException.caughtException; import static org.assertj.core.api.Assertions.assertThat; import java.sql.Connection; -import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/internal/TableMetaDataManagerIntegrationTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/internal/TableMetaDataManagerIntegrationTest.java index 02a6584..6ec61f4 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/internal/TableMetaDataManagerIntegrationTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/internal/TableMetaDataManagerIntegrationTest.java @@ -33,10 +33,10 @@ import org.apache.geode.test.junit.categories.IntegrationTest; @Category(IntegrationTest.class) public abstract class TableMetaDataManagerIntegrationTest { - protected static final String REGION_TABLE_NAME = "employees"; + private static final String REGION_TABLE_NAME = "employees"; protected static final String DB_NAME = "test"; - protected TableMetaDataManager manager; + private TableMetaDataManager manager; protected Connection connection; protected Statement statement; diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/internal/TestConfigService.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/internal/TestConfigService.java index cd19d33..4e2aacf 100644 --- a/geode-connectors/src/t
[geode] 19/23: Revert "GEODE-4947: Make new category for tests that require external services"
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/GEODE-4947 in repository https://gitbox.apache.org/repos/asf/geode.git commit e9859d6600eb3e5c30ab80a23de7358611055727 Author: Nick Reich AuthorDate: Wed Apr 4 08:41:54 2018 -0700 Revert "GEODE-4947: Make new category for tests that require external services" This reverts commit 5413739ea8f44e4a2415326dbba2a67fdcbafda2. --- ci/pipelines/develop.yml | 63 -- .../jdbc/JdbcAsyncWriterIntegrationTest.java | 4 +- .../geode/connectors/jdbc/JdbcDistributedTest.java | 4 +- .../connectors/jdbc/JdbcLoaderIntegrationTest.java | 4 +- .../connectors/jdbc/JdbcWriterIntegrationTest.java | 4 +- .../jdbc/MySqlJdbcAsyncWriterIntegrationTest.java | 4 +- .../connectors/jdbc/MySqlJdbcDistributedTest.java | 4 +- .../jdbc/MySqlJdbcLoaderIntegrationTest.java | 4 +- .../jdbc/MySqlJdbcWriterIntegrationTest.java | 4 +- .../PostgresJdbcAsyncWriterIntegrationTest.java| 4 +- .../jdbc/PostgresJdbcDistributedTest.java | 4 +- .../jdbc/PostgresJdbcLoaderIntegrationTest.java| 4 +- .../jdbc/PostgresJdbcWriterIntegrationTest.java| 4 +- .../MySqlTableMetaDataManagerIntegrationTest.java | 4 +- ...ostgresTableMetaDataManagerIntegrationTest.java | 4 +- .../TableMetaDataManagerIntegrationTest.java | 4 +- .../test/junit/categories/ExternalServiceTest.java | 22 gradle/test.gradle | 11 18 files changed, 30 insertions(+), 126 deletions(-) diff --git a/ci/pipelines/develop.yml b/ci/pipelines/develop.yml index 7738f34..a969f1e 100644 --- a/ci/pipelines/develop.yml +++ b/ci/pipelines/develop.yml @@ -341,69 +341,6 @@ jobs: - integrationTest - integrationtestfiles path: geode-ci/ci/scripts/test-archive.sh -- name: ExternalServiceTest - serial: true - public: true - plan: -- aggregate: - - get: geode -passed: [Build] -trigger: true - - get: geode-ci - - get: geode-build-version -passed: [Build] - - get: docker-test-image -params: - rootfs: true -- task: runtests - privileged: true - timeout: 8h - config: -inputs: - - name: geode - - name: geode-ci - - name: docker-test-image - - name: geode-build-version -platform: linux -outputs: - - name: built-geode -image_resource: *docker-geode-build-image -params: - MAINTENANCE_VERSION: ((!maintenance-version)) - SERVICE_ACCOUNT: ((!concourse-gcp-account)) - PUBLIC_BUCKET: ((!public-bucket)) - CALL_STACK_TIMEOUT: 25200 -run: - args: - - externalServiceTest - - externalservicetestfiles - path: geode-ci/ci/scripts/test-run.sh - on_failure: -aggregate: - - put: send-notification-email -params: - subject: built-geode/subject - body: built-geode/body - ensure: - aggregate: - - task: archive-results - config: - inputs: - - name: geode - - name: geode-ci - - name: geode-build-version - - name: built-geode - platform: linux - image_resource: *docker-geode-build-image - params: - MAINTENANCE_VERSION: ((!maintenance-version)) - SERVICE_ACCOUNT: ((!concourse-gcp-account)) - PUBLIC_BUCKET: ((!public-bucket)) - run: - args: - - externalServiceTest - - externalservicetestfiles - path: geode-ci/ci/scripts/test-archive.sh - name: FlakyTest serial: true diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcAsyncWriterIntegrationTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcAsyncWriterIntegrationTest.java index 44ed5d3..0430f71 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcAsyncWriterIntegrationTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcAsyncWriterIntegrationTest.java @@ -40,9 +40,9 @@ import org.apache.geode.connectors.jdbc.internal.TestConfigService; import org.apache.geode.connectors.jdbc.internal.TestableConnectionManager; import org.apache.geode.internal.cache.InternalCache; import org.apache.geode.pdx.PdxInstance; -import org.apache.geode.test.junit.categories.ExternalServiceTest; +import org.apache.geode.test.junit.categories.IntegrationTest; -@Category(ExternalServiceTest.class) +@Category(IntegrationTest.class) public abstract class JdbcAsyncWriterIntegrationTest { static final String DB_NAME = "test"; diff --git a/geode-connectors/src/test/java/org/apache/g
[geode] 05/23: GEODE-4947: Fix failing tests due to type conversions
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/GEODE-4947 in repository https://gitbox.apache.org/repos/asf/geode.git commit 0c936470b4c18c03e25e500e54d4e413e611359a Author: Nick Reich AuthorDate: Wed Mar 28 11:05:11 2018 -0700 GEODE-4947: Fix failing tests due to type conversions --- .../org/apache/geode/connectors/jdbc/JdbcDUnitTest.java | 5 +++-- .../geode/connectors/jdbc/JdbcLoaderIntegrationTest.java | 16 ++-- .../connectors/jdbc/MySqlJdbcLoaderIntegrationTest.java | 12 +++- .../jdbc/PostgresJdbcLoaderIntegrationTest.java | 11 +++ 4 files changed, 31 insertions(+), 13 deletions(-) diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDUnitTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDUnitTest.java index e63d480..90cfd17 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDUnitTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDUnitTest.java @@ -25,6 +25,7 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.sql.Types; +import java.time.Instant; import java.util.Date; import java.util.Properties; import java.util.concurrent.TimeUnit; @@ -507,7 +508,7 @@ public class JdbcDUnitTest implements Serializable { client.invoke(() -> { String key = "id1"; ClassWithSupportedPdxFields value = new ClassWithSupportedPdxFields(true, (byte) 1, (short) 2, - 3, 4, 5.5f, 6.0, "BigEmp", new Date(10), "BigEmpObject", new byte[] {1, 2}, 'c'); + 3, 4, 5.5f, 6.0, "BigEmp", new Date(0), "BigEmpObject", new byte[] {1, 2}, 'c'); Region region = ClusterStartupRule.getClientCache().getRegion(REGION_NAME); region.put(key, value); @@ -550,7 +551,7 @@ public class JdbcDUnitTest implements Serializable { createMapping(REGION_NAME, CONNECTION_NAME, ClassWithSupportedPdxFields.class.getName(), false); String key = "id1"; ClassWithSupportedPdxFields value = new ClassWithSupportedPdxFields(true, (byte) 1, (short) 2, -3, 4, 5.5f, 6.0, "BigEmp", new Date(10), "BigEmpObject", new byte[] {1, 2}, 'c'); +3, 4, 5.5f, 6.0, "BigEmp", new Date(0), "BigEmpObject", new byte[] {1, 2}, 'c'); server.invoke(() -> { insertDataForAllSupportedFieldsTable(key, value); diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcLoaderIntegrationTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcLoaderIntegrationTest.java index 6a9dfbd..1e14c6d 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcLoaderIntegrationTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcLoaderIntegrationTest.java @@ -23,6 +23,7 @@ import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.SQLException; import java.sql.Statement; +import java.time.Instant; import java.util.Date; import org.junit.After; @@ -84,19 +85,14 @@ public abstract class JdbcLoaderIntegrationTest { public abstract String getConnectionUrl(); + protected abstract void createClassWithSupportedPdxFieldsTable(Statement statement, String tableName) + throws SQLException; + private void createEmployeeTable() throws Exception { statement.execute("Create Table " + REGION_TABLE_NAME + " (id varchar(10) primary key not null, name varchar(10), age int)"); } - private void createClassWithSupportedPdxFieldsTable() throws Exception { -statement.execute("Create Table " + REGION_TABLE_NAME -+ " (id varchar(10) primary key not null, " + "aboolean smallint, " + "abyte smallint, " -+ "ashort smallint, " + "anint int, " + "along bigint, " + "afloat float, " -+ "adouble float, " + "astring varchar(10), " + "adate timestamp, " -+ "anobject varchar(20), " + "abytearray blob(100), " + "achar char(1))"); - } - private void closeDB() throws Exception { if (statement == null) { statement = connection.createStatement(); @@ -153,7 +149,7 @@ public abstract class JdbcLoaderIntegrationTest { @Test public void verifyGetWithSupportedFieldsWithPdxClassName() throws Exception { -createClassWithSupportedPdxFieldsTable(); +createClassWithSupportedPdxFieldsTable(statement, REGION_TABLE_NAME); ClassWithSupportedPdxFields classWithSupportedPdxFields = createClassWithSupportedPdxFieldsForInsert(); insertIntoClassWithSupportedPdxFieldsTable("1", classWithSup
[geode] 10/23: GEODE-4947: Fix docker compose yml file references
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/GEODE-4947 in repository https://gitbox.apache.org/repos/asf/geode.git commit a9838197f00d6c51fb39ec2c6790370e3f853d10 Author: Nick Reich AuthorDate: Thu Mar 29 11:52:42 2018 -0700 GEODE-4947: Fix docker compose yml file references --- .../org/apache/geode/connectors/jdbc/JdbcDistributedTest.java| 5 - .../apache/geode/connectors/jdbc/MySqlJdbcDistributedTest.java | 2 +- .../geode/connectors/jdbc/MySqlJdbcLoaderIntegrationTest.java| 2 +- .../geode/connectors/jdbc/MySqlJdbcWriterIntegrationTest.java| 2 +- .../connectors/jdbc/PostgresJdbcAsyncWriterIntegrationTest.java | 2 +- .../geode/connectors/jdbc/PostgresJdbcDistributedTest.java | 2 +- .../geode/connectors/jdbc/PostgresJdbcLoaderIntegrationTest.java | 2 +- .../geode/connectors/jdbc/PostgresJdbcWriterIntegrationTest.java | 2 +- .../jdbc/internal/MySqlTableMetaDataManagerIntegrationTest.java | 9 ++--- .../internal/PostgresTableMetaDataManagerIntegrationTest.java| 9 ++--- 10 files changed, 19 insertions(+), 18 deletions(-) diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java index cfd6562..3c01a40 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java @@ -155,11 +155,6 @@ public abstract class JdbcDistributedTest implements Serializable { @After public void tearDown() throws Exception { closeDB(); -/* - * server.invoke(() -> { - * closeDB(); - * }); - */ } private void closeDB() throws SQLException { diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcDistributedTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcDistributedTest.java index 32fb9f3..a21ea07 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcDistributedTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcDistributedTest.java @@ -35,7 +35,7 @@ import org.apache.geode.test.junit.rules.SqlDatabaseConnectionRule; public class MySqlJdbcDistributedTest extends JdbcDistributedTest { private static final URL COMPOSE_RESOURCE_PATH = - MySqlJdbcAsyncWriterIntegrationTest.class.getResource("docker/mysql.yml"); + MySqlJdbcDistributedTest.class.getResource("docker/mysql.yml"); @ClassRule public static transient SqlDatabaseConnectionRule dbRule = createConnectionRule(); diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcLoaderIntegrationTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcLoaderIntegrationTest.java index 9ab31a0..14bd3f2 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcLoaderIntegrationTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcLoaderIntegrationTest.java @@ -30,7 +30,7 @@ import org.apache.geode.test.junit.rules.MySqlConnectionRule; public class MySqlJdbcLoaderIntegrationTest extends JdbcLoaderIntegrationTest { private static final URL COMPOSE_RESOURCE_PATH = - MySqlJdbcAsyncWriterIntegrationTest.class.getResource("docker/mysql.yml"); + MySqlJdbcLoaderIntegrationTest.class.getResource("docker/mysql.yml"); @ClassRule public static DatabaseConnectionRule dbRule = new MySqlConnectionRule.Builder() diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcWriterIntegrationTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcWriterIntegrationTest.java index 50df180..12ceec9 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcWriterIntegrationTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcWriterIntegrationTest.java @@ -29,7 +29,7 @@ import org.apache.geode.test.junit.rules.MySqlConnectionRule; public class MySqlJdbcWriterIntegrationTest extends JdbcWriterIntegrationTest { private static final URL COMPOSE_RESOURCE_PATH = - MySqlJdbcAsyncWriterIntegrationTest.class.getResource("docker/mysql.yml"); + MySqlJdbcWriterIntegrationTest.class.getResource("docker/mysql.yml"); @ClassRule public static DatabaseConnectionRule dbRule = new MySqlConnectionRule.Builder() diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/PostgresJdbcAsyncWriterIntegrationTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/PostgresJdbcAsyncWriterIntegrationTest.java index 3b363c2..fbaa93d 100644 --- a/
[geode] 20/23: GEODE-4947: Make tests that spin up Docker containers Acceptance Tests
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/GEODE-4947 in repository https://gitbox.apache.org/repos/asf/geode.git commit ed458ee3179b7e0f538a568b1c5618ba974de002 Author: Nick Reich AuthorDate: Wed Apr 4 08:48:02 2018 -0700 GEODE-4947: Make tests that spin up Docker containers Acceptance Tests --- .../apache/geode/connectors/jdbc/JdbcAsyncWriterIntegrationTest.java | 4 ++-- .../java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java| 4 ++-- .../org/apache/geode/connectors/jdbc/JdbcLoaderIntegrationTest.java | 4 ++-- .../org/apache/geode/connectors/jdbc/JdbcWriterIntegrationTest.java | 4 ++-- .../geode/connectors/jdbc/MySqlJdbcAsyncWriterIntegrationTest.java| 4 ++-- .../org/apache/geode/connectors/jdbc/MySqlJdbcDistributedTest.java| 4 ++-- .../apache/geode/connectors/jdbc/MySqlJdbcLoaderIntegrationTest.java | 4 ++-- .../apache/geode/connectors/jdbc/MySqlJdbcWriterIntegrationTest.java | 4 ++-- .../geode/connectors/jdbc/PostgresJdbcAsyncWriterIntegrationTest.java | 4 ++-- .../org/apache/geode/connectors/jdbc/PostgresJdbcDistributedTest.java | 4 ++-- .../geode/connectors/jdbc/PostgresJdbcLoaderIntegrationTest.java | 4 ++-- .../geode/connectors/jdbc/PostgresJdbcWriterIntegrationTest.java | 4 ++-- .../jdbc/internal/MySqlTableMetaDataManagerIntegrationTest.java | 4 ++-- .../jdbc/internal/PostgresTableMetaDataManagerIntegrationTest.java| 4 ++-- .../connectors/jdbc/internal/TableMetaDataManagerIntegrationTest.java | 4 ++-- 15 files changed, 30 insertions(+), 30 deletions(-) diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcAsyncWriterIntegrationTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcAsyncWriterIntegrationTest.java index 0430f71..819551b 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcAsyncWriterIntegrationTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcAsyncWriterIntegrationTest.java @@ -40,9 +40,9 @@ import org.apache.geode.connectors.jdbc.internal.TestConfigService; import org.apache.geode.connectors.jdbc.internal.TestableConnectionManager; import org.apache.geode.internal.cache.InternalCache; import org.apache.geode.pdx.PdxInstance; -import org.apache.geode.test.junit.categories.IntegrationTest; +import org.apache.geode.test.junit.categories.AcceptanceTest; -@Category(IntegrationTest.class) +@Category(AcceptanceTest.class) public abstract class JdbcAsyncWriterIntegrationTest { static final String DB_NAME = "test"; diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java index bafe015..c64c89c 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java @@ -49,14 +49,14 @@ import org.apache.geode.test.dunit.rules.ClientVM; import org.apache.geode.test.dunit.rules.ClusterStartupRule; import org.apache.geode.test.dunit.rules.DistributedRestoreSystemProperties; import org.apache.geode.test.dunit.rules.MemberVM; -import org.apache.geode.test.junit.categories.DistributedTest; +import org.apache.geode.test.junit.categories.AcceptanceTest; import org.apache.geode.test.junit.rules.GfshCommandRule; import org.apache.geode.test.junit.rules.serializable.SerializableTestName; /** * End-to-end dunits for jdbc connector */ -@Category(DistributedTest.class) +@Category(AcceptanceTest.class) public abstract class JdbcDistributedTest implements Serializable { static final String DB_NAME = "test"; diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcLoaderIntegrationTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcLoaderIntegrationTest.java index 6707fdc..805f8b4 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcLoaderIntegrationTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcLoaderIntegrationTest.java @@ -45,9 +45,9 @@ import org.apache.geode.internal.util.BlobHelper; import org.apache.geode.pdx.PdxInstance; import org.apache.geode.pdx.ReflectionBasedAutoSerializer; import org.apache.geode.pdx.internal.AutoSerializableManager; -import org.apache.geode.test.junit.categories.IntegrationTest; +import org.apache.geode.test.junit.categories.AcceptanceTest; -@Category(IntegrationTest.class) +@Category(AcceptanceTest.class) public abstract class JdbcLoaderIntegrationTest { static final String DB_NAME = "test"; diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcWriterIntegrationTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/
[geode] 06/23: GEODE-4947: Convert distributed tests to use mysql and postgres
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/GEODE-4947 in repository https://gitbox.apache.org/repos/asf/geode.git commit c3ac6b30ca81126394160f22c9f68da3896f0c21 Author: Nick Reich AuthorDate: Wed Mar 28 14:57:26 2018 -0700 GEODE-4947: Convert distributed tests to use mysql and postgres --- ...JdbcDUnitTest.java => JdbcDistributedTest.java} | 87 ++ .../connectors/jdbc/MySqlJdbcDistributedTest.java | 85 + .../jdbc/PostgresJdbcDistributedTest.java | 85 + .../jdbc/internal/SqlStatementFactoryTest.java | 8 +- .../junit/rules/SqlDatabaseConnectionRule.java | 2 +- 5 files changed, 213 insertions(+), 54 deletions(-) diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDUnitTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java similarity index 91% rename from geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDUnitTest.java rename to geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java index 90cfd17..ed748f7 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDUnitTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java @@ -17,6 +17,7 @@ package org.apache.geode.connectors.jdbc; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; +import java.io.IOException; import java.io.Serializable; import java.sql.Connection; import java.sql.DriverManager; @@ -50,6 +51,7 @@ import org.apache.geode.test.dunit.rules.ClusterStartupRule; import org.apache.geode.test.dunit.rules.DistributedRestoreSystemProperties; import org.apache.geode.test.dunit.rules.MemberVM; import org.apache.geode.test.junit.categories.DistributedTest; +import org.apache.geode.test.junit.rules.DatabaseConnectionRule; import org.apache.geode.test.junit.rules.GfshCommandRule; import org.apache.geode.test.junit.rules.serializable.SerializableTestName; @@ -57,15 +59,13 @@ import org.apache.geode.test.junit.rules.serializable.SerializableTestName; * End-to-end dunits for jdbc connector */ @Category(DistributedTest.class) -public class JdbcDUnitTest implements Serializable { +public abstract class JdbcDistributedTest implements Serializable { - private static final String DB_NAME = "DerbyDB"; + static final String DB_NAME = "test"; private static final String TABLE_NAME = "employees"; private static final String REGION_NAME = "employees"; - private static final String CONNECTION_URL = "jdbc:derby:memory:" + DB_NAME + ";create=true"; private static final String CONNECTION_NAME = "TestConnection"; - @Rule public transient GfshCommandRule gfsh = new GfshCommandRule(); @@ -81,70 +81,59 @@ public class JdbcDUnitTest implements Serializable { private MemberVM server; private MemberVM locator; + private String connectionUrl; @Before public void setup() throws Exception { locator = startupRule.startLocatorVM(0); gfsh.connectAndVerify(locator); +connectionUrl = getConnectionUrl(); } + public abstract Connection getConnection() throws SQLException; + + public abstract String getConnectionUrl() throws IOException, InterruptedException; + private void createTable() throws SQLException { server = startupRule.startServerVM(1, x -> x.withConnectionToLocator(locator.getPort())); -server.invoke(() -> { - Connection connection = DriverManager.getConnection(CONNECTION_URL); + Connection connection = getConnection(); Statement statement = connection.createStatement(); statement.execute("Create Table " + TABLE_NAME + " (id varchar(10) primary key not null, name varchar(10), age int)"); -}); } private void createTableForAllSupportedFields() throws SQLException { server = startupRule.startServerVM(1, x -> x.withConnectionToLocator(locator.getPort()).withPDXReadSerialized()); -server.invoke(() -> { - Connection connection = DriverManager.getConnection(CONNECTION_URL); + Connection connection = getConnection(); Statement statement = connection.createStatement(); - statement - .execute("Create Table \"" + TABLE_NAME + "\" (\"id\" varchar(10) primary key not null, " - + "aboolean smallint, " + "abyte smallint, " + "ashort smallint, " + "anint int, " - + "\"along\" bigint, " + "\"aFloat\" float, " + "\"ADOUBLE\" double, " - + "astring varchar(10), "
[geode] 18/23: GEODE-4947: Make new category for tests that require external services
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/GEODE-4947 in repository https://gitbox.apache.org/repos/asf/geode.git commit 5af1a0a10fd3074422f4d1f0c6eefaca8a7caec3 Author: Nick Reich AuthorDate: Tue Apr 3 14:56:53 2018 -0700 GEODE-4947: Make new category for tests that require external services --- ci/pipelines/develop.yml | 63 ++ .../jdbc/JdbcAsyncWriterIntegrationTest.java | 4 +- .../geode/connectors/jdbc/JdbcDistributedTest.java | 4 +- .../connectors/jdbc/JdbcLoaderIntegrationTest.java | 4 +- .../connectors/jdbc/JdbcWriterIntegrationTest.java | 4 +- .../jdbc/MySqlJdbcAsyncWriterIntegrationTest.java | 4 +- .../connectors/jdbc/MySqlJdbcDistributedTest.java | 4 +- .../jdbc/MySqlJdbcLoaderIntegrationTest.java | 4 +- .../jdbc/MySqlJdbcWriterIntegrationTest.java | 4 +- .../PostgresJdbcAsyncWriterIntegrationTest.java| 4 +- .../jdbc/PostgresJdbcDistributedTest.java | 4 +- .../jdbc/PostgresJdbcLoaderIntegrationTest.java| 4 +- .../jdbc/PostgresJdbcWriterIntegrationTest.java| 4 +- .../MySqlTableMetaDataManagerIntegrationTest.java | 4 +- ...ostgresTableMetaDataManagerIntegrationTest.java | 4 +- .../TableMetaDataManagerIntegrationTest.java | 4 +- .../test/junit/categories/ExternalServiceTest.java | 22 gradle/test.gradle | 11 18 files changed, 126 insertions(+), 30 deletions(-) diff --git a/ci/pipelines/develop.yml b/ci/pipelines/develop.yml index a969f1e..7738f34 100644 --- a/ci/pipelines/develop.yml +++ b/ci/pipelines/develop.yml @@ -341,6 +341,69 @@ jobs: - integrationTest - integrationtestfiles path: geode-ci/ci/scripts/test-archive.sh +- name: ExternalServiceTest + serial: true + public: true + plan: +- aggregate: + - get: geode +passed: [Build] +trigger: true + - get: geode-ci + - get: geode-build-version +passed: [Build] + - get: docker-test-image +params: + rootfs: true +- task: runtests + privileged: true + timeout: 8h + config: +inputs: + - name: geode + - name: geode-ci + - name: docker-test-image + - name: geode-build-version +platform: linux +outputs: + - name: built-geode +image_resource: *docker-geode-build-image +params: + MAINTENANCE_VERSION: ((!maintenance-version)) + SERVICE_ACCOUNT: ((!concourse-gcp-account)) + PUBLIC_BUCKET: ((!public-bucket)) + CALL_STACK_TIMEOUT: 25200 +run: + args: + - externalServiceTest + - externalservicetestfiles + path: geode-ci/ci/scripts/test-run.sh + on_failure: +aggregate: + - put: send-notification-email +params: + subject: built-geode/subject + body: built-geode/body + ensure: + aggregate: + - task: archive-results + config: + inputs: + - name: geode + - name: geode-ci + - name: geode-build-version + - name: built-geode + platform: linux + image_resource: *docker-geode-build-image + params: + MAINTENANCE_VERSION: ((!maintenance-version)) + SERVICE_ACCOUNT: ((!concourse-gcp-account)) + PUBLIC_BUCKET: ((!public-bucket)) + run: + args: + - externalServiceTest + - externalservicetestfiles + path: geode-ci/ci/scripts/test-archive.sh - name: FlakyTest serial: true diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcAsyncWriterIntegrationTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcAsyncWriterIntegrationTest.java index 0430f71..44ed5d3 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcAsyncWriterIntegrationTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcAsyncWriterIntegrationTest.java @@ -40,9 +40,9 @@ import org.apache.geode.connectors.jdbc.internal.TestConfigService; import org.apache.geode.connectors.jdbc.internal.TestableConnectionManager; import org.apache.geode.internal.cache.InternalCache; import org.apache.geode.pdx.PdxInstance; -import org.apache.geode.test.junit.categories.IntegrationTest; +import org.apache.geode.test.junit.categories.ExternalServiceTest; -@Category(IntegrationTest.class) +@Category(ExternalServiceTest.class) public abstract class JdbcAsyncWriterIntegrationTest { static final String DB_NAME = "test"; diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java b/geode-connectors/src/test/java/org/ap
[geode] 21/23: GEODE-4947: Remove ignore label from fixed test
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/GEODE-4947 in repository https://gitbox.apache.org/repos/asf/geode.git commit 40b159c201660c6a8633eee8593f913bdb19abcd Author: Nick Reich AuthorDate: Wed Apr 4 10:10:53 2018 -0700 GEODE-4947: Remove ignore label from fixed test --- .../test/java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java index c64c89c..69e3fa9 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java @@ -33,7 +33,6 @@ import java.util.function.Consumer; import org.awaitility.Awaitility; import org.junit.After; import org.junit.Before; -import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.experimental.categories.Category; @@ -502,7 +501,6 @@ public abstract class JdbcDistributedTest implements Serializable { } @Test - @Ignore("GEODE-4833: Postgres does not support UTF-8 null character as contents of a string") public void clientPutsAndGetsWithNullFieldsWithPdxClassName() throws Exception { createTableForAllSupportedFields(); ClientVM client = getClientVM(); -- To stop receiving notification emails like this one, please contact aging...@apache.org.
[geode] 09/23: GEODE-4947: Improve pathing to docker compose resource files
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/GEODE-4947 in repository https://gitbox.apache.org/repos/asf/geode.git commit 5bd24f61573913d8124f124e483bd4e4680b280d Author: Nick Reich AuthorDate: Thu Mar 29 11:08:02 2018 -0700 GEODE-4947: Improve pathing to docker compose resource files --- .../jdbc/MySqlJdbcAsyncWriterIntegrationTest.java | 10 .../connectors/jdbc/MySqlJdbcDistributedTest.java | 9 --- .../jdbc/MySqlJdbcLoaderIntegrationTest.java | 9 --- .../jdbc/MySqlJdbcWriterIntegrationTest.java | 9 --- .../PostgresJdbcAsyncWriterIntegrationTest.java| 9 --- .../jdbc/PostgresJdbcDistributedTest.java | 9 --- .../jdbc/PostgresJdbcLoaderIntegrationTest.java| 9 --- .../jdbc/PostgresJdbcWriterIntegrationTest.java| 9 --- .../src/test/resources/docker/mysql.yml| 12 -- .../src/test/resources/docker/postgres.yml | 11 - .../apache/geode/connectors/jdbc/docker/mysql.yml | 28 ++ .../geode/connectors/jdbc/docker/postgres.yml | 27 + 12 files changed, 103 insertions(+), 48 deletions(-) diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcAsyncWriterIntegrationTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcAsyncWriterIntegrationTest.java index 2ca6ff4..8e758d9 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcAsyncWriterIntegrationTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcAsyncWriterIntegrationTest.java @@ -14,6 +14,7 @@ */ package org.apache.geode.connectors.jdbc; +import java.net.URL; import java.sql.Connection; import java.sql.SQLException; @@ -23,15 +24,16 @@ import org.junit.experimental.categories.Category; import org.apache.geode.test.junit.categories.IntegrationTest; import org.apache.geode.test.junit.rules.DatabaseConnectionRule; import org.apache.geode.test.junit.rules.MySqlConnectionRule; -import org.apache.geode.test.junit.rules.PostgresConnectionRule; @Category(IntegrationTest.class) public class MySqlJdbcAsyncWriterIntegrationTest extends JdbcAsyncWriterIntegrationTest { + private static final URL COMPOSE_RESOURCE_PATH = + MySqlJdbcAsyncWriterIntegrationTest.class.getResource("docker/mysql.yml"); + @ClassRule - public static DatabaseConnectionRule dbRule = - new MySqlConnectionRule.Builder().file("src/test/resources/docker/mysql.yml") - .serviceName("db").port(3306).database(DB_NAME).build(); + public static DatabaseConnectionRule dbRule = new MySqlConnectionRule.Builder() + .file(COMPOSE_RESOURCE_PATH.getPath()).serviceName("db").port(3306).database(DB_NAME).build(); @Override public Connection getConnection() throws SQLException { diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcDistributedTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcDistributedTest.java index fc1f655..32fb9f3 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcDistributedTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcDistributedTest.java @@ -14,6 +14,7 @@ */ package org.apache.geode.connectors.jdbc; +import java.net.URL; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; @@ -33,13 +34,15 @@ import org.apache.geode.test.junit.rules.SqlDatabaseConnectionRule; @Category(DistributedTest.class) public class MySqlJdbcDistributedTest extends JdbcDistributedTest { + private static final URL COMPOSE_RESOURCE_PATH = + MySqlJdbcAsyncWriterIntegrationTest.class.getResource("docker/mysql.yml"); + @ClassRule - public static transient SqlDatabaseConnectionRule dbRule = createConnectionRule();// = new - // MySqlConnectionRule.Builder().file("src/test/resources/docker/mysql.yml").serviceName("db").port(3306).database(DB_NAME).build(); + public static transient SqlDatabaseConnectionRule dbRule = createConnectionRule(); private static SqlDatabaseConnectionRule createConnectionRule() { try { - return new MySqlConnectionRule.Builder().file("src/test/resources/docker/mysql.yml") + return new MySqlConnectionRule.Builder().file(COMPOSE_RESOURCE_PATH.getPath()) .serviceName("db").port(3306).database(DB_NAME).build(); } catch (IllegalStateException e) { return null; diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcLoaderIntegrationTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcLoaderIn
[geode] 11/23: GEODE-4947: Change resource paths
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/GEODE-4947 in repository https://gitbox.apache.org/repos/asf/geode.git commit 0a2e444d52ab45d7b0f7df2fbb5dcba282bff834 Author: Nick Reich AuthorDate: Thu Mar 29 13:40:35 2018 -0700 GEODE-4947: Change resource paths --- .../jdbc/MySqlJdbcAsyncWriterIntegrationTest.java | 2 +- .../connectors/jdbc/MySqlJdbcDistributedTest.java | 2 +- .../jdbc/MySqlJdbcLoaderIntegrationTest.java | 2 +- .../jdbc/MySqlJdbcWriterIntegrationTest.java | 2 +- .../PostgresJdbcAsyncWriterIntegrationTest.java| 2 +- .../jdbc/PostgresJdbcDistributedTest.java | 2 +- .../jdbc/PostgresJdbcLoaderIntegrationTest.java| 2 +- .../jdbc/PostgresJdbcWriterIntegrationTest.java| 2 +- .../MySqlTableMetaDataManagerIntegrationTest.java | 2 +- ...ostgresTableMetaDataManagerIntegrationTest.java | 2 +- .../geode/connectors/jdbc/internal/mysql.yml | 28 ++ .../geode/connectors/jdbc/internal/postgres.yml| 27 + .../org/apache/geode/connectors/jdbc/mysql.yml | 28 ++ .../org/apache/geode/connectors/jdbc/postgres.yml | 27 + 14 files changed, 120 insertions(+), 10 deletions(-) diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcAsyncWriterIntegrationTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcAsyncWriterIntegrationTest.java index 8e758d9..37a057d 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcAsyncWriterIntegrationTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcAsyncWriterIntegrationTest.java @@ -29,7 +29,7 @@ import org.apache.geode.test.junit.rules.MySqlConnectionRule; public class MySqlJdbcAsyncWriterIntegrationTest extends JdbcAsyncWriterIntegrationTest { private static final URL COMPOSE_RESOURCE_PATH = - MySqlJdbcAsyncWriterIntegrationTest.class.getResource("docker/mysql.yml"); + MySqlJdbcAsyncWriterIntegrationTest.class.getResource("mysql.yml"); @ClassRule public static DatabaseConnectionRule dbRule = new MySqlConnectionRule.Builder() diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcDistributedTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcDistributedTest.java index a21ea07..347b03d 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcDistributedTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcDistributedTest.java @@ -35,7 +35,7 @@ import org.apache.geode.test.junit.rules.SqlDatabaseConnectionRule; public class MySqlJdbcDistributedTest extends JdbcDistributedTest { private static final URL COMPOSE_RESOURCE_PATH = - MySqlJdbcDistributedTest.class.getResource("docker/mysql.yml"); + MySqlJdbcDistributedTest.class.getResource("mysql.yml"); @ClassRule public static transient SqlDatabaseConnectionRule dbRule = createConnectionRule(); diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcLoaderIntegrationTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcLoaderIntegrationTest.java index 14bd3f2..0d75045 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcLoaderIntegrationTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcLoaderIntegrationTest.java @@ -30,7 +30,7 @@ import org.apache.geode.test.junit.rules.MySqlConnectionRule; public class MySqlJdbcLoaderIntegrationTest extends JdbcLoaderIntegrationTest { private static final URL COMPOSE_RESOURCE_PATH = - MySqlJdbcLoaderIntegrationTest.class.getResource("docker/mysql.yml"); + MySqlJdbcLoaderIntegrationTest.class.getResource("mysql.yml"); @ClassRule public static DatabaseConnectionRule dbRule = new MySqlConnectionRule.Builder() diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcWriterIntegrationTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcWriterIntegrationTest.java index 12ceec9..7d64ad0 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcWriterIntegrationTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/MySqlJdbcWriterIntegrationTest.java @@ -29,7 +29,7 @@ import org.apache.geode.test.junit.rules.MySqlConnectionRule; public class MySqlJdbcWriterIntegrationTest extends JdbcWriterIntegrationTest { private static final URL COMPOSE_RESOURCE_PATH = - MySqlJdbcWriterIntegrationTest.class.getResource("docker/mysql.yml"); + MySqlJdbcWriterIntegrationTest.class.getResource("mysql.
[geode] 01/23: GEODE-4947: Add test using MySQL for JDBC connector
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/GEODE-4947 in repository https://gitbox.apache.org/repos/asf/geode.git commit a2b6962d1092ff8b4fb582000b08a65ab9601edc Author: Nick Reich AuthorDate: Tue Mar 27 10:00:02 2018 -0700 GEODE-4947: Add test using MySQL for JDBC connector * Add rule for standing up Docker instance of MySQL to enable testing --- build.gradle | 1 + geode-connectors/build.gradle | 9 ++ .../TableMetaDataManagerMySqlIntegrationTest.java | 113 +++ .../test/junit/rules/DatabaseConnectionRule.java | 121 + .../test/junit/rules/MySqlConnectionRule.java | 44 .../src/test/resources/docker/mysql.yml| 12 ++ 6 files changed, 300 insertions(+) diff --git a/build.gradle b/build.gradle index cd76ede..c3f1604 100755 --- a/build.gradle +++ b/build.gradle @@ -18,6 +18,7 @@ buildscript { repositories { maven { url "https://plugins.gradle.org/m2/"; } +maven { url "https://dl.bintray.com/palantir/releases"; } jcenter() } diff --git a/geode-connectors/build.gradle b/geode-connectors/build.gradle index c2b55ba..432fbd5 100644 --- a/geode-connectors/build.gradle +++ b/geode-connectors/build.gradle @@ -15,15 +15,24 @@ * limitations under the License. */ +repositories { +maven { +url 'https://dl.bintray.com/palantir/releases' // docker-compose-rule is published on bintray +} +} + dependencies { compile project(':geode-core') compile project(':geode-common') compile group: 'com.zaxxer', name: 'HikariCP', version: project.'HikariCP.version' +compile group: 'mysql', name: 'mysql-connector-java', version: '5.1.46' + testCompile project(':geode-junit') //Connectors test framework. testRuntime 'org.apache.derby:derby:' + project.'derby.version' +testCompile 'com.palantir.docker.compose:docker-compose-rule-junit4:0.31.1' testCompile 'com.pholser:junit-quickcheck-core:' + project.'junit-quickcheck.version' testCompile 'com.pholser:junit-quickcheck-generators:' + project.'junit-quickcheck.version' testCompile files(project(':geode-core').sourceSets.test.output) diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/internal/TableMetaDataManagerMySqlIntegrationTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/internal/TableMetaDataManagerMySqlIntegrationTest.java new file mode 100644 index 000..25cac1b --- /dev/null +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/internal/TableMetaDataManagerMySqlIntegrationTest.java @@ -0,0 +1,113 @@ +/* + * 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 org.apache.geode.connectors.jdbc.internal; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.sql.Connection; +import java.sql.DatabaseMetaData; +import java.sql.Statement; +import java.sql.Types; + +import org.junit.After; +import org.junit.Before; +import org.junit.ClassRule; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import org.apache.geode.test.junit.categories.IntegrationTest; +import org.apache.geode.test.junit.rules.DatabaseConnectionRule; +import org.apache.geode.test.junit.rules.MySqlConnectionRule; + +@Category(IntegrationTest.class) +public class TableMetaDataManagerMySqlIntegrationTest { + + private static final String DB_NAME = "test"; + private static final String REGION_TABLE_NAME = "employees"; + + private TableMetaDataManager manager; + private Connection connection; + private Statement statement; + + @ClassRule + public static DatabaseConnectionRule dbRule = + new MySqlConnectionRule.Builder().file("src/test/resources/docker/mysql.yml") + .serviceName("db").port(3306).database(DB_NAME).build(); + + @Before + public void setup()
[geode] 02/23: GEODE-4947: Add Postgres test rule and test utilizing it
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/GEODE-4947 in repository https://gitbox.apache.org/repos/asf/geode.git commit 4e83237f15764a8f07ebd629f57436db3f696799 Author: Nick Reich AuthorDate: Tue Mar 27 10:38:10 2018 -0700 GEODE-4947: Add Postgres test rule and test utilizing it --- geode-connectors/build.gradle | 3 +- ...ableMetaDataManagerPostgresIntegrationTest.java | 114 + .../test/junit/rules/DatabaseConnectionRule.java | 10 +- .../test/junit/rules/MySqlConnectionRule.java | 14 +++ ...ectionRule.java => PostgresConnectionRule.java} | 13 +-- .../src/test/resources/docker/postgres.yml | 11 ++ 6 files changed, 153 insertions(+), 12 deletions(-) diff --git a/geode-connectors/build.gradle b/geode-connectors/build.gradle index 432fbd5..005f498 100644 --- a/geode-connectors/build.gradle +++ b/geode-connectors/build.gradle @@ -25,13 +25,14 @@ dependencies { compile project(':geode-core') compile project(':geode-common') compile group: 'com.zaxxer', name: 'HikariCP', version: project.'HikariCP.version' -compile group: 'mysql', name: 'mysql-connector-java', version: '5.1.46' testCompile project(':geode-junit') //Connectors test framework. testRuntime 'org.apache.derby:derby:' + project.'derby.version' +testCompile group: 'mysql', name: 'mysql-connector-java', version: '5.1.46' +testCompile group: 'org.postgresql', name: 'postgresql', version: '42.2.2' testCompile 'com.palantir.docker.compose:docker-compose-rule-junit4:0.31.1' testCompile 'com.pholser:junit-quickcheck-core:' + project.'junit-quickcheck.version' testCompile 'com.pholser:junit-quickcheck-generators:' + project.'junit-quickcheck.version' diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/internal/TableMetaDataManagerPostgresIntegrationTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/internal/TableMetaDataManagerPostgresIntegrationTest.java new file mode 100644 index 000..0538e13 --- /dev/null +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/internal/TableMetaDataManagerPostgresIntegrationTest.java @@ -0,0 +1,114 @@ +/* + * 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 org.apache.geode.connectors.jdbc.internal; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.sql.Connection; +import java.sql.DatabaseMetaData; +import java.sql.Statement; +import java.sql.Types; + +import org.junit.After; +import org.junit.Before; +import org.junit.ClassRule; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import org.apache.geode.test.junit.categories.IntegrationTest; +import org.apache.geode.test.junit.rules.DatabaseConnectionRule; +import org.apache.geode.test.junit.rules.MySqlConnectionRule; +import org.apache.geode.test.junit.rules.PostgresConnectionRule; + +@Category(IntegrationTest.class) +public class TableMetaDataManagerPostgresIntegrationTest { + + private static final String DB_NAME = "test"; + private static final String REGION_TABLE_NAME = "employees"; + + private TableMetaDataManager manager; + private Connection connection; + private Statement statement; + + @ClassRule + public static DatabaseConnectionRule dbRule = + new PostgresConnectionRule.Builder().file("src/test/resources/docker/postgres.yml") + .serviceName("db").port(5432).database(DB_NAME).build(); + + @Before + public void setup() throws Exception { +connection = dbRule.getConnection(); +statement = connection.createStatement(); +statement.execute("Create Table " + REGION_TABLE_NAME ++ " (id VARCHAR(10) primary key not null, name VARCHAR(10), age int)"); +manager = new TableMetaDataManager(); +DatabaseMetaData data = connection.getMetaData
[geode] branch feature/GEODE-4947 updated (c893970 -> 473d379)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a change to branch feature/GEODE-4947 in repository https://gitbox.apache.org/repos/asf/geode.git. omit c893970 caps omit 98f1190 GEODE-4947: Add geode-connectors to acceptance tests omit 7f544aa GEODE-4947: Remove ignore label from fixed test omit 8b7c2c3 GEODE-4947: Make tests that spin up Docker containers Acceptance Tests omit e794257 Revert "GEODE-4947: Make new category for tests that require external services" omit 5413739 GEODE-4947: Make new category for tests that require external services omit c3012e9 GEODE-4947: Remove duplicate code omit aaadc05 GEODE-4947: Downgrade docker compose version in config files omit e432f2b GEODE-4947: Cleanup omit 497b551 GEODE-4947: Fix issue with null character string in Postgres omit 71772e1 GEODE-4947: Fix MySQL test truncating timestamps omit 638f970 GEODE-4947: Protect against having no connection rule omit 17d3d60 GEODE-4947: Change resource paths omit fdc9867 GEODE-4947: Fix docker compose yml file references omit a383346 GEODE-4947: Improve pathing to docker compose resource files omit de0266f GEODE-4947: Fix spotless formatting omit 3fba92b GEODE-4947: Mark failing tests as ignored omit c2df29c GEODE-4947: Convert distributed tests to use mysql and postgres omit 7c00c0d GEODE-4947: Fix failing tests due to type conversions omit c0390ac GEODE-4947: Update integration tests to use mysql and postgres omit d776631 GEODE-4947: Add Derby connection rule omit 2f69e00 GEODE-4947: Add Postgres test rule and test utilizing it omit 687325b GEODE-4947: Add test using MySQL for JDBC connector add 755eaaa GEODE-4929: Add ability for tests to overide the default DiskDirs (#1701) add a4bae5c GEODE-4934: Throw exception if shutdown fails in GfshRule (#1699) add c42905c GEODE-4811: Add @Disabled "feature flag" annotation for gfsh commands. add 4bdd31c GEODE-4928 DistributedLockService doesn't work as expected while the dlock grantor is initialized add b55215d GEODE-3563: use a timeout for newly created sockets in TcpConduit.run() (#1671) add 956a671 GEODE-4974: Create single connection pool per cache (#1707) add ffc9c8b GEODE-4976: Fix misspelling and misattribution in test logging. (#1708) add 1b4d95a GEODE-4917: Remove dead and redundant code from LinkedStructSet. add 5fe3c76 GEODE-3820: Remove all invocations of Wait.pause(). (#1694) add 5809567 GEODE-4817: Add support for SSL to the experimental driver. (#1683) add 60614fb GEODE-4386: Return 'not found' if the JNDI binding does not exist (#1710) add 0297afd GEODE-4386: Correct check in the case where JNDI binding does not exist add c00512c Revert "GEODE-4386: Correct check in the case where JNDI binding does not exist" add 2d8d1a6 Revert "GEODE-4386: Return 'not found' if the JNDI binding does not exist (#1710)" add c2a06a1 GEODE-4980 CI failure: AutoConnectionSourceImplJUnitTest. testServerLocationUsedInListenerNotification add df252f1 GEODE-4817: Fix SSLTest. (#1714) add fce124f COMMIT THEN REVIEW: Fixed doc typos. add 4ba38c9 GEODE-4981 CI failure: SSLConfigurationFactoryJUnitTest.getNonSSLConfiguration add 8b8cef1 GEODE-4893: Improve reloading the cluster configuration on existing vanilla servers add 750417f GEODE-4867: Added query time expiration checks. (#1624) add 00ffcf5 GEODE-4386: Return 'not found' if the JNDI binding does not exist (#1713) add 5b21633 GEODE-3456: Fix display of 'null' hosts in Pulse UI (#1717) add e5e0c62 GEODE-4979: Incorrect description in docs of ResourcePermission in OQL add 69a6c33 GEODE-4981 CI failure: SSLConfigurationFactoryJUnitTest.getNonSSLConfiguration add d773cfd GEODE-4983 PluckStacks is no longer detecting idle executors and weeding them out add 7070fc9 GEODE-4872: handle Blob when reading from JDBC (#1692) add 132dfc8 GEODE-4867: Unused imports add 8894267 GEODE-4840: do not deserialize PdxInstances for remote gets (#1693) add caf588b Geode-4950 + GEODE-4951: Upgrade spotless version and reduce run time. add 31b51bd GEODE-4972: Move VersionManager to geode-old-versions module (#1703) add 912a1b2 GEODE-4902: Refactor LogMarker class and usage (#1678) add 6fa521e GEODE-4911: Deprecate DataSerializer.TRACE_SERIALIZABLE. (#1722) add 3c263e9 GEODE-4989 CQ reply message fromData method deserializes query results add 111b51d GEODE-4893: add test to make sure the callbacks will be loaded correctly (#1729) add 6b2d45a GEODE-4970: Overhaul and split up PartitionedRegionQueryDUnitTest (#1718) add 425f371 GEODE-4983 PluckStacks is no longer detecting idle exec
[geode] 07/23: GEODE-4947: Mark failing tests as ignored
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/GEODE-4947 in repository https://gitbox.apache.org/repos/asf/geode.git commit 720724ccc052c8490d2d23d2fe93515bb76c6041 Author: Nick Reich AuthorDate: Wed Mar 28 15:20:44 2018 -0700 GEODE-4947: Mark failing tests as ignored --- .../java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java index ed748f7..3688f5d 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JdbcDistributedTest.java @@ -35,6 +35,7 @@ import java.util.function.Consumer; import org.awaitility.Awaitility; import org.junit.After; import org.junit.Before; +import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.experimental.categories.Category; @@ -323,6 +324,7 @@ public abstract class JdbcDistributedTest implements Serializable { } @Test + @Ignore("GEODE-4922: MySQL is truncating the milliseconds from the timestamp") public void verifyDateToTimestamp() throws Exception { server = startupRule.startServerVM(1, x -> x.withConnectionToLocator(locator.getPort())); server.invoke(() -> { @@ -509,6 +511,7 @@ public abstract class JdbcDistributedTest implements Serializable { } @Test + @Ignore("GEODE-4833: Postgres does not support UTF-8 null character as contents of a string") public void clientPutsAndGetsWithNullFieldsWithPdxClassName() throws Exception { createTableForAllSupportedFields(); ClientVM client = getClientVM(); -- To stop receiving notification emails like this one, please contact aging...@apache.org.
[geode] 03/23: GEODE-4947: Add Derby connection rule
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/GEODE-4947 in repository https://gitbox.apache.org/repos/asf/geode.git commit 6603bdc9a1ccf9373157186052b3a67f38e9d059 Author: Nick Reich AuthorDate: Tue Mar 27 14:24:04 2018 -0700 GEODE-4947: Add Derby connection rule --- .../DerbyTableMetaDataManagerIntegrationTest.java | 43 .../MySqlTableMetaDataManagerIntegrationTest.java | 39 +++ ...ostgresTableMetaDataManagerIntegrationTest.java | 40 .../TableMetaDataManagerIntegrationTest.java | 28 +++-- .../TableMetaDataManagerMySqlIntegrationTest.java | 113 ...ableMetaDataManagerPostgresIntegrationTest.java | 114 - .../test/junit/rules/DatabaseConnectionRule.java | 103 +-- ...nRule.java => InMemoryDerbyConnectionRule.java} | 37 +++ .../test/junit/rules/MySqlConnectionRule.java | 4 +- .../test/junit/rules/PostgresConnectionRule.java | 4 +- ...ionRule.java => SqlDatabaseConnectionRule.java} | 6 +- 11 files changed, 165 insertions(+), 366 deletions(-) diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/internal/DerbyTableMetaDataManagerIntegrationTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/internal/DerbyTableMetaDataManagerIntegrationTest.java new file mode 100644 index 000..8f0ed43 --- /dev/null +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/internal/DerbyTableMetaDataManagerIntegrationTest.java @@ -0,0 +1,43 @@ +/* + * 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 org.apache.geode.connectors.jdbc.internal; + +import java.sql.Connection; +import java.sql.SQLException; + +import org.junit.Rule; +import org.junit.experimental.categories.Category; + +import org.apache.geode.test.junit.categories.IntegrationTest; +import org.apache.geode.test.junit.rules.DatabaseConnectionRule; +import org.apache.geode.test.junit.rules.InMemoryDerbyConnectionRule; + +@Category(IntegrationTest.class) +public class DerbyTableMetaDataManagerIntegrationTest extends TableMetaDataManagerIntegrationTest { + + @Rule + public DatabaseConnectionRule dbRule = new InMemoryDerbyConnectionRule(DB_NAME); + + @Override + protected Connection getConnection() throws SQLException { +return dbRule.getConnection(); + } + + @Override + protected void createTable() throws SQLException { +statement.execute("Create Table " + REGION_TABLE_NAME ++ " (\"id\" varchar(10) primary key not null, \"name\" varchar(10), \"age\" int)"); + } +} diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/internal/MySqlTableMetaDataManagerIntegrationTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/internal/MySqlTableMetaDataManagerIntegrationTest.java new file mode 100644 index 000..b69f88c --- /dev/null +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/internal/MySqlTableMetaDataManagerIntegrationTest.java @@ -0,0 +1,39 @@ +/* + * 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 org.apache.geode.connectors.jdbc.internal; + +import java.sql.Connection; +import java.sql.SQLException; + +import org.junit.ClassRule; +import org.junit.experimental.categories.Category; + +import org.apache.geode.test.junit.categ
[geode] branch develop updated: GEODE-4894: Changes are made to support case sensitivity between region, table name and pdx field, column name (#1663)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new da51fce GEODE-4894: Changes are made to support case sensitivity between region, table name and pdx field, column name (#1663) da51fce is described below commit da51fceefce757df055e3baaf8a4764a04b5ff66 Author: agingade AuthorDate: Fri Mar 23 16:16:15 2018 -0700 GEODE-4894: Changes are made to support case sensitivity between region, table name and pdx field, column name (#1663) * meta-data is now used to compute the column name * reads will now consult the pdx registry for an existing pdx type to use its field name. * Convert field name to lowercase only when column name is uppercase. * Table name lookup is changes to look for exact match first, than case insensitive match. * Field to column name lookup is changed to find exact column name or case insensitive match in the metadata. --- .../connectors/jdbc/internal/RegionMapping.java| 194 +++--- .../geode/connectors/jdbc/internal/SqlHandler.java | 41 ++- .../jdbc/internal/SqlStatementFactory.java | 14 +- .../jdbc/internal/SqlToPdxInstanceCreator.java | 15 +- .../connectors/jdbc/internal/TableMetaData.java| 29 ++- .../jdbc/internal/TableMetaDataManager.java| 24 +- .../jdbc/internal/TableMetaDataView.java | 6 + .../sanctioned-geode-connectors-serializables.txt | 2 +- .../jdbc/ClassWithSupportedPdxFields.java | 18 +- .../geode/connectors/jdbc/JdbcDUnitTest.java | 42 +-- .../connectors/jdbc/JdbcLoaderIntegrationTest.java | 5 + .../jdbc/internal/RegionMappingBuilderTest.java| 16 +- .../jdbc/internal/RegionMappingTest.java | 283 +++-- .../connectors/jdbc/internal/SqlHandlerTest.java | 24 +- .../jdbc/internal/SqlStatementFactoryTest.java | 17 +- .../jdbc/internal/SqlToPdxInstanceCreatorTest.java | 30 ++- .../TableMetaDataManagerIntegrationTest.java | 4 +- .../jdbc/internal/TableMetaDataManagerTest.java| 78 -- .../cli/CreateMappingCommandIntegrationTest.java | 8 +- .../cli/JdbcClusterConfigDistributedTest.java | 8 +- .../jdbc/internal/xml/ElementTypeTest.java | 4 +- .../geode/pdx/internal/ClientTypeRegistration.java | 16 ++ .../geode/pdx/internal/LonerTypeRegistration.java | 6 + .../geode/pdx/internal/NullTypeRegistration.java | 6 + .../geode/pdx/internal/PeerTypeRegistration.java | 32 ++- .../geode/pdx/internal/TypeRegistration.java | 9 +- .../apache/geode/pdx/internal/TypeRegistry.java| 9 + .../geode/cache/query/dunit/PdxQueryDUnitTest.java | 8 +- 28 files changed, 725 insertions(+), 223 deletions(-) diff --git a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/RegionMapping.java b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/RegionMapping.java index d87c4d5..b466443 100644 --- a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/RegionMapping.java +++ b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/RegionMapping.java @@ -17,9 +17,16 @@ package org.apache.geode.connectors.jdbc.internal; import java.io.Serializable; import java.util.Collections; import java.util.HashMap; +import java.util.HashSet; import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; import org.apache.geode.annotations.Experimental; +import org.apache.geode.connectors.jdbc.JdbcConnectorException; +import org.apache.geode.pdx.internal.PdxType; +import org.apache.geode.pdx.internal.TypeRegistry; @Experimental public class RegionMapping implements Serializable { @@ -28,37 +35,45 @@ public class RegionMapping implements Serializable { private final String tableName; private final String connectionConfigName; private final Boolean primaryKeyInValue; - private final Map fieldToColumnMap; - private final Map columnToFieldMap; + private final ConcurrentMap fieldToColumnMap; + private final ConcurrentMap columnToFieldMap; + + private final Map configuredFieldToColumnMap; + private final Map configuredColumnToFieldMap; public RegionMapping(String regionName, String pdxClassName, String tableName, String connectionConfigName, Boolean primaryKeyInValue, - Map fieldToColumnMap) { + Map configuredFieldToColumnMap) { this.regionName = regionName; this.pdxClassName = pdxClassName; this.tableName = tableName; this.connectionConfigName = connectionConfigName; this.primaryKeyInValue = primaryKeyInValue; -this.fieldToColumnMap = -fieldToColumnMap == null ? null : Collections.unmodifiableMap(fieldToColumnMap); -this.columnToFieldMap
[geode] branch develop updated: GEODE-4407 (#1499): Refactoring incremental backup logic
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new 2dfc8ae GEODE-4407 (#1499): Refactoring incremental backup logic 2dfc8ae is described below commit 2dfc8aee602d697702ef57bdaf7e12b4815572cf Author: agingade AuthorDate: Fri Feb 23 11:32:55 2018 -0800 GEODE-4407 (#1499): Refactoring incremental backup logic Removed dependency on target location while fetching backup files from source. --- .../apache/geode/internal/cache/DiskStoreImpl.java | 1 + .../org/apache/geode/internal/cache/Oplog.java | 49 + .../internal/cache/backup/BackupDefinition.java| 20 +- .../internal/cache/backup/BackupFileCopier.java| 4 +- .../{BackupDestination.java => BackupFilter.java} | 12 +- .../geode/internal/cache/backup/BackupService.java | 20 +- .../geode/internal/cache/backup/BackupTask.java| 240 +++-- .../{BackupDestination.java => BackupWriter.java} | 4 +- .../cache/{ => backup}/DiskStoreBackup.java| 13 +- .../cache/backup/FileSystemBackupDestination.java | 145 - .../cache/backup/FileSystemBackupWriter.java | 237 .../FileSystemIncrementalBackupLocation.java | 132 ...stination.java => IncrementalBackupFilter.java} | 25 ++- ...ination.java => IncrementalBackupLocation.java} | 13 +- .../geode/internal/cache/backup/RestoreScript.java | 4 + .../cache/backup/BackupDefinitionTest.java | 21 +- .../backup/BackupFileCopierIntegrationTest.java| 5 +- .../internal/cache/backup/BackupServiceTest.java | 5 +- ...onTest.java => FileSystemBackupWriterTest.java} | 69 +++--- .../FileSystemIncrementalBackupLocationTest.java | 189 .../backup/IncrementalBackupDistributedTest.java | 5 +- 21 files changed, 730 insertions(+), 483 deletions(-) diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java index 0ad8310..c4d8fa0 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java @@ -89,6 +89,7 @@ import org.apache.geode.i18n.StringId; import org.apache.geode.internal.Version; import org.apache.geode.internal.cache.ExportDiskRegion.ExportWriter; import org.apache.geode.internal.cache.backup.BackupService; +import org.apache.geode.internal.cache.backup.DiskStoreBackup; import org.apache.geode.internal.cache.entries.DiskEntry; import org.apache.geode.internal.cache.entries.DiskEntry.Helper.ValueWrapper; import org.apache.geode.internal.cache.entries.DiskEntry.RecoveredEntry; diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/Oplog.java b/geode-core/src/main/java/org/apache/geode/internal/cache/Oplog.java index 1a9a5844..00fb08e 100755 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/Oplog.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/Oplog.java @@ -1215,46 +1215,8 @@ public class Oplog implements CompactableOplog, Flushable { return matchingFiles; } - /** - * Returns a map of baseline oplog files to copy that match this oplog's files for a currently - * running backup. - * - * @param baselineOplogFiles a List of files to match this oplog's filenames against. - * @return a map of baslineline oplog files to copy. May be empty if total current set for this - * oplog does not match the baseline. - */ - public Map mapBaseline(Collection baselineOplogFiles) { -// Map of baseline oplog file name to oplog file -Map baselineOplogMap = -TransformUtils.transformAndMap(baselineOplogFiles, TransformUtils.fileNameTransformer); - -// Returned Map of baseline file to current oplog file -Map baselineToOplogMap = new HashMap<>(); - -// Check for crf existence -if ((null != this.crf.f) && this.crf.f.exists() -&& baselineOplogMap.containsKey(this.crf.f.getName())) { - baselineToOplogMap.put(baselineOplogMap.get(this.crf.f.getName()), - IOUtils.tryGetCanonicalFileElseGetAbsoluteFile(this.crf.f)); -} - -// Check for drf existence -if ((null != this.drf.f) && this.drf.f.exists() -&& baselineOplogMap.containsKey(this.drf.f.getName())) { - baselineToOplogMap.put(baselineOplogMap.get(this.drf.f.getName()), - IOUtils.tryGetCanonicalFileElseGetAbsoluteFile(this.drf.f)); -} - -// Check for krf existence -if (getParent().getDiskInitFile().hasKrf(this.oplogId)) { - File krfFile = getKrfFile(); - if (krfFile.exists() && baselineOplogMap.containsKey(krfFile.getName()
[geode] branch develop updated: GEODE-3800: Replace BackupManager with BackupService (#1372)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new 0f6e09c GEODE-3800: Replace BackupManager with BackupService (#1372) 0f6e09c is described below commit 0f6e09c4a162dc2fec411e7c6267e9d1de8c697e Author: agingade AuthorDate: Thu Feb 1 10:26:40 2018 -0800 GEODE-3800: Replace BackupManager with BackupService (#1372) * GEODE-3800: Convert backups into a service --- .../geode/internal/cache/DiskStoreFactoryImpl.java | 4 +- .../apache/geode/internal/cache/DiskStoreImpl.java | 11 ++- .../geode/internal/cache/GemFireCacheImpl.java | 23 ++ .../apache/geode/internal/cache/InternalCache.java | 8 +- .../org/apache/geode/internal/cache/Oplog.java | 4 +- .../internal/cache/PartitionedRegionDataStore.java | 8 +- .../{BackupManager.java => BackupService.java} | 68 +--- .../geode/internal/cache/backup/BackupTask.java| 3 +- .../cache/backup/FileSystemBackupDestination.java | 2 +- .../geode/internal/cache/backup/FinishBackup.java | 4 +- .../geode/internal/cache/backup/PrepareBackup.java | 4 +- .../cache/backup/TemporaryBackupFiles.java | 2 +- .../internal/cache/xmlcache/CacheCreation.java | 14 +--- .../geode/internal/i18n/LocalizedStrings.java | 2 +- .../internal/beans/MemberMBeanBridge.java | 9 +- .../cache/DiskStoreImplIntegrationTest.java| 4 +- .../cache/backup/BackupIntegrationTest.java| 35 +++- .../internal/cache/backup/BackupServiceTest.java | 95 ++ .../cache/backup/FinishBackupRequestTest.java | 6 +- .../beans/DistributedSystemBridgeJUnitTest.java| 25 +++--- 20 files changed, 196 insertions(+), 135 deletions(-) diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreFactoryImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreFactoryImpl.java index ce52220..672272a 100755 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreFactoryImpl.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreFactoryImpl.java @@ -21,7 +21,7 @@ import org.apache.geode.GemFireIOException; import org.apache.geode.cache.DiskStore; import org.apache.geode.cache.DiskStoreFactory; import org.apache.geode.distributed.internal.ResourceEvent; -import org.apache.geode.internal.cache.backup.BackupManager; +import org.apache.geode.internal.cache.backup.BackupService; import org.apache.geode.internal.cache.xmlcache.CacheCreation; import org.apache.geode.internal.cache.xmlcache.CacheXml; import org.apache.geode.internal.cache.xmlcache.DiskStoreAttributesCreation; @@ -160,7 +160,7 @@ public class DiskStoreFactoryImpl implements DiskStoreFactory { // member depends on state that goes into this disk store // that isn't backed up. if (this.cache instanceof GemFireCacheImpl) { - BackupManager backup = this.cache.getBackupManager(); + BackupService backup = this.cache.getBackupService(); if (backup != null) { backup.waitForBackup(); } diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java index 5aa153a..f0959b8 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java @@ -56,7 +56,6 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicReference; -import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; import java.util.concurrent.locks.ReentrantReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock; @@ -89,7 +88,7 @@ import org.apache.geode.distributed.internal.membership.InternalDistributedMembe import org.apache.geode.i18n.StringId; import org.apache.geode.internal.Version; import org.apache.geode.internal.cache.ExportDiskRegion.ExportWriter; -import org.apache.geode.internal.cache.backup.BackupManager; +import org.apache.geode.internal.cache.backup.BackupService; import org.apache.geode.internal.cache.entries.DiskEntry; import org.apache.geode.internal.cache.entries.DiskEntry.Helper.ValueWrapper; import org.apache.geode.internal.cache.entries.DiskEntry.RecoveredEntry; @@ -1995,7 +1994,7 @@ public class DiskStoreImpl implements DiskStore { try { List backupDirectories = Files.list(directoryHolder.getDir().toPath()) .filter((path) -> path.getFileName().toString() -.startsWith(BackupManager.DATA_STORES_TEMPORARY_DIRECTORY)) +
[geode] 01/02: GEODE-3554: Add javadoc warning about getAnyInstance in CacheCallback
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git commit 7fc5d6e93c66f3a3b0bd4a4cfec5f9a5c20425d2 Author: Anil AuthorDate: Thu Jan 18 14:26:41 2018 -0800 GEODE-3554: Add javadoc warning about getAnyInstance in CacheCallback --- geode-core/src/main/java/org/apache/geode/cache/CacheFactory.java | 6 ++ 1 file changed, 6 insertions(+) diff --git a/geode-core/src/main/java/org/apache/geode/cache/CacheFactory.java b/geode-core/src/main/java/org/apache/geode/cache/CacheFactory.java index 5857927..9de3168 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/CacheFactory.java +++ b/geode-core/src/main/java/org/apache/geode/cache/CacheFactory.java @@ -307,6 +307,12 @@ public class CacheFactory { * Gets an arbitrary open instance of {@link Cache} produced by an earlier call to * {@link #create()}. * + * + * WARNING: To avoid risk of deadlock, do not invoke getAnyInstance() from within any + * CacheCallback including CacheListener, CacheLoader, CacheWriter, TransactionListener, + * TransactionWriter. + * + * * @throws CacheClosedException if a cache has not been created or the only created one is * {@link Cache#isClosed closed} */ -- To stop receiving notification emails like this one, please contact aging...@apache.org.
[geode] branch feature/GEODE-3554 deleted (was b651c0a)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a change to branch feature/GEODE-3554 in repository https://gitbox.apache.org/repos/asf/geode.git. was b651c0a GEODE-3554: Add additional javadoc about how to get Cache. The revisions that were on this branch are still contained in other references; therefore, this change does not discard any commits from the repository. -- To stop receiving notification emails like this one, please contact aging...@apache.org.
[geode] branch develop updated (4f0c0b1 -> ec53f62)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a change to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git. from 4f0c0b1 GEODE-4333: add unit tests for AbstractRegionMap.destroy (#1314) new 7fc5d6e GEODE-3554: Add javadoc warning about getAnyInstance in CacheCallback new ec53f62 GEODE-3554: Add additional javadoc about how to get Cache. The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: geode-core/src/main/java/org/apache/geode/cache/CacheFactory.java | 8 .../src/main/java/org/apache/geode/cache/CacheListener.java | 7 ++- geode-core/src/main/java/org/apache/geode/cache/CacheLoader.java | 5 - geode-core/src/main/java/org/apache/geode/cache/CacheWriter.java | 4 .../src/main/java/org/apache/geode/cache/TransactionListener.java | 4 +++- .../src/main/java/org/apache/geode/cache/TransactionWriter.java | 5 + 6 files changed, 30 insertions(+), 3 deletions(-) -- To stop receiving notification emails like this one, please contact aging...@apache.org.
[geode] 02/02: GEODE-3554: Add additional javadoc about how to get Cache.
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git commit ec53f620359f85b4d3c0063b34ec5911e84c50c9 Author: Anil AuthorDate: Fri Jan 19 16:06:20 2018 -0800 GEODE-3554: Add additional javadoc about how to get Cache. --- geode-core/src/main/java/org/apache/geode/cache/CacheFactory.java | 4 +++- geode-core/src/main/java/org/apache/geode/cache/CacheListener.java | 7 ++- geode-core/src/main/java/org/apache/geode/cache/CacheLoader.java | 5 - geode-core/src/main/java/org/apache/geode/cache/CacheWriter.java | 4 .../src/main/java/org/apache/geode/cache/TransactionListener.java | 4 +++- .../src/main/java/org/apache/geode/cache/TransactionWriter.java| 5 + 6 files changed, 25 insertions(+), 4 deletions(-) diff --git a/geode-core/src/main/java/org/apache/geode/cache/CacheFactory.java b/geode-core/src/main/java/org/apache/geode/cache/CacheFactory.java index 9de3168..2253672 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/CacheFactory.java +++ b/geode-core/src/main/java/org/apache/geode/cache/CacheFactory.java @@ -310,7 +310,9 @@ public class CacheFactory { * * WARNING: To avoid risk of deadlock, do not invoke getAnyInstance() from within any * CacheCallback including CacheListener, CacheLoader, CacheWriter, TransactionListener, - * TransactionWriter. + * TransactionWriter. Instead use EntryEvent.getRegion().getCache(), + * RegionEvent.getRegion().getCache(), LoaderHelper.getRegion().getCache(), or + * TransactionEvent.getCache(). * * * @throws CacheClosedException if a cache has not been created or the only created one is diff --git a/geode-core/src/main/java/org/apache/geode/cache/CacheListener.java b/geode-core/src/main/java/org/apache/geode/cache/CacheListener.java index cb7f2ef..fd268ea 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/CacheListener.java +++ b/geode-core/src/main/java/org/apache/geode/cache/CacheListener.java @@ -40,6 +40,12 @@ package org.apache.geode.cache; * access the region and must not wait for that thread to complete the task. * * + * + * WARNING: To avoid risk of deadlock, do not invoke CacheFactory.getAnyInstance() from within any + * callback methods. Instead use EntryEvent.getRegion().getCache() or + * RegionEvent.getRegion().getCache(). + * + * * Concurrency * * Multiple events, on different entries, can cause concurrent invocation of @@ -52,7 +58,6 @@ package org.apache.geode.cache; * To declare a CacheListener in a Cache XML file, it must also implement {@link Declarable} * * - * * @see AttributesFactory#addCacheListener * @see AttributesFactory#initCacheListeners * @see RegionAttributes#getCacheListeners diff --git a/geode-core/src/main/java/org/apache/geode/cache/CacheLoader.java b/geode-core/src/main/java/org/apache/geode/cache/CacheLoader.java index 8812816..9c7a25d 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/CacheLoader.java +++ b/geode-core/src/main/java/org/apache/geode/cache/CacheLoader.java @@ -24,7 +24,10 @@ package org.apache.geode.cache; * hosted by another member of the distributed system. * * - * + * + * WARNING: To avoid risk of deadlock, do not invoke CacheFactory.getAnyInstance() from within any + * callback methods. Instead use LoaderHelper.getRegion().getCache(). + * * * @see AttributesFactory#setCacheLoader * @see RegionAttributes#getCacheLoader diff --git a/geode-core/src/main/java/org/apache/geode/cache/CacheWriter.java b/geode-core/src/main/java/org/apache/geode/cache/CacheWriter.java index a3f33be..a60a4b8 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/CacheWriter.java +++ b/geode-core/src/main/java/org/apache/geode/cache/CacheWriter.java @@ -37,6 +37,10 @@ package org.apache.geode.cache; * initiator of the operation, regardless of whether the initiator is in the same VM as the * CacheWriter. * + * + * WARNING: To avoid risk of deadlock, do not invoke CacheFactory.getAnyInstance() from within any + * callback methods. Instead use EntryEvent.getRegion().getCache() or + * RegionEvent.getRegion().getCache(). * * @see AttributesFactory#setCacheWriter * @see RegionAttributes#getCacheWriter diff --git a/geode-core/src/main/java/org/apache/geode/cache/TransactionListener.java b/geode-core/src/main/java/org/apache/geode/cache/TransactionListener.java index 4beb167..b1f8c3d 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/TransactionListener.java +++ b/geode-core/src/main/java/org/apache/geode/cache/TransactionListener.java @@ -31,12 +31,14 @@ package org.apache.geode.cache; * * Rollback and failed commit operations are local. * + * + * WARNING: To avoid risk of deadlock, do not invoke CacheFactory.getAnyInstance() from within any + * callback methods. Instead use TransactionEvent.getCache(). * * @see CacheTransactionManager
[geode] branch feature/GEODE-3554 updated: GEODE-3554: Add additional javadoc about how to get Cache.
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/GEODE-3554 in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/feature/GEODE-3554 by this push: new b651c0a GEODE-3554: Add additional javadoc about how to get Cache. b651c0a is described below commit b651c0aa94ff26b1ba8b56c3f2029ec785be4fe6 Author: Anil AuthorDate: Fri Jan 19 16:06:20 2018 -0800 GEODE-3554: Add additional javadoc about how to get Cache. --- geode-core/src/main/java/org/apache/geode/cache/CacheFactory.java | 4 +++- geode-core/src/main/java/org/apache/geode/cache/CacheListener.java | 7 ++- geode-core/src/main/java/org/apache/geode/cache/CacheLoader.java | 5 - geode-core/src/main/java/org/apache/geode/cache/CacheWriter.java | 4 .../src/main/java/org/apache/geode/cache/TransactionListener.java | 4 +++- .../src/main/java/org/apache/geode/cache/TransactionWriter.java| 5 + 6 files changed, 25 insertions(+), 4 deletions(-) diff --git a/geode-core/src/main/java/org/apache/geode/cache/CacheFactory.java b/geode-core/src/main/java/org/apache/geode/cache/CacheFactory.java index 9de3168..2253672 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/CacheFactory.java +++ b/geode-core/src/main/java/org/apache/geode/cache/CacheFactory.java @@ -310,7 +310,9 @@ public class CacheFactory { * * WARNING: To avoid risk of deadlock, do not invoke getAnyInstance() from within any * CacheCallback including CacheListener, CacheLoader, CacheWriter, TransactionListener, - * TransactionWriter. + * TransactionWriter. Instead use EntryEvent.getRegion().getCache(), + * RegionEvent.getRegion().getCache(), LoaderHelper.getRegion().getCache(), or + * TransactionEvent.getCache(). * * * @throws CacheClosedException if a cache has not been created or the only created one is diff --git a/geode-core/src/main/java/org/apache/geode/cache/CacheListener.java b/geode-core/src/main/java/org/apache/geode/cache/CacheListener.java index cb7f2ef..fd268ea 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/CacheListener.java +++ b/geode-core/src/main/java/org/apache/geode/cache/CacheListener.java @@ -40,6 +40,12 @@ package org.apache.geode.cache; * access the region and must not wait for that thread to complete the task. * * + * + * WARNING: To avoid risk of deadlock, do not invoke CacheFactory.getAnyInstance() from within any + * callback methods. Instead use EntryEvent.getRegion().getCache() or + * RegionEvent.getRegion().getCache(). + * + * * Concurrency * * Multiple events, on different entries, can cause concurrent invocation of @@ -52,7 +58,6 @@ package org.apache.geode.cache; * To declare a CacheListener in a Cache XML file, it must also implement {@link Declarable} * * - * * @see AttributesFactory#addCacheListener * @see AttributesFactory#initCacheListeners * @see RegionAttributes#getCacheListeners diff --git a/geode-core/src/main/java/org/apache/geode/cache/CacheLoader.java b/geode-core/src/main/java/org/apache/geode/cache/CacheLoader.java index 8812816..9c7a25d 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/CacheLoader.java +++ b/geode-core/src/main/java/org/apache/geode/cache/CacheLoader.java @@ -24,7 +24,10 @@ package org.apache.geode.cache; * hosted by another member of the distributed system. * * - * + * + * WARNING: To avoid risk of deadlock, do not invoke CacheFactory.getAnyInstance() from within any + * callback methods. Instead use LoaderHelper.getRegion().getCache(). + * * * @see AttributesFactory#setCacheLoader * @see RegionAttributes#getCacheLoader diff --git a/geode-core/src/main/java/org/apache/geode/cache/CacheWriter.java b/geode-core/src/main/java/org/apache/geode/cache/CacheWriter.java index a3f33be..a60a4b8 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/CacheWriter.java +++ b/geode-core/src/main/java/org/apache/geode/cache/CacheWriter.java @@ -37,6 +37,10 @@ package org.apache.geode.cache; * initiator of the operation, regardless of whether the initiator is in the same VM as the * CacheWriter. * + * + * WARNING: To avoid risk of deadlock, do not invoke CacheFactory.getAnyInstance() from within any + * callback methods. Instead use EntryEvent.getRegion().getCache() or + * RegionEvent.getRegion().getCache(). * * @see AttributesFactory#setCacheWriter * @see RegionAttributes#getCacheWriter diff --git a/geode-core/src/main/java/org/apache/geode/cache/TransactionListener.java b/geode-core/src/main/java/org/apache/geode/cache/TransactionListener.java index 4beb167..b1f8c3d 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/TransactionListener.java +++ b/geode-core/src/main/java/org/apache/geode/cache/TransactionListener.java @@ -31,12 +31,14 @@ package org.apache.geode.cache; * * Rollback and failed commit operations are local
[geode] branch feature/GEODE-3322 deleted (was 1df0d7c)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a change to branch feature/GEODE-3322 in repository https://gitbox.apache.org/repos/asf/geode.git. was 1df0d7c GEODE-3322: Fix javadoc warnings The revisions that were on this branch are still contained in other references; therefore, this change does not discard any commits from the repository. -- To stop receiving notification emails like this one, please contact ['"commits@geode.apache.org" '].
[geode] branch develop updated: GEODE-3322: Fix javadoc warnings
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new cb3baf3 GEODE-3322: Fix javadoc warnings cb3baf3 is described below commit cb3baf3bc9da743a9329ea98d9b9a9d00afb16d3 Author: Anil AuthorDate: Thu Jan 18 11:09:55 2018 -0800 GEODE-3322: Fix javadoc warnings --- .../src/main/java/org/apache/geode/internal/offheap/OffHeapHelper.java | 3 ++- geode-core/src/main/java/org/apache/geode/internal/tcp/package.html| 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/geode-core/src/main/java/org/apache/geode/internal/offheap/OffHeapHelper.java b/geode-core/src/main/java/org/apache/geode/internal/offheap/OffHeapHelper.java index 72d0b86..b54e95b 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/offheap/OffHeapHelper.java +++ b/geode-core/src/main/java/org/apache/geode/internal/offheap/OffHeapHelper.java @@ -42,7 +42,8 @@ public class OffHeapHelper { } /** - * Just like {@link #copyIfNeeded(Object)} except that if off-heap is copied it is also released. + * Just like {@link #copyIfNeeded(Object, InternalCache)} except that if off-heap is copied it is + * also released. * * @param v If this value is off-heap then the caller must have already retained it. * @return the heap copy to use in place of v diff --git a/geode-core/src/main/java/org/apache/geode/internal/tcp/package.html b/geode-core/src/main/java/org/apache/geode/internal/tcp/package.html index 442d75a..6b1ccf3 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/tcp/package.html +++ b/geode-core/src/main/java/org/apache/geode/internal/tcp/package.html @@ -29,7 +29,7 @@ set to true, which is the default setting. When used in this way, the conduit manages the serialization and transmission of {@link org.apache.geode.distributed.internal.DistributionMessage} objects from one system to another. The -{@link org.apache.geode.distributed.internal.membershp.MembershipManager} +{@link org.apache.geode.distributed.internal.membership.MembershipManager} routes outgoing messages to TCPConduit and handles receipt of messages received by TCPConduit {@link org.apache.geode.internal.tcp.Connection "Connections"}. -- To stop receiving notification emails like this one, please contact ['"commits@geode.apache.org" '].
[geode] branch feature/GEODE-3583-storage updated: GEODE-4202: Remove GemFireCacheImpl.getInstance from PartitionedRegion
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/GEODE-3583-storage in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/feature/GEODE-3583-storage by this push: new f5449ae GEODE-4202: Remove GemFireCacheImpl.getInstance from PartitionedRegion f5449ae is described below commit f5449aec9412fbdbe67e2218294760338c47bcad Author: Anil AuthorDate: Fri Jan 12 15:44:00 2018 -0800 GEODE-4202: Remove GemFireCacheImpl.getInstance from PartitionedRegion --- .../java/org/apache/geode/internal/cache/PartitionedRegion.java | 8 1 file changed, 8 deletions(-) diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java index 701f140..347a114 100755 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java @@ -595,14 +595,6 @@ public class PartitionedRegion extends LocalRegion } public Object getRegion(Object key) throws PRLocallyDestroyedException { - if (cleared) { -Cache cache = GemFireCacheImpl.getInstance(); -if (cache == null) { - throw new CacheClosedException(); -} else { - cache.getCancelCriterion().checkCancelInProgress(null); -} - } Assert.assertTrue(key instanceof Integer); Object o = super.get(key); -- To stop receiving notification emails like this one, please contact ['"commits@geode.apache.org" '].
[geode] branch feature/GEODE-3583-storage updated: GEODE-4208: remove GemFireCacheImpl.getInstance from DistTxEntryEvent
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/GEODE-3583-storage in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/feature/GEODE-3583-storage by this push: new ef9a316 GEODE-4208: remove GemFireCacheImpl.getInstance from DistTxEntryEvent ef9a316 is described below commit ef9a3168095de1d2f0bf020bb36b4da15fdf8496 Author: Anil AuthorDate: Fri Jan 12 15:28:53 2018 -0800 GEODE-4208: remove GemFireCacheImpl.getInstance from DistTxEntryEvent --- .../apache/geode/internal/cache/DistTXState.java | 10 .../geode/internal/cache/EntryEventImpl.java | 2 +- .../geode/internal/cache/tx/DistTxEntryEvent.java | 27 +- .../codeAnalysis/sanctionedDataSerializables.txt | 4 ++-- 4 files changed, 29 insertions(+), 14 deletions(-) diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/DistTXState.java b/geode-core/src/main/java/org/apache/geode/internal/cache/DistTXState.java index 30850bc..8276316 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/DistTXState.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/DistTXState.java @@ -22,6 +22,7 @@ import java.util.Map.Entry; import java.util.Set; import java.util.TreeMap; +import org.apache.geode.InternalGemFireException; import org.apache.geode.InvalidDeltaException; import org.apache.geode.SystemFailure; import org.apache.geode.cache.CacheWriterException; @@ -368,11 +369,20 @@ public class DistTXState extends TXState { } dtop.setDistributedMember(sender); dtop.setOriginRemote(false); + /* * [DISTTX} TODO handle call back argument version tag and other settings in PutMessage */ String failureReason = null; try { + if (dtop.getRegion() == null) { +// Tx event from the peer. +if (dtop.getRegionName() == null) { + throw new InternalGemFireException("Region is unavailable on DistTxEntryEvent."); +} +dtop.setRegion((LocalRegion) getCache().getRegion(dtop.getRegionName())); + } + if (dtop.getKeyInfo().isDistKeyInfo()) { dtop.getKeyInfo().setCheckPrimary(false); } else { diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/EntryEventImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/EntryEventImpl.java index 95d87be..575417a 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/EntryEventImpl.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/EntryEventImpl.java @@ -516,7 +516,7 @@ public class EntryEventImpl setEventFlag(EventFlags.FLAG_LOCAL_INVALID, b); } - void setGenerateCallbacks(boolean b) { + public void setGenerateCallbacks(boolean b) { setEventFlag(EventFlags.FLAG_GENERATE_CALLBACKS, b); } diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tx/DistTxEntryEvent.java b/geode-core/src/main/java/org/apache/geode/internal/cache/tx/DistTxEntryEvent.java index 2702ccd..85d1bad 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/tx/DistTxEntryEvent.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tx/DistTxEntryEvent.java @@ -42,6 +42,8 @@ public class DistTxEntryEvent extends EntryEventImpl { protected static final byte HAS_PUTALL_OP = 0x1; protected static final byte HAS_REMOVEALL_OP = 0x2; + private String regionName; + /** * TODO DISTTX: callers of this constructor need to make sure that release is called. In general * the distributed tx code needs to be reviewed to see if it correctly handles off-heap. @@ -54,6 +56,10 @@ public class DistTxEntryEvent extends EntryEventImpl { // For Serialization public DistTxEntryEvent() {} + public String getRegionName() { +return this.regionName; + } + @Override public Version[] getSerializationVersions() { // TODO Auto-generated method stub @@ -96,9 +102,7 @@ public class DistTxEntryEvent extends EntryEventImpl { @Override public void fromData(DataInput in) throws IOException, ClassNotFoundException { this.eventID = (EventID) DataSerializer.readObject(in); -String regionName = DataSerializer.readString(in); -InternalCache cache = GemFireCacheImpl.getInstance(); -this.region = (LocalRegion) cache.getRegion(regionName); +this.regionName = DataSerializer.readString(in); this.op = Operation.fromOrdinal(in.readByte()); Object key = DataSerializer.readObject(in); Integer bucketId = DataSerializer.readInteger(in); @@ -168,11 +172,11 @@ public class DistTxEntryEvent extends EntryEventImpl { } } } -// TODO DISTTX: release this event? -EntryEventImpl e = EntryEventImpl.create(this.region, Operation.PUTALL_CREATE, null, null, null, -
[geode] branch feature/GEODE-3583-storage updated: GEODE-4203: Remove GemFireCacheImpl.getInstance from PartitionedRegionHelper
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/GEODE-3583-storage in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/feature/GEODE-3583-storage by this push: new 0530964 GEODE-4203: Remove GemFireCacheImpl.getInstance from PartitionedRegionHelper 0530964 is described below commit 0530964e9a960e1b1174826e8d92e44f6f44dc48 Author: Anil AuthorDate: Wed Jan 10 16:27:27 2018 -0800 GEODE-4203: Remove GemFireCacheImpl.getInstance from PartitionedRegionHelper --- .../apache/geode/internal/cache/CloseCacheMessage.java | 2 +- .../geode/internal/cache/PartitionedRegionHelper.java| 16 ++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/CloseCacheMessage.java b/geode-core/src/main/java/org/apache/geode/internal/cache/CloseCacheMessage.java index fccda69..523eaf6 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/CloseCacheMessage.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/CloseCacheMessage.java @@ -57,7 +57,7 @@ public class CloseCacheMessage extends HighPriorityDistributionMessage implement boolean systemError = false; try { try { -PartitionedRegionHelper.cleanUpMetaDataOnNodeFailure(getSender()); +PartitionedRegionHelper.cleanUpMetaDataOnNodeFailure(dm.getCache(), getSender()); } catch (VirtualMachineError err) { systemError = true; SystemFailure.initiateFailure(err); diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionHelper.java b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionHelper.java index cb0fd0c..592e16f 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionHelper.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionHelper.java @@ -271,7 +271,7 @@ public class PartitionedRegionHelper { root = (DistributedRegion) cache.createVMRegion(PR_ROOT_REGION_NAME, ra, new InternalRegionArguments().setIsUsedForPartitionedRegionAdmin(true) .setInternalRegion(true).setCachePerfStatsHolder(prMetaStatsHolder)); -root.getDistributionAdvisor().addMembershipListener(new MemberFailureListener()); +root.getDistributionAdvisor().addMembershipListener(new MemberFailureListener(cache)); } catch (RegionExistsException ignore) { // we avoid this before hand, but yet we have to catch it root = (DistributedRegion) cache.getRegion(PR_ROOT_REGION_NAME, true); @@ -305,15 +305,13 @@ public class PartitionedRegionHelper { * Clean the config meta data for a DistributedMember which has left the DistributedSystem, one * PartitionedRegion at a time. */ - public static void cleanUpMetaDataOnNodeFailure(DistributedMember failedMemId) { + public static void cleanUpMetaDataOnNodeFailure(InternalCache cache, + DistributedMember failedMemId) { try { - final InternalCache cache = GemFireCacheImpl.getInstance(); if (cache == null || cache.getCancelCriterion().isCancelInProgress()) { return; } - DistributionManager dm = cache.getInternalDistributedSystem().getDistributionManager(); - if (logger.isDebugEnabled()) { logger.debug("Cleaning PartitionedRegion meta data for memberId={}", failedMemId); } @@ -932,12 +930,18 @@ public class PartitionedRegionHelper { private static class MemberFailureListener implements MembershipListener { +InternalCache cache = null; + +MemberFailureListener(InternalCache cache) { + this.cache = cache; +} + public void memberJoined(InternalDistributedMember id) { } public void memberDeparted(final InternalDistributedMember id, boolean crashed) { - PartitionedRegionHelper.cleanUpMetaDataOnNodeFailure(id); + PartitionedRegionHelper.cleanUpMetaDataOnNodeFailure(cache, id); } public void memberSuspect(InternalDistributedMember id, InternalDistributedMember whoSuspected, -- To stop receiving notification emails like this one, please contact ['"commits@geode.apache.org" '].
[geode] branch feature/GEODE-3583-storage updated: GEODE-4201: Remove GemFireCacheImpl.getInstance in PartitionAttributesImpl
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/GEODE-3583-storage in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/feature/GEODE-3583-storage by this push: new e8fd9e4 GEODE-4201: Remove GemFireCacheImpl.getInstance in PartitionAttributesImpl e8fd9e4 is described below commit e8fd9e419608423452b5bfb6beff8eca2a0f0d94 Author: Anil AuthorDate: Wed Jan 10 15:05:02 2018 -0800 GEODE-4201: Remove GemFireCacheImpl.getInstance in PartitionAttributesImpl --- .../internal/cache/PartitionAttributesImpl.java| 3 +- .../cache/PartitionRegionConfigValidator.java | 2 +- .../cache/PartitionAttributesImplJUnitTest.java| 47 ++ 3 files changed, 49 insertions(+), 3 deletions(-) diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionAttributesImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionAttributesImpl.java index e97e983..37ad335 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionAttributesImpl.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionAttributesImpl.java @@ -651,11 +651,10 @@ public class PartitionAttributesImpl implements PartitionAttributes, Cloneable, * * @since GemFire 5.8Beta */ - void validateColocation() { + void validateColocation(Cache cache) { if (this.colocatedRegionName == null) { return; } -Cache cache = GemFireCacheImpl.getInstance(); if (cache != null) { Region region = cache.getRegion(this.colocatedRegionName); if (region == null) { diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionRegionConfigValidator.java b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionRegionConfigValidator.java index 9f08f99..726cea6 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionRegionConfigValidator.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionRegionConfigValidator.java @@ -301,7 +301,7 @@ public class PartitionRegionConfigValidator { final PartitionAttributesImpl userPA = (PartitionAttributesImpl) pr.getAttributes().getPartitionAttributes(); -userPA.validateColocation(); // do this here to fix bug 47197 +userPA.validateColocation(pr.getCache()); // do this here to fix bug 47197 PartitionedRegion colocatedPR = ColocationHelper.getColocatedRegion(pr); if (colocatedPR != null) { diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionAttributesImplJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionAttributesImplJUnitTest.java index b5fcbff..6c37da5 100755 --- a/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionAttributesImplJUnitTest.java +++ b/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionAttributesImplJUnitTest.java @@ -14,7 +14,13 @@ */ package org.apache.geode.internal.cache; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.Assert.*; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; import java.util.Properties; @@ -23,11 +29,14 @@ import org.junit.Ignore; import org.junit.Test; import org.junit.experimental.categories.Category; +import org.apache.geode.cache.Cache; import org.apache.geode.cache.EntryOperation; +import org.apache.geode.cache.PartitionAttributes; import org.apache.geode.cache.PartitionAttributesFactory; import org.apache.geode.cache.PartitionResolver; import org.apache.geode.cache.Region; import org.apache.geode.cache.partition.PartitionListener; +import org.apache.geode.test.fake.Fakes; import org.apache.geode.test.junit.categories.UnitTest; /** @@ -61,6 +70,7 @@ public class PartitionAttributesImplJUnitTest { private FixedPartitionAttributesImpl fixedPartitionAttributes; private PartitionListener partitionListener; + private Cache cache; @Before public void before() { @@ -78,6 +88,7 @@ public class PartitionAttributesImplJUnitTest { this.localMaxMemory = 123; this.offHeap = false; +this.cache = Fakes.cache(); this.partitionResolver = new PartitionResolver() { @Override @@ -473,6 +484,42 @@ public class PartitionAttributesImplJUnitTest { assertNotEquals(instance, other); } + @Test + public void validateColocationWithNonExistingRegion() { +PartitionAttributesImpl instance = createPartitionAttributesImpl(); +instance.setColocatedWith("nonExistingRegion"); +assertThatThrownBy(() -> instance.validateColocation(cache)) +.isInstanceOf(IllegalStateException.class) +.hasMessageContaining(
[geode] branch feature/GEODE-4241 deleted (was b349a56)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a change to branch feature/GEODE-4241 in repository https://gitbox.apache.org/repos/asf/geode.git. was b349a56 GEODE-4241: Write region mapping to cluster configuration The revisions that were on this branch are still contained in other references; therefore, this change does not discard any commits from the repository. -- To stop receiving notification emails like this one, please contact ['"commits@geode.apache.org" '].
[geode] branch develop updated: GEODE-4241: Write region mapping to cluster configuration
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new 3bc3b51 GEODE-4241: Write region mapping to cluster configuration 3bc3b51 is described below commit 3bc3b51f5175079d23b3bab0824817c98cecb19a Author: Anil AuthorDate: Tue Jan 9 15:30:46 2018 -0800 GEODE-4241: Write region mapping to cluster configuration When field mapping is not provided, cluster configuration for region mapping was not working. --- .../xml/JdbcConnectorServiceXmlGenerator.java | 13 +- .../cli/CreateMappingCommandDUnitTest.java | 22 ...onnectorServiceXmlGeneratorIntegrationTest.java | 30 ++ 3 files changed, 59 insertions(+), 6 deletions(-) diff --git a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/xml/JdbcConnectorServiceXmlGenerator.java b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/xml/JdbcConnectorServiceXmlGenerator.java index 70f9540..205fbf2 100644 --- a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/xml/JdbcConnectorServiceXmlGenerator.java +++ b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/xml/JdbcConnectorServiceXmlGenerator.java @@ -131,16 +131,17 @@ public class JdbcConnectorServiceXmlGenerator implements XmlGenerator { Boolean.toString(mapping.isPrimaryKeyInValue())); } -if (mapping.getFieldToColumnMap() != null) { - XmlGeneratorUtils.startElement(handler, PREFIX, ElementType.REGION_MAPPING.getTypeName(), - attributes); - addFieldMappings(handler, mapping.getFieldToColumnMap()); - XmlGeneratorUtils.endElement(handler, PREFIX, ElementType.REGION_MAPPING.getTypeName()); -} +XmlGeneratorUtils.startElement(handler, PREFIX, ElementType.REGION_MAPPING.getTypeName(), +attributes); +addFieldMappings(handler, mapping.getFieldToColumnMap()); +XmlGeneratorUtils.endElement(handler, PREFIX, ElementType.REGION_MAPPING.getTypeName()); } private void addFieldMappings(ContentHandler handler, Map fieldMappings) throws SAXException { +if (fieldMappings == null) { + return; +} for (Map.Entry fieldMapping : fieldMappings.entrySet()) { AttributesImpl fieldAttributes = new AttributesImpl(); XmlGeneratorUtils.addAttribute(fieldAttributes, FIELD_NAME, fieldMapping.getKey()); diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/internal/cli/CreateMappingCommandDUnitTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/internal/cli/CreateMappingCommandDUnitTest.java index 4ac9f67..552cd23 100644 --- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/internal/cli/CreateMappingCommandDUnitTest.java +++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/internal/cli/CreateMappingCommandDUnitTest.java @@ -78,6 +78,8 @@ public class CreateMappingCommandDUnitTest { String xml = InternalLocator.getLocator().getSharedConfiguration().getConfiguration("cluster") .getCacheXmlContent(); assertThat(xml).isNotNull().contains("jdbc:connector-service"); + assertThat(xml).isNotNull().contains("jdbc:region-mapping"); + assertThat(xml).isNotNull().contains("jdbc:field-mapping"); }); server.invoke(() -> { @@ -92,4 +94,24 @@ public class CreateMappingCommandDUnitTest { .containsEntry("field2", "column2"); }); } + + @Test + public void createsRegionMappingWithoutFieldMap() { +CommandStringBuilder csb = new CommandStringBuilder(CREATE_MAPPING); +csb.addOption(CREATE_MAPPING__REGION_NAME, "testRegion"); +csb.addOption(CREATE_MAPPING__CONNECTION_NAME, "connection"); +csb.addOption(CREATE_MAPPING__TABLE_NAME, "myTable"); +csb.addOption(CREATE_MAPPING__PDX_CLASS_NAME, "myPdxClass"); +csb.addOption(CREATE_MAPPING__VALUE_CONTAINS_PRIMARY_KEY, "false"); + +gfsh.executeAndAssertThat(csb.toString()).statusIsSuccess(); + +locator.invoke(() -> { + String xml = InternalLocator.getLocator().getSharedConfiguration().getConfiguration("cluster") + .getCacheXmlContent(); + assertThat(xml).isNotNull().contains("jdbc:connector-service"); + assertThat(xml).isNotNull().contains("jdbc:region-mapping"); + assertThat(xml).isNotNull().doesNotContain("jdbc:field-mapping"); +}); + } } diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/internal/xml/JdbcConnectorServiceXmlGeneratorIntegrationTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/internal/xml/JdbcConnec
[geode] branch feature/GEODE-3583-storage updated: GEODE-4199: Remove GemFireCacheImpl.getInstance call from GridAdvisor
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/GEODE-3583-storage in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/feature/GEODE-3583-storage by this push: new c474e0d GEODE-4199: Remove GemFireCacheImpl.getInstance call from GridAdvisor c474e0d is described below commit c474e0d3d23b5abecdf69a4287ffc61cd0220687 Author: Anil AuthorDate: Wed Jan 10 12:29:30 2018 -0800 GEODE-4199: Remove GemFireCacheImpl.getInstance call from GridAdvisor --- .../org/apache/geode/internal/cache/CacheServerAdvisor.java | 2 +- .../org/apache/geode/internal/cache/ControllerAdvisor.java| 2 +- .../java/org/apache/geode/internal/cache/GridAdvisor.java | 11 ++- .../java/org/apache/geode/internal/cache/GridProfileTest.java | 6 -- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/CacheServerAdvisor.java b/geode-core/src/main/java/org/apache/geode/internal/cache/CacheServerAdvisor.java index 47b7cb3..d48375b 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/CacheServerAdvisor.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/CacheServerAdvisor.java @@ -123,7 +123,7 @@ public class CacheServerAdvisor extends GridAdvisor { // tell local controllers about this cache server tellLocalControllers(removeProfile, exchangeProfiles, replyProfiles); // for QRM messaging we need cache servers to know about each other - tellLocalBridgeServers(removeProfile, exchangeProfiles, replyProfiles); + tellLocalBridgeServers(dm.getCache(), removeProfile, exchangeProfiles, replyProfiles); } @Override diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/ControllerAdvisor.java b/geode-core/src/main/java/org/apache/geode/internal/cache/ControllerAdvisor.java index 624edbd..4bf5ba1 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/ControllerAdvisor.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/ControllerAdvisor.java @@ -114,7 +114,7 @@ public class ControllerAdvisor extends GridAdvisor { // tell local controllers about this remote controller tellLocalControllers(removeProfile, exchangeProfiles, replyProfiles); // tell local bridge servers about this remote controller - tellLocalBridgeServers(removeProfile, exchangeProfiles, replyProfiles); + tellLocalBridgeServers(dm.getCache(), removeProfile, exchangeProfiles, replyProfiles); } @Override diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/GridAdvisor.java b/geode-core/src/main/java/org/apache/geode/internal/cache/GridAdvisor.java index 12acc2e..3c15fe9 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/GridAdvisor.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/GridAdvisor.java @@ -204,7 +204,8 @@ public abstract class GridAdvisor extends DistributionAdvisor { // Exchange with any local servers or controllers. List otherProfiles = new ArrayList(); GridProfile profile = (GridProfile) createProfile(); - profile.tellLocalBridgeServers(false, true, otherProfiles); + profile.tellLocalBridgeServers(getDistributionManager().getCache(), false, true, + otherProfiles); profile.tellLocalControllers(false, true, otherProfiles); for (Profile otherProfile : otherProfiles) { if (!otherProfile.equals(profile)) { @@ -223,7 +224,7 @@ public abstract class GridAdvisor extends DistributionAdvisor { // Notify any local bridge servers or controllers // that we are closing. GridProfile profile = (GridProfile) createProfile(); - profile.tellLocalBridgeServers(true, false, null); + profile.tellLocalBridgeServers(getDistributionManager().getCache(), true, false, null); profile.tellLocalControllers(true, false, null); super.close(); } catch (DistributedSystemDisconnectedException ignore) { @@ -325,9 +326,9 @@ public abstract class GridAdvisor extends DistributionAdvisor { * * @since GemFire 5.7 */ -protected void tellLocalBridgeServers(boolean removeProfile, boolean exchangeProfiles, -final List replyProfiles) { - final InternalCache cache = GemFireCacheImpl.getInstance(); +protected void tellLocalBridgeServers(InternalCache cache, boolean removeProfile, +boolean exchangeProfiles, final List replyProfiles) { + if (cache != null && !cache.isClosed()) { List bridgeServers = cache.getCacheServersAndGatewayReceiver(); for (int i = 0; i < bridgeServers.size(); i++) { diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/GridProfileTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/GridProfileTest.java index c2e65ac..d2d
[geode] branch feature/GEODE-3583-storage updated: GEODE-4198: Removed use of GemFireCacheImpl.getInstance in DiskStoreMonitor
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/GEODE-3583-storage in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/feature/GEODE-3583-storage by this push: new 1e042c3 GEODE-4198: Removed use of GemFireCacheImpl.getInstance in DiskStoreMonitor 1e042c3 is described below commit 1e042c37687d70ad2b959092f02d1e6bd90a5245 Author: Anil AuthorDate: Wed Jan 10 11:34:24 2018 -0800 GEODE-4198: Removed use of GemFireCacheImpl.getInstance in DiskStoreMonitor --- .../geode/internal/cache/DiskStoreMonitor.java | 45 - .../geode/internal/cache/GemFireCacheImpl.java | 2 +- .../geode/internal/cache/DiskStoreMonitorTest.java | 57 ++ 3 files changed, 78 insertions(+), 26 deletions(-) diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreMonitor.java b/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreMonitor.java index 37f4e94..55fcc5a 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreMonitor.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreMonitor.java @@ -29,7 +29,6 @@ import org.apache.logging.log4j.Logger; import org.apache.geode.cache.DiskAccessException; import org.apache.geode.distributed.internal.DistributionConfig; -import org.apache.geode.distributed.internal.InternalDistributedSystem; import org.apache.geode.internal.i18n.LocalizedStrings; import org.apache.geode.internal.logging.LogService; import org.apache.geode.internal.logging.LoggingThreadGroup; @@ -39,9 +38,6 @@ import org.apache.geode.internal.logging.log4j.LogMarker; public class DiskStoreMonitor { private static final Logger logger = LogService.getLogger(); - private static final boolean DISABLE_MONITOR = - Boolean.getBoolean(DistributionConfig.GEMFIRE_PREFIX + "DISK_USAGE_DISABLE_MONITORING"); - private static final int USAGE_CHECK_INTERVAL = Integer .getInteger(DistributionConfig.GEMFIRE_PREFIX + "DISK_USAGE_POLLING_INTERVAL_MILLIS", 1); @@ -88,6 +84,11 @@ public class DiskStoreMonitor { } } + static final String DISK_USAGE_DISABLE_MONITORING = + DistributionConfig.GEMFIRE_PREFIX + "DISK_USAGE_DISABLE_MONITORING"; + + private final boolean disableMonitor = Boolean.getBoolean(DISK_USAGE_DISABLE_MONITORING); + private final ScheduledExecutorService exec; private final Map> disks; @@ -100,20 +101,20 @@ public class DiskStoreMonitor { void handleDiskStateChange(DiskState state); } - public DiskStoreMonitor() { + public DiskStoreMonitor(File logFile) { disks = new ConcurrentHashMap>(); -logDisk = new LogUsage(getLogDir()); +logDisk = new LogUsage(getLogDir(logFile)); if (logger.isTraceEnabled(LogMarker.DISK_STORE_MONITOR)) { logger.trace(LogMarker.DISK_STORE_MONITOR, "Disk monitoring is {}", - (DISABLE_MONITOR ? "disabled" : "enabled")); + (disableMonitor ? "disabled" : "enabled")); logger.trace(LogMarker.DISK_STORE_MONITOR, "Log directory usage warning is set to {}%", LOG_WARNING_THRESHOLD_PCT); logger.trace(LogMarker.DISK_STORE_MONITOR, "Scheduling disk usage checks every {} ms", USAGE_CHECK_INTERVAL); } -if (DISABLE_MONITOR) { +if (disableMonitor) { exec = null; } else { final ThreadGroup tg = LoggingThreadGroup.createThreadGroup( @@ -141,6 +142,10 @@ public class DiskStoreMonitor { } } + LogUsage getLogDisk() { +return logDisk; + } + public void addDiskStore(DiskStoreImpl ds) { if (logger.isTraceEnabled(LogMarker.DISK_STORE_MONITOR)) { logger.trace(LogMarker.DISK_STORE_MONITOR, "Now monitoring disk store {}", ds.getName()); @@ -209,27 +214,17 @@ public class DiskStoreMonitor { logDisk.update(LOG_WARNING_THRESHOLD_PCT, 100); } - private File getLogDir() { -File log = null; -InternalCache internalCache = GemFireCacheImpl.getInstance(); -if (internalCache != null) { - InternalDistributedSystem ds = internalCache.getInternalDistributedSystem(); - if (ds != null) { -DistributionConfig conf = ds.getConfig(); -if (conf != null) { - log = conf.getLogFile(); - if (log != null) { -log = log.getParentFile(); - } -} - } + private static File getLogDir(File logFile) { +File logDir = null; +if (logFile != null) { + logDir = logFile.getParentFile(); } -if (log == null) { +if (logDir == null) { // assume current directory - log = new File("."); + logDir = new File("."); } -return log; +return logDir; } abstract static class DiskUsage { diff --git a/geo
[geode] branch develop updated: GEODE-4237: The JdbcLoader creates PdxInstance using region mapping (column to field).
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new 6eece22 GEODE-4237: The JdbcLoader creates PdxInstance using region mapping (column to field). 6eece22 is described below commit 6eece22e45b62d4a9dcb215713f0076bb20205f2 Author: Anil AuthorDate: Mon Jan 8 16:59:46 2018 -0800 GEODE-4237: The JdbcLoader creates PdxInstance using region mapping (column to field). --- .../connectors/jdbc/internal/RegionMapping.java| 36 +++ .../geode/connectors/jdbc/internal/SqlHandler.java | 11 +- .../jdbc/internal/RegionMappingTest.java | 118 - .../connectors/jdbc/internal/SqlHandlerTest.java | 35 +- 4 files changed, 189 insertions(+), 11 deletions(-) diff --git a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/RegionMapping.java b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/RegionMapping.java index 394fe48..d87c4d5 100644 --- a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/RegionMapping.java +++ b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/RegionMapping.java @@ -16,6 +16,7 @@ package org.apache.geode.connectors.jdbc.internal; import java.io.Serializable; import java.util.Collections; +import java.util.HashMap; import java.util.Map; import org.apache.geode.annotations.Experimental; @@ -28,6 +29,7 @@ public class RegionMapping implements Serializable { private final String connectionConfigName; private final Boolean primaryKeyInValue; private final Map fieldToColumnMap; + private final Map columnToFieldMap; public RegionMapping(String regionName, String pdxClassName, String tableName, String connectionConfigName, Boolean primaryKeyInValue, @@ -39,6 +41,24 @@ public class RegionMapping implements Serializable { this.primaryKeyInValue = primaryKeyInValue; this.fieldToColumnMap = fieldToColumnMap == null ? null : Collections.unmodifiableMap(fieldToColumnMap); +this.columnToFieldMap = createReverseMap(fieldToColumnMap); + } + + private static Map createReverseMap(Map fieldToColumnMap) { +if (fieldToColumnMap == null) { + return null; +} +Map reverseMap = new HashMap<>(); +for (Map.Entry entry : fieldToColumnMap.entrySet()) { + String reverseMapKey = entry.getValue().toLowerCase(); + String reverseMapValue = entry.getKey(); + if (reverseMap.containsKey(reverseMapKey)) { +throw new IllegalArgumentException( +"The field " + reverseMapValue + " can not be mapped to more than one column."); + } + reverseMap.put(reverseMapKey, reverseMapValue); +} +return Collections.unmodifiableMap(reverseMap); } public String getConnectionConfigName() { @@ -76,10 +96,26 @@ public class RegionMapping implements Serializable { return columnName != null ? columnName : fieldName; } + public String getFieldNameForColumn(String columnName) { +String canonicalColumnName = columnName.toLowerCase(); +String fieldName = null; +if (this.columnToFieldMap != null) { + fieldName = columnToFieldMap.get(canonicalColumnName); +} +return fieldName != null ? fieldName : canonicalColumnName; + } + public Map getFieldToColumnMap() { return fieldToColumnMap; } + /** + * For unit tests + */ + Map getColumnToFieldMap() { +return this.columnToFieldMap; + } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/SqlHandler.java b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/SqlHandler.java index 65f9240..25a3694 100644 --- a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/SqlHandler.java +++ b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/SqlHandler.java @@ -121,9 +121,8 @@ public class SqlHandler { return factory; } - private PdxInstance executeReadStatement(PreparedStatement statement, - List columnList, PdxInstanceFactory factory, RegionMapping regionMapping, - String keyColumnName) { + PdxInstance executeReadStatement(PreparedStatement statement, List columnList, + PdxInstanceFactory factory, RegionMapping regionMapping, String keyColumnName) { PdxInstance pdxInstance = null; try { setValuesInStatement(statement, columnList); @@ -134,7 +133,7 @@ public class SqlHandler { for (int i = 1; i <= ColumnsNumber; i++) { Object columnValue = resultSet.getObject(i); String columnName = metaData.getColumnName(i); -String fieldName = mapColumnNameToFieldName(columnName); +String fieldNa
[geode] 01/01: GEODE-4237: The JdbcLoader creates PdxInstance using region mapping (column to field).
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/GEODE-4237 in repository https://gitbox.apache.org/repos/asf/geode.git commit dbb285069f0f0c76ecbea3cf776bd7f466b3415f Author: Anil AuthorDate: Mon Jan 8 16:59:46 2018 -0800 GEODE-4237: The JdbcLoader creates PdxInstance using region mapping (column to field). --- .../connectors/jdbc/internal/RegionMapping.java| 36 +++ .../geode/connectors/jdbc/internal/SqlHandler.java | 11 +- .../jdbc/internal/RegionMappingTest.java | 118 - .../connectors/jdbc/internal/SqlHandlerTest.java | 35 +- 4 files changed, 189 insertions(+), 11 deletions(-) diff --git a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/RegionMapping.java b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/RegionMapping.java index 394fe48..d87c4d5 100644 --- a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/RegionMapping.java +++ b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/RegionMapping.java @@ -16,6 +16,7 @@ package org.apache.geode.connectors.jdbc.internal; import java.io.Serializable; import java.util.Collections; +import java.util.HashMap; import java.util.Map; import org.apache.geode.annotations.Experimental; @@ -28,6 +29,7 @@ public class RegionMapping implements Serializable { private final String connectionConfigName; private final Boolean primaryKeyInValue; private final Map fieldToColumnMap; + private final Map columnToFieldMap; public RegionMapping(String regionName, String pdxClassName, String tableName, String connectionConfigName, Boolean primaryKeyInValue, @@ -39,6 +41,24 @@ public class RegionMapping implements Serializable { this.primaryKeyInValue = primaryKeyInValue; this.fieldToColumnMap = fieldToColumnMap == null ? null : Collections.unmodifiableMap(fieldToColumnMap); +this.columnToFieldMap = createReverseMap(fieldToColumnMap); + } + + private static Map createReverseMap(Map fieldToColumnMap) { +if (fieldToColumnMap == null) { + return null; +} +Map reverseMap = new HashMap<>(); +for (Map.Entry entry : fieldToColumnMap.entrySet()) { + String reverseMapKey = entry.getValue().toLowerCase(); + String reverseMapValue = entry.getKey(); + if (reverseMap.containsKey(reverseMapKey)) { +throw new IllegalArgumentException( +"The field " + reverseMapValue + " can not be mapped to more than one column."); + } + reverseMap.put(reverseMapKey, reverseMapValue); +} +return Collections.unmodifiableMap(reverseMap); } public String getConnectionConfigName() { @@ -76,10 +96,26 @@ public class RegionMapping implements Serializable { return columnName != null ? columnName : fieldName; } + public String getFieldNameForColumn(String columnName) { +String canonicalColumnName = columnName.toLowerCase(); +String fieldName = null; +if (this.columnToFieldMap != null) { + fieldName = columnToFieldMap.get(canonicalColumnName); +} +return fieldName != null ? fieldName : canonicalColumnName; + } + public Map getFieldToColumnMap() { return fieldToColumnMap; } + /** + * For unit tests + */ + Map getColumnToFieldMap() { +return this.columnToFieldMap; + } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/SqlHandler.java b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/SqlHandler.java index 65f9240..25a3694 100644 --- a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/SqlHandler.java +++ b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/SqlHandler.java @@ -121,9 +121,8 @@ public class SqlHandler { return factory; } - private PdxInstance executeReadStatement(PreparedStatement statement, - List columnList, PdxInstanceFactory factory, RegionMapping regionMapping, - String keyColumnName) { + PdxInstance executeReadStatement(PreparedStatement statement, List columnList, + PdxInstanceFactory factory, RegionMapping regionMapping, String keyColumnName) { PdxInstance pdxInstance = null; try { setValuesInStatement(statement, columnList); @@ -134,7 +133,7 @@ public class SqlHandler { for (int i = 1; i <= ColumnsNumber; i++) { Object columnValue = resultSet.getObject(i); String columnName = metaData.getColumnName(i); -String fieldName = mapColumnNameToFieldName(columnName); +String fieldName = mapColumnNameToFieldName(columnName, regionMapping); if (regionMapping.isPrimaryKeyInValue() || !keyColumnName.equalsIgnoreCase(columnName)) {
[geode] branch feature/GEODE-4237 created (now dbb2850)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a change to branch feature/GEODE-4237 in repository https://gitbox.apache.org/repos/asf/geode.git. at dbb2850 GEODE-4237: The JdbcLoader creates PdxInstance using region mapping (column to field). This branch includes the following new commits: new dbb2850 GEODE-4237: The JdbcLoader creates PdxInstance using region mapping (column to field). The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. -- To stop receiving notification emails like this one, please contact ['"commits@geode.apache.org" '].
[geode] branch feature/GEODE-4009 updated: Add DataSource interface and builder
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/GEODE-4009 in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/feature/GEODE-4009 by this push: new 7840e85 Add DataSource interface and builder 7840e85 is described below commit 7840e852e881dc612b992fa252cde536233dd11d Author: Anil AuthorDate: Thu Dec 21 13:28:45 2017 -0800 Add DataSource interface and builder --- .../jdbc/internal/ConnectionConfiguration.java | 7 .../jdbc/internal/ConnectionManager.java | 40 +-- .../jdbc/internal/HikariJdbcDataSource.java| 45 ++ .../connectors/jdbc/internal/JdbcDataSource.java | 22 +++ .../jdbc/internal/JdbcDataSourceBuilder.java | 28 ++ .../jdbc/internal/ConnectionManagerUnitTest.java | 36 - 6 files changed, 130 insertions(+), 48 deletions(-) diff --git a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/ConnectionConfiguration.java b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/ConnectionConfiguration.java index d993e54..6a69079 100644 --- a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/ConnectionConfiguration.java +++ b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/ConnectionConfiguration.java @@ -63,16 +63,9 @@ public class ConnectionConfiguration implements Serializable { public Properties getConnectionProperties() { Properties properties = new Properties(); - if (parameters != null) { properties.putAll(parameters); } -if (user != null) { - properties.put(USER, user); -} -if (password != null) { - properties.put(PASSWORD, password); -} return properties; } diff --git a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/ConnectionManager.java b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/ConnectionManager.java index bd3da6c..22c7a95 100644 --- a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/ConnectionManager.java +++ b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/ConnectionManager.java @@ -16,7 +16,6 @@ package org.apache.geode.connectors.jdbc.internal; import java.sql.Connection; import java.sql.DatabaseMetaData; -import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; @@ -27,17 +26,13 @@ import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; -import javax.sql.DataSource; - -import com.zaxxer.hikari.HikariDataSource; - import org.apache.geode.cache.Operation; import org.apache.geode.pdx.PdxInstance; class ConnectionManager { private final InternalJdbcConnectorService configService; - private final Map dataSourceMap = new ConcurrentHashMap<>(); + private final Map dataSourceMap = new ConcurrentHashMap<>(); private final ConcurrentMap tableToPrimaryKeyMap = new ConcurrentHashMap<>(); private final ThreadLocal preparedStatementCache = new ThreadLocal<>(); @@ -49,20 +44,21 @@ class ConnectionManager { return configService.getMappingForRegion(regionName); } - synchronized DataSource createDataSource(ConnectionConfiguration config) { -DataSource dataSource = dataSourceMap.get(config.getName()); -if (dataSource != null) { - return dataSource; + private synchronized JdbcDataSource createDataSource(ConnectionConfiguration config) { +JdbcDataSource dataSource = dataSourceMap.get(config.getName()); +if (dataSource == null) { + dataSource = buildJdbcDataSource(config); + dataSourceMap.put(config.getName(), dataSource); } -HikariDataSource ds = new HikariDataSource(); -ds.setJdbcUrl(config.getUrl()); -ds.setDataSourceProperties(config.getConnectionProperties()); -dataSourceMap.put(config.getName(), ds); -return ds; +return dataSource; } - private DataSource getDataSource(ConnectionConfiguration config) { -DataSource dataSource = dataSourceMap.get(config.getName()); + JdbcDataSource buildJdbcDataSource(ConnectionConfiguration config) { +return new JdbcDataSourceBuilder(config).create(); + } + + private JdbcDataSource getDataSource(ConnectionConfiguration config) { +JdbcDataSource dataSource = dataSourceMap.get(config.getName()); if (dataSource != null) { return dataSource; } @@ -183,12 +179,16 @@ class ConnectionManager { } private void handleSQLException(SQLException e) { -throw new IllegalStateException("NYI: handleSQLException", e); +throw new IllegalStateException("JDBC connector detected unexpected SQLException", e); } - private void close(HikariDataSource dataSo
[geode] branch feature/GEODE-4009 updated: Add HikariCP to be part of assembly
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/GEODE-4009 in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/feature/GEODE-4009 by this push: new 2843a86 Add HikariCP to be part of assembly 2843a86 is described below commit 2843a8636577868731259c60d5d090beef5f0ade Author: Anil AuthorDate: Thu Dec 21 11:57:22 2017 -0800 Add HikariCP to be part of assembly --- geode-assembly/build.gradle | 5 - geode-connectors/build.gradle | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/geode-assembly/build.gradle b/geode-assembly/build.gradle index 501b279..5bff01b 100755 --- a/geode-assembly/build.gradle +++ b/geode-assembly/build.gradle @@ -209,7 +209,10 @@ def cp = { it.contains('lucene-analyzers-phonetic') || // dependencies from geode-protobuf -it.contains('protobuf-java') +it.contains('protobuf-java') || + +// dependencies from geode-connectors +it.contains('HikariCP') } } }.flatten().unique().join(' ') diff --git a/geode-connectors/build.gradle b/geode-connectors/build.gradle index 58f1d4a..3956179 100644 --- a/geode-connectors/build.gradle +++ b/geode-connectors/build.gradle @@ -18,7 +18,8 @@ dependencies { compile project(':geode-core') compile project(':geode-common') -compile group: 'com.zaxxer', name: 'HikariCP', version: '2.7.4' +//compile group: 'com.zaxxer', name: 'HikariCP', version: '2.7.4' +compile group: 'com.zaxxer', name: 'HikariCP', version: project.'HikariCP.version' testCompile project(':geode-junit') -- To stop receiving notification emails like this one, please contact ['"commits@geode.apache.org" '].
[geode] branch feature/GEODE-3781 deleted (was f811ae1)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a change to branch feature/GEODE-3781 in repository https://gitbox.apache.org/repos/asf/geode.git. was f811ae1 Remove unused imports The revisions that were on this branch are still contained in other references; therefore, this change does not discard any commits from the repository. -- To stop receiving notification emails like this one, please contact ['"commits@geode.apache.org" '].
[geode] branch feature/GEODE-3781 updated: Fix AnalyzeSerializablesJUnitTest failure with XmlEntity
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/GEODE-3781 in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/feature/GEODE-3781 by this push: new 1089074 Fix AnalyzeSerializablesJUnitTest failure with XmlEntity 1089074 is described below commit 1089074744cdbfcbd79a5969b5ad4a41b2c93190 Author: Anil AuthorDate: Tue Dec 12 16:40:26 2017 -0800 Fix AnalyzeSerializablesJUnitTest failure with XmlEntity --- .../codeAnalysis/sanctionedDataSerializables.txt | 108 ++--- 1 file changed, 52 insertions(+), 56 deletions(-) diff --git a/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedDataSerializables.txt b/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedDataSerializables.txt index c7b0f3f..e9a08a5 100644 --- a/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedDataSerializables.txt +++ b/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedDataSerializables.txt @@ -2,14 +2,6 @@ org/apache/geode/admin/RegionSubRegionSnapshot,2 fromData,62,2a2bb80023b500082a2bb900240100b5000b2a2bb80025b500052ab40005b9002601004d2cb9002701009900132cb900280100c000292ab6001ba7ffeab1 toData,30,2ab400082bb800202b2ab4000bb9002102002ab40005c32bb80022b1 -org/apache/geode/internal/cache/backup/FinishBackupRequest,2 -fromData,33,2a2bb700292a2bb8002ab500022a2bb8002ab500032a2bb8002bb6002cb50004b1 -toData,33,2a2bb7002d2ab400022bb8002e2ab400032bb8002e2ab40004b8002f2bb80030b1 - -org/apache/geode/internal/cache/backup/BackupResponse,2 -fromData,14,2a2bb700042a2bb80005b50003b1 -toData,14,2a2bb700062ab400032bb80007b1 - org/apache/geode/admin/internal/SystemMemberCacheEventProcessor$SystemMemberCacheMessage,2 fromData,27,2a2bb7001a2a2bb8001bb5000c2a2bb9001c0100b8001db5000fb1 toData,27,2a2bb7001e2ab4000c2bb8001f2b2ab4000fb40020b900210200b1 @@ -623,8 +615,8 @@ fromData,17,2a2bb700162a2bb80017c8b5000ab1 toData,14,2a2bb700142ab4000a2bb80015b1 org/apache/geode/internal/admin/remote/PrepareRevokePersistentIDRequest,2 -fromData,35,2a2bb700292abb002a59b7002bb500022ab400022bb8002c2a2bb9002d0100b50003b1 -toData,24,2a2bb7002e2ab400022bb8002f2b2ab40003b900300200b1 +fromData,35,2a2bb700282abb002959b7002ab500022ab400022bb8002b2a2bb9002c0100b50003b1 +toData,24,2a2bb7002d2ab400022bb8002e2b2ab40003b9002f0200b1 org/apache/geode/internal/admin/remote/RefreshMemberSnapshotRequest,2 fromData,6,2a2bb70009b1 @@ -755,8 +747,8 @@ fromData,16,2a2bb700072a2bb900080100b50005b1 toData,16,2a2bb700092b2ab40005b9000a0200b1 org/apache/geode/internal/admin/remote/ShutdownAllRequest,2 -fromData,6,2a2bb70045b1 -toData,6,2a2bb70046b1 +fromData,6,2a2bb70044b1 +toData,6,2a2bb70045b1 org/apache/geode/internal/admin/remote/ShutdownAllResponse,2 fromData,16,2a2bb700072a2bb900080100b50002b1 @@ -843,8 +835,8 @@ fromData,1,b1 toData,1,b1 org/apache/geode/internal/cache/AbstractRegion,2 -fromData,11,bb017359130174b70175bf -toData,6,2a2bb80172b1 +fromData,11,bb017459130175b70176bf +toData,6,2a2bb80173b1 org/apache/geode/internal/cache/AbstractUpdateOperation$AbstractUpdateMessage,2 fromData,16,2a2bb700182a2bb900190100b5000cb1 @@ -891,8 +883,8 @@ fromData,6,2a2bb70007b1 toData,6,2a2bb70006b1 org/apache/geode/internal/cache/CreateRegionProcessor$CreateRegionMessage,2 -fromData,45,2a2bb7009f2a2bb800a0b5000a2a2bb800a1c00055b500432a2bb900a20100b500032a2bb900a30100b50065b1 -toData,42,2a2bb700a52ab4000a2bb800a62ab400432bb800a72b2ab40003b900a802002b2ab40065b900a90200b1 +fromData,45,2a2bb7009d2a2bb8009eb500082a2bb8009fc00053b500412a2bb900a00100b500032a2bb900a10100b50063b1 +toData,42,2a2bb700a32ab400082bb800a42ab400412bb800a52b2ab40003b900a602002b2ab40063b900a70200b1 org/apache/geode/internal/cache/CreateRegionProcessor$CreateRegionReplyMessage,2 fromData,161,2a2bb700062bb90007010099000e2a2bb80008c9b5000a2bb9000b01003d1c9a000b2a01b5000ca700352abb000d591cb7000eb5000c033e1d1ca20022bb000f59b700103a0419042bb800112ab4000c1904b6001257840301a7ffdf2bb90007010099000c2a2b03b80013b500142bb9000701009900162abb001559b70016b500172ab400172bb800112a2bb900070100b500182a2bb900190100b50004b1 @@ -911,8 +903,8 @@ fromData,76,2a2bb700432a2bb80044b500062a2bb900450100b80046b500082a2bb900470100b5 toData,77,2a2bb700482ab400062bb800492b2ab40008b4004ab9004b02002b2ab4000ab9004c02002b2ab4000dbeb9004c0200033d1c2ab4000dbea200152b2ab4000d1c2eb9004c0200840201a7ffe8b1 org/apache/geode/internal/cache/DestroyRegionOperation$DestroyRegionMessage,2 -fromData,41,2a2bb700582a2bb80059c0005ab500082a2bb8005bb500112a2bb8005cb5001f2a2bb8005db50029b1 -toData,38,2a2bb7005e2ab400082bb8005f2ab400112bb800602ab4001f2bb800612ab400292bb80062b1 +fromData,41,2a2bb700572a2bb80058c00059b500082a2bb8005ab500112a2bb8005bb5001e2a2bb8005cb50028b1 +toData,38,2a2bb7005d2ab400082bb8005e2ab400112bb8005f2ab4001e2bb800602ab400282bb80061b1 org/apache/geode/internal/cache
[geode] branch develop updated: GEODE-3869: Fix early eviction. (#1152)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new 4e1c63c GEODE-3869: Fix early eviction. (#1152) 4e1c63c is described below commit 4e1c63ca1eab154f24c9a79757e9600496494224 Author: agingade AuthorDate: Tue Dec 12 14:11:25 2017 -0800 GEODE-3869: Fix early eviction. (#1152) * GEODE-3869: Fix early eviction. While code review found that the refactoring moved "evictionNode.unsetRecentlyUsed()" to "appendEntry()" which gets call by other places (adding entry into the list); this causes the recently used entry to be evicted early. --- .../cache/eviction/AbstractEvictionList.java | 2 - .../cache/eviction/LRUListWithAsyncSorting.java| 1 + .../cache/eviction/LRUListWithSyncSorting.java | 1 + .../cache/eviction/AbstractEvictionListTest.java | 1 - .../eviction/LRUListWithAsyncSortingTest.java | 12 ++--- .../LRUListWithSyncSortingIntegrationTest.java | 3 +- .../RegionEntryEvictionIntegrationTest.java| 63 ++ 7 files changed, 73 insertions(+), 10 deletions(-) diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/eviction/AbstractEvictionList.java b/geode-core/src/main/java/org/apache/geode/internal/cache/eviction/AbstractEvictionList.java index b9ed858..dc9fc7b 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/eviction/AbstractEvictionList.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/eviction/AbstractEvictionList.java @@ -116,8 +116,6 @@ abstract class AbstractEvictionList implements EvictionList { return; } -evictionNode.unsetRecentlyUsed(); - if (logger.isTraceEnabled(LogMarker.LRU_CLOCK)) { logger.trace(LogMarker.LRU_CLOCK, LocalizedMessage .create(LocalizedStrings.NewLRUClockHand_ADDING_ANODE_TO_LRU_LIST, evictionNode)); diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/eviction/LRUListWithAsyncSorting.java b/geode-core/src/main/java/org/apache/geode/internal/cache/eviction/LRUListWithAsyncSorting.java index 419b056..a14d363 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/eviction/LRUListWithAsyncSorting.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/eviction/LRUListWithAsyncSorting.java @@ -127,6 +127,7 @@ public class LRUListWithAsyncSorting extends AbstractEvictionList { if (evictionNode.isRecentlyUsed() && evictionAttempts < MAX_EVICTION_ATTEMPTS) { evictionAttempts++; +evictionNode.unsetRecentlyUsed(); appendEntry(evictionNode); continue; } diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/eviction/LRUListWithSyncSorting.java b/geode-core/src/main/java/org/apache/geode/internal/cache/eviction/LRUListWithSyncSorting.java index 7f7e9ee..3577894 100755 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/eviction/LRUListWithSyncSorting.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/eviction/LRUListWithSyncSorting.java @@ -88,6 +88,7 @@ public class LRUListWithSyncSorting extends AbstractEvictionList { logger.trace(LogMarker.LRU_CLOCK, LocalizedMessage .create(LocalizedStrings.NewLRUClockHand_SKIPPING_RECENTLY_USED_ENTRY, aNode)); } +aNode.unsetRecentlyUsed(); appendEntry(aNode); continue; // keep looking } else { diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/eviction/AbstractEvictionListTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/eviction/AbstractEvictionListTest.java index d0e072a..f25cc40 100644 --- a/geode-core/src/test/java/org/apache/geode/internal/cache/eviction/AbstractEvictionListTest.java +++ b/geode-core/src/test/java/org/apache/geode/internal/cache/eviction/AbstractEvictionListTest.java @@ -161,7 +161,6 @@ public class AbstractEvictionListTest { EvictionNode node = mock(EvictionNode.class); evictionList.appendEntry(node); -verify(node).unsetRecentlyUsed(); verify(node).setNext(evictionList.tail); verify(node).setPrevious(evictionList.head); assertThat(evictionList.tail.previous()).isSameAs(node); diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/eviction/LRUListWithAsyncSortingTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/eviction/LRUListWithAsyncSortingTest.java index 04ab3e9..e5c1d63 100644 --- a/geode-core/src/test/java/org/apache/geode/internal/cache/eviction/LRUListWithAsyncSortingTest.java +++ b/geode-core/src/test/java/org/apache/geode/internal/cache/eviction/LRUListWithAsyncSortingTest.java @@ -177,9 +177,9 @@ public class LRUListWithAsyncSortingTest { when(recentlyUsedNo
[geode] branch feature/GEODE-3869 updated: Add test category.
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/GEODE-3869 in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/feature/GEODE-3869 by this push: new 2ccf8af Add test category. 2ccf8af is described below commit 2ccf8afab622a330f5cad91e885f32a5c6864d43 Author: Anil AuthorDate: Tue Dec 12 10:00:31 2017 -0800 Add test category. --- .../cache/eviction/RegionEntryEvictionIntegrationTest.java| 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/eviction/RegionEntryEvictionIntegrationTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/eviction/RegionEntryEvictionIntegrationTest.java index 3e8ed58..305ab81 100644 --- a/geode-core/src/test/java/org/apache/geode/internal/cache/eviction/RegionEntryEvictionIntegrationTest.java +++ b/geode-core/src/test/java/org/apache/geode/internal/cache/eviction/RegionEntryEvictionIntegrationTest.java @@ -16,13 +16,10 @@ package org.apache.geode.internal.cache.eviction; import static org.assertj.core.api.Assertions.assertThat; -import java.util.ArrayList; -import java.util.List; -import java.util.stream.IntStream; - import org.junit.Before; import org.junit.Rule; import org.junit.Test; +import org.junit.experimental.categories.Category; import org.junit.rules.TestName; import org.apache.geode.cache.Cache; @@ -30,8 +27,9 @@ import org.apache.geode.cache.CacheFactory; import org.apache.geode.cache.EvictionAttributes; import org.apache.geode.cache.Region; import org.apache.geode.cache.RegionShortcut; -import org.apache.geode.internal.cache.InternalRegion; +import org.apache.geode.test.junit.categories.IntegrationTest; +@Category(IntegrationTest.class) public class RegionEntryEvictionIntegrationTest { private Region region; -- To stop receiving notification emails like this one, please contact ['"commits@geode.apache.org" '].
[geode] branch develop updated: GEODE-4033: Exception is thrown when Tx Id is not found on server dur… (#1115)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new f504c7d GEODE-4033: Exception is thrown when Tx Id is not found on server dur… (#1115) f504c7d is described below commit f504c7d607a405fcd156092d050df2edc33e4642 Author: agingade AuthorDate: Mon Dec 4 11:50:33 2017 -0800 GEODE-4033: Exception is thrown when Tx Id is not found on server dur… (#1115) * GEODE-4033: Exception is thrown when Tx Id is not found on server during failover --- .../cache/client/internal/OpExecutorImpl.java | 19 + .../cache/client/internal/TXFailoverOpTest.java| 82 ++ 2 files changed, 85 insertions(+), 16 deletions(-) diff --git a/geode-core/src/main/java/org/apache/geode/cache/client/internal/OpExecutorImpl.java b/geode-core/src/main/java/org/apache/geode/cache/client/internal/OpExecutorImpl.java index 32ecd13..107d733 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/client/internal/OpExecutorImpl.java +++ b/geode-core/src/main/java/org/apache/geode/cache/client/internal/OpExecutorImpl.java @@ -251,21 +251,8 @@ public class OpExecutorImpl implements ExecutablePool { int transactionId = absOp.getMessage().getTransactionId(); // for CommitOp we do not have transactionId in AbstractOp // so set it explicitly for TXFailoverOp -try { - TXFailoverOp.execute(this.pool, transactionId); -} catch (TransactionException e) { - // If this is the first operation in the transaction then - // do not throw TransactionDataNodeHasDeparted back to the - // user, re-try the op instead. fixes bug 44375. NOTE: TXFailoverOp - // is sent even after first op, as it is not known if the first - // operation has established a TXState already - TXStateProxy txState = TXManagerImpl.getCurrentTXState(); - if (txState == null) { -throw e; - } else if (txState.operationCount() > 1) { -throw e; - } -} +TXFailoverOp.execute(this.pool, transactionId); + if (op instanceof ExecuteRegionFunctionOpImpl) { op = new ExecuteRegionFunctionOpImpl((ExecuteRegionFunctionOpImpl) op, (byte) 1/* isReExecute */, new HashSet()); @@ -342,7 +329,7 @@ public class OpExecutorImpl implements ExecutablePool { return executeOnServer(server, op, accessed, onlyUseExistingCnx); } - private Object executeOnServer(ServerLocation p_server, Op op, boolean accessed, + protected Object executeOnServer(ServerLocation p_server, Op op, boolean accessed, boolean onlyUseExistingCnx) { ServerLocation server = p_server; boolean returnCnx = true; diff --git a/geode-core/src/test/java/org/apache/geode/cache/client/internal/TXFailoverOpTest.java b/geode-core/src/test/java/org/apache/geode/cache/client/internal/TXFailoverOpTest.java new file mode 100644 index 000..d315011 --- /dev/null +++ b/geode-core/src/test/java/org/apache/geode/cache/client/internal/TXFailoverOpTest.java @@ -0,0 +1,82 @@ +/* + * 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 org.apache.geode.cache.client.internal; + +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.junit.rules.ExpectedException; + +import org.apache.geode.CancelCriterion; +import org.apache.geode.cache.TransactionException; +import org.apache.geode.cache.client.ServerConnectivityException; +import org.apache.geode.cache.client.internal.pooling.ConnectionManager; +import org.apache.geode.distributed.internal.ServerLocation; +import org.apache.geode.test.junit.categories.UnitTest; + +@Category(UnitTest.class) +public class TXFailoverOpTest { + + @Rule + public ExpectedException expectedException = ExpectedException.none(); + + private ConnectionManager manager; + private EndpointManager endpointManager; + private QueueManager q
[geode] branch feature/GEODE-4033 updated: GEODE-4033: Rewrite test to make it simpler
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch feature/GEODE-4033 in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/feature/GEODE-4033 by this push: new 1e7351a GEODE-4033: Rewrite test to make it simpler 1e7351a is described below commit 1e7351abe892fd63355463d67304c8cd322562db Author: Anil AuthorDate: Fri Dec 1 17:04:42 2017 -0800 GEODE-4033: Rewrite test to make it simpler --- .../cache/client/internal/OpExecutorImpl.java | 2 +- .../cache/client/internal/TXFailoverOpTest.java| 356 ++--- 2 files changed, 26 insertions(+), 332 deletions(-) diff --git a/geode-core/src/main/java/org/apache/geode/cache/client/internal/OpExecutorImpl.java b/geode-core/src/main/java/org/apache/geode/cache/client/internal/OpExecutorImpl.java index b6d3a36..107d733 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/client/internal/OpExecutorImpl.java +++ b/geode-core/src/main/java/org/apache/geode/cache/client/internal/OpExecutorImpl.java @@ -329,7 +329,7 @@ public class OpExecutorImpl implements ExecutablePool { return executeOnServer(server, op, accessed, onlyUseExistingCnx); } - private Object executeOnServer(ServerLocation p_server, Op op, boolean accessed, + protected Object executeOnServer(ServerLocation p_server, Op op, boolean accessed, boolean onlyUseExistingCnx) { ServerLocation server = p_server; boolean returnCnx = true; diff --git a/geode-core/src/test/java/org/apache/geode/cache/client/internal/TXFailoverOpTest.java b/geode-core/src/test/java/org/apache/geode/cache/client/internal/TXFailoverOpTest.java index b67b27d..d315011 100644 --- a/geode-core/src/test/java/org/apache/geode/cache/client/internal/TXFailoverOpTest.java +++ b/geode-core/src/test/java/org/apache/geode/cache/client/internal/TXFailoverOpTest.java @@ -15,374 +15,68 @@ package org.apache.geode.cache.client.internal; -import static org.mockito.Mockito.*; - -import java.io.InputStream; -import java.io.OutputStream; -import java.net.Socket; -import java.net.SocketTimeoutException; -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.ScheduledExecutorService; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; -import org.junit.runner.RunWith; -import org.powermock.api.mockito.PowerMockito; -import org.powermock.core.classloader.annotations.PowerMockIgnore; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.junit4.PowerMockRunner; import org.apache.geode.CancelCriterion; import org.apache.geode.cache.TransactionException; -import org.apache.geode.cache.client.NoAvailableServersException; +import org.apache.geode.cache.client.ServerConnectivityException; import org.apache.geode.cache.client.internal.pooling.ConnectionManager; -import org.apache.geode.distributed.DistributedMember; -import org.apache.geode.distributed.internal.InternalDistributedSystem; import org.apache.geode.distributed.internal.ServerLocation; -import org.apache.geode.internal.cache.TXManagerImpl; -import org.apache.geode.internal.cache.TXStateProxy; -import org.apache.geode.internal.cache.tier.sockets.ServerQueueStatus; -import org.apache.geode.internal.logging.InternalLogWriter; import org.apache.geode.test.junit.categories.UnitTest; @Category(UnitTest.class) -@RunWith(PowerMockRunner.class) -@PowerMockIgnore("*.UnitTest") -@PrepareForTest({TXManagerImpl.class}) public class TXFailoverOpTest { @Rule public ExpectedException expectedException = ExpectedException.none(); - DummyManager manager; + private ConnectionManager manager; private EndpointManager endpointManager; - private DummyQueueManager queueManager; + private QueueManager queueManager; private RegisterInterestTracker riTracker; - - protected int borrows; - protected int returns; - protected int invalidateConnections; - protected int exchanges; - protected int serverCrashes; - protected int getPrimary; - protected int getBackups; private CancelCriterion cancelCriterion; + private PoolImpl mockPool; @Before public void setUp() { -this.endpointManager = new DummyEndpointManager(); -this.queueManager = new DummyQueueManager(); -this.manager = new DummyManager(); -riTracker = new RegisterInterestTracker(); +endpointManager = mock(EndpointManager.class); +queueManager = mock(QueueManager.class); +manager = mock(ConnectionManager.class); +riTracker = mock(RegisterInterestTracker.class); +cancelCriterion = mock(CancelCrite
[geode] branch develop updated: GEODE-3038 Fix suspect string found in logs during test run
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new 0d5d2cb GEODE-3038 Fix suspect string found in logs during test run 0d5d2cb is described below commit 0d5d2cbadc50c5ec5d43889fc65eb8622a7f742e Author: Anil AuthorDate: Wed Nov 22 13:36:10 2017 -0800 GEODE-3038 Fix suspect string found in logs during test run --- .../java/org/apache/geode/cache30/CacheXml66DUnitTest.java | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/geode-core/src/test/java/org/apache/geode/cache30/CacheXml66DUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache30/CacheXml66DUnitTest.java index 4ce6757..de56ca6 100644 --- a/geode-core/src/test/java/org/apache/geode/cache30/CacheXml66DUnitTest.java +++ b/geode-core/src/test/java/org/apache/geode/cache30/CacheXml66DUnitTest.java @@ -3373,8 +3373,8 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase { setXmlFile(findFile("sameRootRegion.xml")); -IgnoredException expectedException = -IgnoredException.addIgnoredException("While reading Cache XML file"); +IgnoredException.addIgnoredException("While reading Cache XML file"); + IgnoredException.addIgnoredException("org.apache.geode.cache.RegionExistsException"); try { getCache(); fail("Should have thrown a CacheXmlException"); @@ -3387,7 +3387,7 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase { Assert.fail("Expected a RegionExistsException, not a " + cause.getClass().getName(), cause); } } finally { - expectedException.remove(); + IgnoredException.removeAllExpectedExceptions(); } } @@ -3415,8 +3415,8 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase { setXmlFile(findFile("sameSubregion.xml")); -IgnoredException expectedException = -IgnoredException.addIgnoredException("While reading Cache XML file"); +IgnoredException.addIgnoredException("While reading Cache XML file"); + IgnoredException.addIgnoredException("org.apache.geode.cache.RegionExistsException"); try { getCache(); fail("Should have thrown a CacheXmlException"); @@ -3429,7 +3429,7 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase { Assert.fail("Expected a RegionExistsException, not a " + cause.getClass().getName(), cause); } } finally { - expectedException.remove(); + IgnoredException.removeAllExpectedExceptions(); } } -- To stop receiving notification emails like this one, please contact ['"commits@geode.apache.org" '].
[geode] branch develop updated: GEODE-3038: Run Spotless
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new 013b061 GEODE-3038: Run Spotless 013b061 is described below commit 013b0616c9dc6da471e08f8a954c187ca08f60c4 Author: Anil AuthorDate: Tue Nov 21 16:26:29 2017 -0800 GEODE-3038: Run Spotless --- .../geode/cache30/CacheXmlNotFoundRegressionTest.java | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/geode-core/src/test/java/org/apache/geode/cache30/CacheXmlNotFoundRegressionTest.java b/geode-core/src/test/java/org/apache/geode/cache30/CacheXmlNotFoundRegressionTest.java index dc0d26a..1b1993e 100644 --- a/geode-core/src/test/java/org/apache/geode/cache30/CacheXmlNotFoundRegressionTest.java +++ b/geode-core/src/test/java/org/apache/geode/cache30/CacheXmlNotFoundRegressionTest.java @@ -14,19 +14,20 @@ */ package org.apache.geode.cache30; -import org.apache.geode.cache.CacheFactory; -import org.apache.geode.cache.CacheXmlException; -import org.apache.geode.distributed.ConfigurationProperties; -import org.apache.geode.test.junit.categories.IntegrationTest; -import org.junit.Test; -import org.junit.experimental.categories.Category; +import static junit.framework.TestCase.assertTrue; +import static org.junit.Assert.fail; import java.io.File; import java.util.Properties; import java.util.Scanner; -import static junit.framework.TestCase.assertTrue; -import static org.junit.Assert.fail; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import org.apache.geode.cache.CacheFactory; +import org.apache.geode.cache.CacheXmlException; +import org.apache.geode.distributed.ConfigurationProperties; +import org.apache.geode.test.junit.categories.IntegrationTest; @Category(IntegrationTest.class) public class CacheXmlNotFoundRegressionTest { -- To stop receiving notification emails like this one, please contact ['"commits@geode.apache.org" '].
[geode] branch develop updated: GEODE-3038: A server process shuts down quietly when path to cache.xml is incorrect (#677)
This is an automated email from the ASF dual-hosted git repository. agingade pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new f429e9a GEODE-3038: A server process shuts down quietly when path to cache.xml is incorrect (#677) f429e9a is described below commit f429e9a7eb5bad1ddb2b5eca81228887d87028b3 Author: Anton Mironenko <30350012+anton-mirone...@users.noreply.github.com> AuthorDate: Wed Nov 22 03:57:52 2017 +0400 GEODE-3038: A server process shuts down quietly when path to cache.xml is incorrect (#677) Exception is thrown and logged when cache.xml is not found during cache creation --- .../geode/internal/cache/GemFireCacheImpl.java | 3 + .../cache30/CacheXmlNotFoundRegressionTest.java| 76 ++ 2 files changed, 79 insertions(+) diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java index af525e8..fd8625c 100755 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java @@ -1207,6 +1207,9 @@ public class GemFireCacheImpl implements InternalCache, InternalClientCache, Has this.system.getConfig().getGroups()); initializeDeclarativeCache(); completedCacheXml = true; +} catch (RuntimeException e) { + logger.error("Cache initialization failed because: " + e.toString()); // fix GEODE-3038 + throw e; } finally { if (!completedCacheXml) { // so initializeDeclarativeCache threw an exception diff --git a/geode-core/src/test/java/org/apache/geode/cache30/CacheXmlNotFoundRegressionTest.java b/geode-core/src/test/java/org/apache/geode/cache30/CacheXmlNotFoundRegressionTest.java new file mode 100644 index 000..dc0d26a --- /dev/null +++ b/geode-core/src/test/java/org/apache/geode/cache30/CacheXmlNotFoundRegressionTest.java @@ -0,0 +1,76 @@ +/* + * 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 org.apache.geode.cache30; + +import org.apache.geode.cache.CacheFactory; +import org.apache.geode.cache.CacheXmlException; +import org.apache.geode.distributed.ConfigurationProperties; +import org.apache.geode.test.junit.categories.IntegrationTest; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import java.io.File; +import java.util.Properties; +import java.util.Scanner; + +import static junit.framework.TestCase.assertTrue; +import static org.junit.Assert.fail; + +@Category(IntegrationTest.class) +public class CacheXmlNotFoundRegressionTest { + + /** + * unit test for https://issues.apache.org/jira/browse/GEODE-3038";>GEODE-3038 Tests + * that an error about missing cache-xml file is indeed printed in the text log file. The test + * {@link CacheXml66DUnitTest#testNonExistentFile()} is supposed to test the same, but is not + * enough. It only checks for an CacheXmlException exception to be thrown. Also in that test a log + * is printed into STDOUT, and we do see our error there, but that is not the case when we work + * with the real text log, specified via "log-file" param. + */ + @Test + public void testCacheXmlNotFoundInRealLog() throws Exception { + +String CACHE_SERVER_LOG = "cacheXmlNotFoundUnitTest.log"; +Properties props = new Properties(); +props.put(ConfigurationProperties.MCAST_PORT, "0"); +props.put(ConfigurationProperties.LOG_FILE, CACHE_SERVER_LOG); +props.put(ConfigurationProperties.CACHE_XML_FILE, "non-existing-cache-xml"); + +CacheFactory factory = new CacheFactory(props); + +String errorMessage = ""; + +try { + factory.create(); + fail("Should have thrown a CacheXmlException"); +} catch (CacheXmlException e) { + errorMessage = e.toString(); +} + +// looking for an error in the text log file +Scanner scanner = new Scanner(new File(CACHE_SERVER_LOG)); + +boolean