geode git commit: GEODE-2995: Added GetRequestOperationHandler.java and cleaned up some code
Repository: geode Updated Branches: refs/heads/feature/GEODE-2995 d790ed5d8 -> b0f48d19f GEODE-2995: Added GetRequestOperationHandler.java and cleaned up some code Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/b0f48d19 Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/b0f48d19 Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/b0f48d19 Branch: refs/heads/feature/GEODE-2995 Commit: b0f48d19f79dcd666bde11f9d95f59a32ecb6613 Parents: d790ed5 Author: Udo Kohlmeyer Authored: Wed Jun 14 17:07:34 2017 -0700 Committer: Udo Kohlmeyer Committed: Wed Jun 14 17:07:34 2017 -0700 -- .../protocol/operations/OperationHandler.java | 7 +- .../ProtobufRequestOperationParser.java | 33 .../protobuf/GetRequestOperationHandler.java| 76 ++ .../registry/OperationsHandlerRegistry.java | 8 ++ .../ProtobufSerializationServiceImpl.java | 56 + .../serialization/SerializationService.java | 28 +++ .../SerializationServiceException.java | 23 ++ ...codingTypeToSerializationTypeTranslator.java | 50 .../translation/EncodingTypeTranslator.java | 83 ...e.geode.protocol.operations.OperationHandler | 1 + .../geode/client/protocol/OpsProcessorTest.java | 67 .../ProtobufRequestOperationParser.java | 31 .../OperationsHandlerRegistryJUnitTest.java | 3 +- ...eToSerializationTypeTranslatorJUnitTest.java | 12 +-- 14 files changed, 338 insertions(+), 140 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/b0f48d19/geode-protobuf/src/main/java/org/apache/geode/protocol/operations/OperationHandler.java -- diff --git a/geode-protobuf/src/main/java/org/apache/geode/protocol/operations/OperationHandler.java b/geode-protobuf/src/main/java/org/apache/geode/protocol/operations/OperationHandler.java index c494855..c93a22a 100644 --- a/geode-protobuf/src/main/java/org/apache/geode/protocol/operations/OperationHandler.java +++ b/geode-protobuf/src/main/java/org/apache/geode/protocol/operations/OperationHandler.java @@ -14,6 +14,9 @@ */ package org.apache.geode.protocol.operations; -public interface OperationHandler { - Object process(Object encodingHandlerRegistry, T request); +import org.apache.geode.serialization.SerializationService; + +public interface OperationHandler { + Resp process(SerializationService serializationService, Req request); + int getOperationCode(); } http://git-wip-us.apache.org/repos/asf/geode/blob/b0f48d19/geode-protobuf/src/main/java/org/apache/geode/protocol/operations/ProtobufRequestOperationParser.java -- diff --git a/geode-protobuf/src/main/java/org/apache/geode/protocol/operations/ProtobufRequestOperationParser.java b/geode-protobuf/src/main/java/org/apache/geode/protocol/operations/ProtobufRequestOperationParser.java new file mode 100644 index 000..7fb0eab --- /dev/null +++ b/geode-protobuf/src/main/java/org/apache/geode/protocol/operations/ProtobufRequestOperationParser.java @@ -0,0 +1,33 @@ +/* + * 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.protocol.operations; + +import org.apache.geode.protocol.protobuf.ClientProtocol; + +public class ProtobufRequestOperationParser { + public static Object getRequestForOperationTypeID(ClientProtocol.Request request) { +switch (request.getRequestAPICase()) { + case PUTREQUEST: +return request.getPutRequest(); + case GETREQUEST: +return request.getGetRequest(); + case PUTALLREQUEST: +return request.getPutAllRequest(); + default: +throw new RuntimeException( +"Unknown request type: " + request.getRequestAPICase().getNumber()); +} + } +} http://git-wip-us.apache.org/repos/asf/geode/blob/b0f48d19/geode-protobuf/src/main/java/org/apache/geode/protocol/operations/protobuf/GetRequestOper
geode git commit: GEODE-2708: Declare ANTLR Dependency For antlr Configuration
Repository: geode Updated Branches: refs/heads/feature/gradle-3.4.1 a926056b7 -> 14232c6e4 GEODE-2708: Declare ANTLR Dependency For antlr Configuration If no version is set for the antlr plugin, it will default to 2.7.7. However, this was causing an issue for Eclipse and other IDE because the plugin was modifying the antlr configuration after the initial dependency resolution was done. - Added antlr dependency to the antlr configuration Verified by importing project into Eclipse and also running build from command-line Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/14232c6e Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/14232c6e Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/14232c6e Branch: refs/heads/feature/gradle-3.4.1 Commit: 14232c6e44bf222be2db1954cd7b3b775696f1f1 Parents: a926056 Author: Mark Bretl Authored: Wed Jun 14 16:48:35 2017 -0700 Committer: Mark Bretl Committed: Wed Jun 14 16:48:35 2017 -0700 -- geode-core/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/14232c6e/geode-core/build.gradle -- diff --git a/geode-core/build.gradle b/geode-core/build.gradle index f07444a..f5714c6 100755 --- a/geode-core/build.gradle +++ b/geode-core/build.gradle @@ -15,7 +15,6 @@ * limitations under the License. */ - apply plugin: 'antlr' sourceSets { @@ -31,7 +30,8 @@ configurations { } dependencies { - // Source Dependencies + // Source Dependencies + antlr 'antlr:antlr:' + project.'antlr.version' // External provided files("${System.getProperty('java.home')}/../lib/tools.jar") compile 'com.github.stephenc.findbugs:findbugs-annotations:' + project.'stephenc-findbugs.version'
geode git commit: Revert "GEODE-3062: create new SecurityService after receiving cluster config"
Repository: geode Updated Branches: refs/heads/develop 7bc31116b -> a79d2cc16 Revert "GEODE-3062: create new SecurityService after receiving cluster config" This reverts commit cecad6c37d59369a29237f7d940f297804633aa1. Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/a79d2cc1 Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/a79d2cc1 Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/a79d2cc1 Branch: refs/heads/develop Commit: a79d2cc1621bd8c36531519df5e1edbb0faabf96 Parents: 7bc3111 Author: Kirk Lund Authored: Wed Jun 14 15:41:49 2017 -0700 Committer: Kirk Lund Committed: Wed Jun 14 15:41:49 2017 -0700 -- .../internal/InternalDistributedSystem.java | 4 --- .../cache/ClusterConfigurationLoader.java | 7 ++-- .../geode/internal/cache/GemFireCacheImpl.java | 35 +++- .../ClusterConfigWithSecurityDUnitTest.java | 31 - 4 files changed, 22 insertions(+), 55 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/a79d2cc1/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java -- diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java index f406393..22edb6f 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java @@ -516,10 +516,6 @@ public class InternalDistributedSystem extends DistributedSystem return this.securityService; } - public void setSecurityService(SecurityService securityService) { -this.securityService = securityService; - } - /** * Registers a listener to the system * http://git-wip-us.apache.org/repos/asf/geode/blob/a79d2cc1/geode-core/src/main/java/org/apache/geode/internal/cache/ClusterConfigurationLoader.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/ClusterConfigurationLoader.java b/geode-core/src/main/java/org/apache/geode/internal/cache/ClusterConfigurationLoader.java index 92cfd96..4f4881f 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/ClusterConfigurationLoader.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/ClusterConfigurationLoader.java @@ -152,12 +152,13 @@ public class ClusterConfigurationLoader { /*** * Apply the gemfire properties cluster configuration on this member - * + * + * @param cache Cache created for this member * @param response {@link ConfigurationResponse} containing the requested {@link Configuration} * @param config this member's config */ - public static void applyClusterPropertiesConfiguration(ConfigurationResponse response, - DistributionConfig config) { + public static void applyClusterPropertiesConfiguration(Cache cache, + ConfigurationResponse response, DistributionConfig config) { if (response == null || response.getRequestedConfiguration().isEmpty()) { return; } http://git-wip-us.apache.org/repos/asf/geode/blob/a79d2cc1/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java -- 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 c503c40..40df0c7 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 @@ -77,7 +77,6 @@ import javax.transaction.TransactionManager; import com.sun.jna.Native; import com.sun.jna.Platform; import org.apache.commons.lang.StringUtils; -import org.apache.geode.internal.security.SecurityServiceFactory; import org.apache.logging.log4j.Logger; import org.apache.geode.CancelCriterion; @@ -127,6 +126,7 @@ import org.apache.geode.cache.client.PoolFactory; import org.apache.geode.cache.client.PoolManager; import org.apache.geode.cache.client.internal.ClientMetadataService; import org.apache.geode.cache.client.internal.ClientRegionFactoryImpl; +import org.apache.geode.cache.client.internal.ConnectionImpl; import org.apache.geode.cache.client.internal.InternalClientCache; import org.apache.geode.cache.client.internal.PoolImpl; import org.apache.geode.cache.control.ResourceManager; @@ -213,6 +213,7 @@ import org.apache.geode.internal.net.SocketCreator; import org.apache.geode
geode git commit: GEODE-2995: Using Powermock to mock enums in CodecRegistryJUnitTest.java
Repository: geode Updated Branches: refs/heads/feature/GEODE-2995 a460ee7c2 -> d790ed5d8 GEODE-2995: Using Powermock to mock enums in CodecRegistryJUnitTest.java Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/d790ed5d Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/d790ed5d Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/d790ed5d Branch: refs/heads/feature/GEODE-2995 Commit: d790ed5d8f6efc2fcf0be13d388e0053f5695d56 Parents: a460ee7 Author: Udo Kohlmeyer Authored: Wed Jun 14 15:29:27 2017 -0700 Committer: Udo Kohlmeyer Committed: Wed Jun 14 15:29:27 2017 -0700 -- geode-protobuf/build.gradle | 4 +++ .../geode/client/protocol/OpsProcessorTest.java | 2 ++ .../registry/CodecRegistryJUnitTest.java| 33 +--- 3 files changed, 27 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/d790ed5d/geode-protobuf/build.gradle -- diff --git a/geode-protobuf/build.gradle b/geode-protobuf/build.gradle index 7a5cbfb..2102f6a 100644 --- a/geode-protobuf/build.gradle +++ b/geode-protobuf/build.gradle @@ -32,6 +32,10 @@ dependencies { testCompile project(':geode-junit') testCompile files(project(':geode-core').sourceSets.test.output) +testCompile 'org.powermock:powermock-core:' + project.'powermock.version' +testCompile 'org.powermock:powermock-module-junit4:' + project.'powermock.version' +testCompile 'org.powermock:powermock-api-mockito:' + project.'powermock.version' + compile 'com.google.protobuf:protobuf-java:3.3.1' } http://git-wip-us.apache.org/repos/asf/geode/blob/d790ed5d/geode-protobuf/src/test/java/org/apache/geode/client/protocol/OpsProcessorTest.java -- diff --git a/geode-protobuf/src/test/java/org/apache/geode/client/protocol/OpsProcessorTest.java b/geode-protobuf/src/test/java/org/apache/geode/client/protocol/OpsProcessorTest.java index 271b934..7f3a86c 100644 --- a/geode-protobuf/src/test/java/org/apache/geode/client/protocol/OpsProcessorTest.java +++ b/geode-protobuf/src/test/java/org/apache/geode/client/protocol/OpsProcessorTest.java @@ -72,6 +72,8 @@ public class OpsProcessorTest { // ProtobufRequestOperationParser.getRequestForOperationTypeID(messageRequest))) //.thenReturn(expectedResponse); + + OpsProcessor processor = new OpsProcessor(opsHandlerRegistry, serializationCodecRegistry); ClientProtocol.Response response = processor.process(messageRequest); Assert.assertEquals(expectedResponse, response.getGetResponse()); http://git-wip-us.apache.org/repos/asf/geode/blob/d790ed5d/geode-protobuf/src/test/java/org/apache/geode/serialization/registry/CodecRegistryJUnitTest.java -- diff --git a/geode-protobuf/src/test/java/org/apache/geode/serialization/registry/CodecRegistryJUnitTest.java b/geode-protobuf/src/test/java/org/apache/geode/serialization/registry/CodecRegistryJUnitTest.java index a6c3e78..5811e08 100644 --- a/geode-protobuf/src/test/java/org/apache/geode/serialization/registry/CodecRegistryJUnitTest.java +++ b/geode-protobuf/src/test/java/org/apache/geode/serialization/registry/CodecRegistryJUnitTest.java @@ -24,36 +24,44 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.junit.experimental.categories.Category; -import org.mockito.Mockito; +import org.junit.runner.RunWith; +import org.powermock.api.mockito.PowerMockito; +import org.powermock.core.classloader.annotations.PrepareForTest; +import org.powermock.modules.junit4.PowerMockRunner; +@RunWith(PowerMockRunner.class) +@PrepareForTest({SerializationType.class}) @Category(UnitTest.class) public class CodecRegistryJUnitTest { private SerializationCodecRegistry codecRegistry; + @Before public void startup() throws CodecAlreadyRegisteredForTypeException { codecRegistry = new SerializationCodecRegistry(); } @After - public void tearDown(){ + public void tearDown() { codecRegistry.shutdown(); } @Test public void testRegisterCodec() throws CodecAlreadyRegisteredForTypeException { -Assert.assertEquals(0, codecRegistry.getRegisteredCodecCount()); -codecRegistry.register(SerializationType.INT, new DummyTypeCodec()); -Assert.assertEquals(1, codecRegistry.getRegisteredCodecCount()); +Assert.assertEquals(10, codecRegistry.getRegisteredCodecCount()); +SerializationType mockSerializationType = PowerMockito.mock(SerializationType.class); +codecRegistry.register(mockSerializationType, new DummyTypeCodec()); +Assert.assertEquals(11, codecRegistry.getRegisteredCode
[35/51] [abbrv] geode git commit: GEODE-3023: This now closes #564
GEODE-3023: This now closes #564 Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/a4d790c3 Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/a4d790c3 Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/a4d790c3 Branch: refs/heads/feature/GEM-1483 Commit: a4d790c3dc76c69e18420798566abb5c0c6a0a31 Parents: a561bd1 Author: Udo Kohlmeyer Authored: Wed Jun 14 07:59:46 2017 -0700 Committer: Udo Kohlmeyer Committed: Wed Jun 14 07:59:46 2017 -0700 -- --
[01/51] [abbrv] geode git commit: GEODE-2632: use immutable SecurityService impls to improve performance [Forced Update!]
Repository: geode Updated Branches: refs/heads/feature/GEM-1483 84baa3718 -> 56a3fa75a (forced update) http://git-wip-us.apache.org/repos/asf/geode/blob/0211029b/geode-core/src/test/java/org/apache/geode/security/SecurityManagerLifecycleIntegrationTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/security/SecurityManagerLifecycleIntegrationTest.java b/geode-core/src/test/java/org/apache/geode/security/SecurityManagerLifecycleIntegrationTest.java new file mode 100644 index 000..f00b03a --- /dev/null +++ b/geode-core/src/test/java/org/apache/geode/security/SecurityManagerLifecycleIntegrationTest.java @@ -0,0 +1,73 @@ +/* + * 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.security; + +import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS; +import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT; +import static org.apache.geode.distributed.ConfigurationProperties.SECURITY_MANAGER; +import static org.assertj.core.api.Assertions.assertThat; + +import org.apache.geode.cache.CacheFactory; +import org.apache.geode.internal.cache.InternalCache; +import org.apache.geode.internal.security.SecurityService; +import org.apache.geode.test.junit.categories.FlakyTest; +import org.apache.geode.test.junit.categories.IntegrationTest; +import org.apache.geode.test.junit.categories.SecurityTest; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import java.util.Properties; + +@Category({IntegrationTest.class, SecurityTest.class}) +public class SecurityManagerLifecycleIntegrationTest { + + private Properties securityProps; + private InternalCache cache; + private SecurityService securityService; + + @Before + public void before() { +this.securityProps = new Properties(); +this.securityProps.setProperty(SECURITY_MANAGER, SpySecurityManager.class.getName()); + +Properties props = new Properties(); +props.putAll(this.securityProps); +props.setProperty(MCAST_PORT, "0"); +props.setProperty(LOCATORS, ""); + +this.cache = (InternalCache) new CacheFactory(props).create(); + +this.securityService = this.cache.getSecurityService(); + } + + @After + public void after() { +if (this.cache != null && !this.cache.isClosed()) { + this.cache.close(); +} + } + + @Category(FlakyTest.class) // GEODE-1661 + @Test + public void initAndCloseTest() { +SpySecurityManager ssm = (SpySecurityManager) this.securityService.getSecurityManager(); +assertThat(ssm.getInitInvocationCount()).isEqualTo(1); +this.cache.close(); +assertThat(ssm.getCloseInvocationCount()).isEqualTo(1); + } + +} http://git-wip-us.apache.org/repos/asf/geode/blob/0211029b/geode-core/src/test/java/org/apache/geode/security/SimpleSecurityManagerTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/security/SimpleSecurityManagerTest.java b/geode-core/src/test/java/org/apache/geode/security/SimpleSecurityManagerTest.java index 2d6fbca..1c73b57 100644 --- a/geode-core/src/test/java/org/apache/geode/security/SimpleSecurityManagerTest.java +++ b/geode-core/src/test/java/org/apache/geode/security/SimpleSecurityManagerTest.java @@ -12,7 +12,6 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. */ - package org.apache.geode.security; import static org.apache.geode.internal.Assert.assertTrue; http://git-wip-us.apache.org/repos/asf/geode/blob/0211029b/geode-core/src/test/java/org/apache/geode/security/SimpleTestSecurityManager.java -- diff --git a/geode-core/src/test/java/org/apache/geode/security/SimpleTestSecurityManager.java b/geode-core/src/test/java/org/apache/geode/security/SimpleTestSecurityManager.java index c754376..ac2d15d 100644 --- a/geode-core/src/test/java/org/apache/geode/security/SimpleTestSecurityManager.java +++ b/geode-core/src/test/java/org/apache/geode/security/SimpleTestSecurityManage
[44/51] [abbrv] geode git commit: GEODE-2628: fix StatisticsImplTest use of Mockito 2.7.11
GEODE-2628: fix StatisticsImplTest use of Mockito 2.7.11 Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/c41d788b Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/c41d788b Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/c41d788b Branch: refs/heads/feature/GEM-1483 Commit: c41d788b0a27993cb609c27b42bfd33303a1e7e3 Parents: 740a4ef Author: Kirk Lund Authored: Tue Jun 13 10:57:54 2017 -0700 Committer: Kirk Lund Committed: Wed Jun 14 11:06:32 2017 -0700 -- .../internal/statistics/StatisticsImplTest.java | 63 1 file changed, 37 insertions(+), 26 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/c41d788b/geode-core/src/test/java/org/apache/geode/internal/statistics/StatisticsImplTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/internal/statistics/StatisticsImplTest.java b/geode-core/src/test/java/org/apache/geode/internal/statistics/StatisticsImplTest.java index ea8d285..2747252 100644 --- a/geode-core/src/test/java/org/apache/geode/internal/statistics/StatisticsImplTest.java +++ b/geode-core/src/test/java/org/apache/geode/internal/statistics/StatisticsImplTest.java @@ -22,6 +22,7 @@ import java.util.function.IntSupplier; import java.util.function.LongSupplier; import org.apache.logging.log4j.Logger; +import org.junit.After; import org.junit.Before; import org.junit.Rule; import org.junit.Test; @@ -35,27 +36,38 @@ import org.apache.geode.test.junit.categories.UnitTest; */ @Category(UnitTest.class) public class StatisticsImplTest { - @Rule - public ExpectedException thrown = ExpectedException.none(); + private Logger originalLogger; private StatisticsImpl stats; + @Rule + public ExpectedException thrown = ExpectedException.none(); + @Before public void createStats() { -final StatisticsTypeImpl type = mock(StatisticsTypeImpl.class); +originalLogger = StatisticsImpl.logger; + +StatisticsTypeImpl type = mock(StatisticsTypeImpl.class); when(type.getIntStatCount()).thenReturn(5); when(type.getDoubleStatCount()).thenReturn(5); when(type.getLongStatCount()).thenReturn(5); -final String textId = ""; -final long numbericId = 0; -final long uniqueId = 0; -final int osStatFlags = 0; -final boolean atomicIncrements = false; -final StatisticsManager system = mock(StatisticsManager.class); + +String textId = ""; +long numbericId = 0; +long uniqueId = 0; +int osStatFlags = 0; +boolean atomicIncrements = false; +StatisticsManager system = mock(StatisticsManager.class); + stats = new LocalStatisticsImpl(type, textId, numbericId, uniqueId, atomicIncrements, osStatFlags, system); } + @After + public void tearDown() { +StatisticsImpl.logger = originalLogger; + } + @Test public void invokeIntSuppliersShouldUpdateStats() { IntSupplier supplier1 = mock(IntSupplier.class); @@ -108,23 +120,22 @@ public class StatisticsImplTest { @Test public void invokeSuppliersShouldLogErrorOnlyOnce() { -final Logger originalLogger = StatisticsImpl.logger; -try { - final Logger logger = mock(Logger.class); - StatisticsImpl.logger = logger; - IntSupplier supplier1 = mock(IntSupplier.class); - when(supplier1.getAsInt()).thenThrow(NullPointerException.class); - stats.setIntSupplier(4, supplier1); - assertEquals(1, stats.invokeSuppliers()); - verify(logger, times(1)).warn(anyString(), anyString(), anyInt(), - isA(NullPointerException.class)); - assertEquals(1, stats.invokeSuppliers()); - // Make sure the logger isn't invoked again - verify(logger, times(1)).warn(anyString(), anyString(), anyInt(), - isA(NullPointerException.class)); -} finally { - StatisticsImpl.logger = originalLogger; -} +Logger logger = mock(Logger.class); +StatisticsImpl.logger = logger; +IntSupplier supplier1 = mock(IntSupplier.class); +when(supplier1.getAsInt()).thenThrow(NullPointerException.class); +stats.setIntSupplier(4, supplier1); +assertEquals(1, stats.invokeSuppliers()); + +// String message, Object p0, Object p1, Object p2 +verify(logger, times(1)).warn(anyString(), isNull(), anyInt(), +isA(NullPointerException.class)); + +assertEquals(1, stats.invokeSuppliers()); + +// Make sure the logger isn't invoked again +verify(logger, times(1)).warn(anyString(), isNull(), anyInt(), +isA(NullPointerException.class)); } @Test
[09/51] [abbrv] geode git commit: GEODE-2632: use immutable SecurityService impls to improve performance
http://git-wip-us.apache.org/repos/asf/geode/blob/0211029b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/ClearRegion.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/ClearRegion.java b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/ClearRegion.java index ab19954..610af43 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/ClearRegion.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/ClearRegion.java @@ -35,6 +35,7 @@ import org.apache.geode.internal.cache.tier.sockets.ServerConnection; import org.apache.geode.internal.i18n.LocalizedStrings; import org.apache.geode.internal.logging.log4j.LocalizedMessage; import org.apache.geode.internal.security.AuthorizeRequest; +import org.apache.geode.internal.security.SecurityService; public class ClearRegion extends BaseCommand { @@ -47,8 +48,8 @@ public class ClearRegion extends BaseCommand { } @Override - public void cmdExecute(Message clientMessage, ServerConnection serverConnection, long start) - throws IOException, InterruptedException { + public void cmdExecute(final Message clientMessage, final ServerConnection serverConnection, + final SecurityService securityService, long start) throws IOException, InterruptedException { Part regionNamePart = null, callbackArgPart = null; String regionName = null; Object callbackArg = null; @@ -115,7 +116,7 @@ public class ClearRegion extends BaseCommand { try { // Clear the region - this.securityService.authorizeRegionWrite(regionName); + securityService.authorizeRegionWrite(regionName); AuthorizeRequest authzRequest = serverConnection.getAuthzRequest(); if (authzRequest != null) { http://git-wip-us.apache.org/repos/asf/geode/blob/0211029b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/ClientReady.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/ClientReady.java b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/ClientReady.java index cf9c470..ae95cae 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/ClientReady.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/ClientReady.java @@ -20,6 +20,7 @@ package org.apache.geode.internal.cache.tier.sockets.command; import org.apache.geode.internal.cache.tier.Command; import org.apache.geode.internal.cache.tier.sockets.*; import org.apache.geode.distributed.internal.DistributionStats; +import org.apache.geode.internal.security.SecurityService; import java.io.IOException; @@ -35,8 +36,8 @@ public class ClientReady extends BaseCommand { private ClientReady() {} @Override - public void cmdExecute(Message clientMessage, ServerConnection serverConnection, long start) - throws IOException { + public void cmdExecute(final Message clientMessage, final ServerConnection serverConnection, + final SecurityService securityService, long start) throws IOException { CacheServerStats stats = serverConnection.getCacheServerStats(); { long oldStart = start; http://git-wip-us.apache.org/repos/asf/geode/blob/0211029b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/CloseConnection.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/CloseConnection.java b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/CloseConnection.java index 21f0cad..ed050bd 100755 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/CloseConnection.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/CloseConnection.java @@ -27,6 +27,7 @@ import org.apache.geode.internal.cache.tier.sockets.CacheServerStats; import org.apache.geode.internal.cache.tier.sockets.Message; import org.apache.geode.internal.cache.tier.sockets.Part; import org.apache.geode.internal.cache.tier.sockets.ServerConnection; +import org.apache.geode.internal.security.SecurityService; public class CloseConnection extends BaseCommand { @@ -39,8 +40,8 @@ public class CloseConnection extends BaseCommand { private CloseConnection() {} @Override - public void cmdExecute(Message clientMessage, ServerConnection serverConnection, long start) - throws IOException { + public void cmdExecute(final Message clientMessage, final ServerConnection serverConnection, + final SecurityService securityService, long start) throws IOException { CacheServerStats st
[38/51] [abbrv] geode git commit: GEODE-2818: add alias to any command's options that involves "group", "member", "jar" and replace CliString variables with GROUP, MEMBER, JAR, etc.
http://git-wip-us.apache.org/repos/asf/geode/blob/db8e1df3/geode-core/src/main/java/org/apache/geode/management/internal/cli/i18n/CliStrings.java -- diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/i18n/CliStrings.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/i18n/CliStrings.java index 2758429..0829495 100644 --- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/i18n/CliStrings.java +++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/i18n/CliStrings.java @@ -75,6 +75,13 @@ import java.text.MessageFormat; */ public class CliStrings { + public static final String GROUP = "group"; + public static final String GROUPS = "groups"; + public static final String MEMBER = "member"; + public static final String MEMBERS = "members"; + public static final String JAR = "jar"; + public static final String JARS = "jars"; + private static final String LOG_LEVEL_VALUES = "Possible values for log-level include: ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF."; @@ -301,7 +308,6 @@ public class CliStrings { "Alter a region with the given path and configuration."; public static final String ALTER_REGION__REGION = "name"; public static final String ALTER_REGION__REGION__HELP = "Name/Path of the region to be altered."; - public static final String ALTER_REGION__GROUP = "group"; public static final String ALTER_REGION__GROUP__HELP = "Group(s) of members on which the region will be altered."; public static final String ALTER_REGION__ENTRYEXPIRATIONIDLETIME = "entry-idle-time-expiration"; @@ -384,10 +390,9 @@ public class CliStrings { public static final String ALTER_RUNTIME_CONFIG = "alter runtime"; public static final String ALTER_RUNTIME_CONFIG__HELP = "Alter a subset of member or members configuration properties while running."; - public static final String ALTER_RUNTIME_CONFIG__MEMBER = "member"; public static final String ALTER_RUNTIME_CONFIG__MEMBER__HELP = "Name/Id of the member in whose configuration will be altered."; - public static final String ALTER_RUNTIME_CONFIG__GROUP = "group"; + public static final String ALTER_RUNTIME_CONFIG__GROUP__HELP = "Group of members whose configuration will be altered."; public static final String ALTER_RUNTIME_CONFIG__ARCHIVE__FILE__SIZE__LIMIT = @@ -481,7 +486,6 @@ public class CliStrings { public static final String COMPACT_DISK_STORE__NAME = "name"; public static final String COMPACT_DISK_STORE__NAME__HELP = "Name of the disk store to be compacted."; - public static final String COMPACT_DISK_STORE__GROUP = "group"; public static final String COMPACT_DISK_STORE__GROUP__HELP = "Group(s) of members that will perform disk compaction. If no group is specified the disk store will be compacted by all members."; public static final String COMPACT_DISK_STORE__DISKSTORE_0_DOESNOT_EXIST = @@ -657,7 +661,6 @@ public class CliStrings { public static final String CREATE_ASYNC_EVENT_QUEUE__LISTENER_PARAM_AND_VALUE = "listener-param"; public static final String CREATE_ASYNC_EVENT_QUEUE__LISTENER_PARAM_AND_VALUE__HELP = "Parameter name for the AsyncEventListener. Optionally, parameter names may be followed by # and a value for the parameter. Example: --listener-param=loadAll --listener-param=maxRead#1024"; - public static final String CREATE_ASYNC_EVENT_QUEUE__GROUP = "group"; public static final String CREATE_ASYNC_EVENT_QUEUE__GROUP__HELP = "Group(s) of members on which queue will be created. If no group is specified the queue will be created on all members."; public static final String CREATE_ASYNC_EVENT_QUEUE__ERROR_WHILE_CREATING_REASON_0 = @@ -701,7 +704,6 @@ public class CliStrings { public static final String CREATE_DISK_STORE__DIRECTORY_AND_SIZE = "dir"; public static final String CREATE_DISK_STORE__DIRECTORY_AND_SIZE__HELP = "Directories where the disk store files will be written, the directories will be created if they don't exist. Optionally, directory names may be followed by # and the maximum number of megabytes that the disk store can use in the directory. Example: --dir=/data/ds1 --dir=/data/ds2#5000"; - public static final String CREATE_DISK_STORE__GROUP = "group"; public static final String CREATE_DISK_STORE__GROUP__HELP = "Group(s) of members on which the disk store will be created. If no group is specified the disk store will be created on all members."; public static final String CREATE_DISK_STORE__DISK_USAGE_WARNING_PCT = @@ -727,13 +729,11 @@ public class CliStrings { public static final String CREATE_INDEX__REGION = "region"; public static final String CREATE_INDEX__REGION__HELP = "Name/Path of the region which corresponds to the \"from\" clause in a query."; - public static final String CREATE_INDEX__MEMBER = "m
[48/51] [abbrv] geode git commit: GEODE-3060: Introduce JUnit rule for testing the fully-assembled GFSH
GEODE-3060: Introduce JUnit rule for testing the fully-assembled GFSH Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/d9869ffd Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/d9869ffd Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/d9869ffd Branch: refs/heads/feature/GEM-1483 Commit: d9869ffd5b317c9e577f3ee2107a8d4bf46a166d Parents: b616e80 Author: Jared Stewart Authored: Wed Jun 7 20:44:56 2017 -0700 Committer: Jared Stewart Committed: Wed Jun 14 11:18:36 2017 -0700 -- .../cli/commands/StatusLocatorRealGfshTest.java | 50 .../geode/test/dunit/rules/gfsh/GfshRule.java | 116 + .../geode/test/dunit/rules/gfsh/GfshScript.java | 124 +++ 3 files changed, 290 insertions(+) -- http://git-wip-us.apache.org/repos/asf/geode/blob/d9869ffd/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/commands/StatusLocatorRealGfshTest.java -- diff --git a/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/commands/StatusLocatorRealGfshTest.java b/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/commands/StatusLocatorRealGfshTest.java new file mode 100644 index 000..82ee240 --- /dev/null +++ b/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/commands/StatusLocatorRealGfshTest.java @@ -0,0 +1,50 @@ +/* + * 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.management.internal.cli.commands; + +import org.apache.geode.test.dunit.rules.gfsh.GfshRule; +import org.apache.geode.test.dunit.rules.gfsh.GfshScript; +import org.apache.geode.test.junit.categories.DistributedTest; +import org.apache.geode.test.junit.categories.IntegrationTest; +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import java.io.File; +import java.util.concurrent.TimeUnit; + +@Category(DistributedTest.class) +public class StatusLocatorRealGfshTest { + @Rule + public GfshRule gfshRule = new GfshRule(); + + @Test + public void statusLocatorSucceedsWhenConnected() throws Exception { +gfshRule.execute(GfshScript.of("start locator --name=locator1").awaitAtMost(1, TimeUnit.MINUTES) +.expectExitCode(0)); + +gfshRule.execute(GfshScript.of("connect", "status locator --name=locator1") +.awaitAtMost(1, TimeUnit.MINUTES).expectExitCode(0)); + } + + @Test + public void statusLocatorFailsWhenNotConnected() throws Exception { +gfshRule.execute(GfshScript.of("start locator --name=locator1").awaitAtMost(1, TimeUnit.MINUTES) +.expectExitCode(0)); + +gfshRule.execute(GfshScript.of("status locator --name=locator1") +.awaitAtMost(1, TimeUnit.MINUTES).expectExitCode(1)); + } +} http://git-wip-us.apache.org/repos/asf/geode/blob/d9869ffd/geode-assembly/src/test/java/org/apache/geode/test/dunit/rules/gfsh/GfshRule.java -- diff --git a/geode-assembly/src/test/java/org/apache/geode/test/dunit/rules/gfsh/GfshRule.java b/geode-assembly/src/test/java/org/apache/geode/test/dunit/rules/gfsh/GfshRule.java new file mode 100644 index 000..8109377 --- /dev/null +++ b/geode-assembly/src/test/java/org/apache/geode/test/dunit/rules/gfsh/GfshRule.java @@ -0,0 +1,116 @@ +/* + * 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, eith
[19/51] [abbrv] geode git commit: GEODE-2420: Warn a user if they try to export too much data, update gfsh command ref to match latest code changes
GEODE-2420: Warn a user if they try to export too much data, update gfsh command ref to match latest code changes Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/d55ef2ed Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/d55ef2ed Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/d55ef2ed Branch: refs/heads/feature/GEM-1483 Commit: d55ef2ed3fb20182201955216b7fd3271bf33206 Parents: d5bde9f Author: Dave Barnes Authored: Fri Jun 9 15:38:28 2017 -0700 Committer: Dave Barnes Committed: Fri Jun 9 15:38:28 2017 -0700 -- .../gfsh/command-pages/export.html.md.erb | 18 +++--- 1 file changed, 11 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/d55ef2ed/geode-docs/tools_modules/gfsh/command-pages/export.html.md.erb -- diff --git a/geode-docs/tools_modules/gfsh/command-pages/export.html.md.erb b/geode-docs/tools_modules/gfsh/command-pages/export.html.md.erb index f0c6d54..e9c79d3 100644 --- a/geode-docs/tools_modules/gfsh/command-pages/export.html.md.erb +++ b/geode-docs/tools_modules/gfsh/command-pages/export.html.md.erb @@ -186,23 +186,27 @@ export logs [--dir=value] [--group=value(,value)*] [--member=value(,value)*] | \\-\\-end-time | Log entries that occurred before this time will be exported. Format: /MM/dd/HH/mm/ss/SSS/z OR /MM/dd | no limit | | \\-\\-logs-only | Whether to export only logs (not statistics) | If parameter not specified: false. If parameter specified without a value: true | | \\-\\-stats-only | Whether to export only statistics (not logs) | If parameter not specified: false. If parameter specified without a value: true | -| \\-\\-file-size-limit | Limits size of the file that can be exported. Specify 0 (zero) for no limit. Value is in megabytes by default or [k,m,g,t] may be specified. | If parameter not specified: 100m. If parameter specified without a value: 0 | +| \\-\\-file-size-limit | Limits total unzipped size of the exported files. Specify 0 (zero) for no limit. Value is in megabytes by default or [k,m,g,t] may be specified. | If parameter not specified: 100m. If parameter specified without a value: 0 | Table 4. Export Logs Parameters -**Example Commands:** +**Example commands, showing output:** ``` pre -export logs --dir=data/logs +gfsh>export logs --dir=data/logs +Logs exported to the connected member's file system: /my-locator/data/logs/exportedLogs_1489513007261.zip ``` -**Sample Output:** - ``` pre -gfsh>export logs -Logs exported to the connected member's file system: /data/my-locator/exportedLogs_1489513007261.zip +gfsh>export logs --dir=data/logs --file-size-limit=1k +Estimated exported logs expanded file size = 95599, file-size-limit = 1024. +To disable exported logs file size check use option "--file-size-limit=0". + +gfsh>export logs --dir=data/logs --file-size-limit=99k +Logs exported to the connected member's file system: /my-locator/data/logs/exportedLogs_1489513007261.zip ``` + ## export offline-disk-store Export region data from an offline disk store into gemfire snapshot files.
[14/51] [abbrv] geode git commit: GEODE-3044: User Manual: Update Swagger screen shots to match latest code revision
GEODE-3044: User Manual: Update Swagger screen shots to match latest code revision Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/76784ebf Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/76784ebf Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/76784ebf Branch: refs/heads/feature/GEM-1483 Commit: 76784ebfcc7fc03c47335808c29f3dc7a221362d Parents: 1ff5ccf Author: Dave Barnes Authored: Fri Jun 9 14:26:33 2017 -0700 Committer: Dave Barnes Committed: Fri Jun 9 14:26:49 2017 -0700 -- geode-docs/images/swagger_home.png | Bin 122516 -> 114824 bytes geode-docs/images/swagger_region_endpoints.png | Bin 95740 -> 92167 bytes geode-docs/rest_apps/using_swagger.html.md.erb | 2 +- 3 files changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/76784ebf/geode-docs/images/swagger_home.png -- diff --git a/geode-docs/images/swagger_home.png b/geode-docs/images/swagger_home.png index b494bf5..f4fe335 100644 Binary files a/geode-docs/images/swagger_home.png and b/geode-docs/images/swagger_home.png differ http://git-wip-us.apache.org/repos/asf/geode/blob/76784ebf/geode-docs/images/swagger_region_endpoints.png -- diff --git a/geode-docs/images/swagger_region_endpoints.png b/geode-docs/images/swagger_region_endpoints.png index faa64f0..bc458ca 100644 Binary files a/geode-docs/images/swagger_region_endpoints.png and b/geode-docs/images/swagger_region_endpoints.png differ http://git-wip-us.apache.org/repos/asf/geode/blob/76784ebf/geode-docs/rest_apps/using_swagger.html.md.erb -- diff --git a/geode-docs/rest_apps/using_swagger.html.md.erb b/geode-docs/rest_apps/using_swagger.html.md.erb index cc8d617..05f4129 100644 --- a/geode-docs/rest_apps/using_swagger.html.md.erb +++ b/geode-docs/rest_apps/using_swagger.html.md.erb @@ -53,7 +53,7 @@ Specify an `http-service-port` for the developer REST service, as the default po server1 | Region "/region1" created on "server1" ``` -4. In Swagger, click on **pdx-based-crud-controller : region CRUD operations** to list all the available endpoints for accessing regions. +4. In Swagger, click on **region : region CRUD operations** to list all the available endpoints for accessing regions. 5. In the list of **region** endpoints, click on the **GET /v1** endpoint link. The page displays additional request and response information about the API. 6. Click the **Try it out!** button. Any regions you added in step 5 are returned in the response body.
[03/51] [abbrv] geode git commit: GEODE-2632: use immutable SecurityService impls to improve performance
http://git-wip-us.apache.org/repos/asf/geode/blob/0211029b/geode-core/src/test/java/org/apache/geode/internal/security/DisabledSecurityServiceTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/internal/security/DisabledSecurityServiceTest.java b/geode-core/src/test/java/org/apache/geode/internal/security/DisabledSecurityServiceTest.java new file mode 100644 index 000..cacbeed --- /dev/null +++ b/geode-core/src/test/java/org/apache/geode/internal/security/DisabledSecurityServiceTest.java @@ -0,0 +1,164 @@ +/* + * 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.security; + +import static org.assertj.core.api.Assertions.*; +import static org.mockito.Mockito.*; + +import org.apache.geode.security.PostProcessor; +import org.apache.geode.test.junit.categories.UnitTest; +import org.apache.shiro.subject.Subject; +import org.apache.shiro.subject.support.SubjectThreadState; +import org.apache.shiro.util.ThreadState; +import org.apache.geode.security.SecurityManager; +import org.junit.Before; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import java.util.Properties; +import java.util.concurrent.Callable; + +@Category(UnitTest.class) +public class DisabledSecurityServiceTest { + + private DisabledSecurityService disabledSecurityService; + private Subject mockSubject; + + @Before + public void before() throws Exception { +this.disabledSecurityService = new DisabledSecurityService(); +this.mockSubject = mock(Subject.class); + } + + @Test + public void bindSubject_null() throws Exception { +ThreadState threadState = this.disabledSecurityService.bindSubject(null); +assertThat(threadState).isNull(); + } + + @Test + public void bindSubject_subject_shouldReturnThreadState() throws Exception { +ThreadState threadState = this.disabledSecurityService.bindSubject(this.mockSubject); +assertThat(threadState).isNotNull().isInstanceOf(SubjectThreadState.class); + } + + @Test + public void getSubject_beforeLogin_shouldReturnNull() throws Exception { +Subject subject = this.disabledSecurityService.getSubject(); +assertThat(subject).isNull(); + } + + @Test + public void login_null_shouldReturnNull() throws Exception { +Subject subject = this.disabledSecurityService.login(null); +assertThat(subject).isNull(); + } + + @Test + public void login_properties_shouldReturnNull() throws Exception { +Subject subject = this.disabledSecurityService.login(new Properties()); +assertThat(subject).isNull(); + } + + @Test + public void getSubject_afterLogin_shouldReturnNull() throws Exception { +this.disabledSecurityService.login(new Properties()); +Subject subject = this.disabledSecurityService.getSubject(); +assertThat(subject).isNull(); + } + + @Test + public void getSubject_afterLogout_shouldReturnNull() throws Exception { +this.disabledSecurityService.login(new Properties()); +this.disabledSecurityService.logout(); +Subject subject = this.disabledSecurityService.getSubject(); +assertThat(subject).isNull(); + } + + @Test + public void associateWith_callable_shouldReturnSameCallable() throws Exception { +Callable mockCallable = mock(Callable.class); +Callable callable = this.disabledSecurityService.associateWith(mockCallable); +assertThat(callable).isNotNull().isSameAs(mockCallable); + } + + @Test + public void associateWith_null_should() throws Exception { +Callable callable = this.disabledSecurityService.associateWith(null); +assertThat(callable).isNull(); + } + + @Test + public void needPostProcess_returnsFalse() throws Exception { +boolean needPostProcess = this.disabledSecurityService.needPostProcess(); +assertThat(needPostProcess).isFalse(); + } + + @Test + public void postProcess1_value_shouldReturnSameValue() throws Exception { +Object value = new Object(); +Object result = this.disabledSecurityService.postProcess(null, null, value, false); +assertThat(result).isNotNull().isSameAs(value); + } + + @Test + public void postProcess1_null_returnsNull() throws Exception { +Object result =
[28/51] [abbrv] geode git commit: GEODE-2928: get rid of the isGfshVM static variable
GEODE-2928: get rid of the isGfshVM static variable * consolidate the availability indicators * remove the isGfshVM and isGfshVM() method * enhance the MultiStepCommand to include info on shellOnly commands to enhance command validation * remove the SUPPORT_MULTIPLE_GFSH static flag and properly remove the gfsh instance at the end of each test Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/f85d2163 Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/f85d2163 Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/f85d2163 Branch: refs/heads/feature/GEM-1483 Commit: f85d216341f4887e80d428f68dc8dfd2824dda5f Parents: d1db2f0 Author: Jinmei Liao Authored: Fri May 19 08:58:30 2017 -0700 Committer: Jinmei Liao Committed: Mon Jun 12 13:54:39 2017 -0700 -- .../geode/internal/GfeConsoleReaderFactory.java | 11 ++-- .../geode/management/cli/CliMetaData.java | 4 +- .../geode/management/internal/cli/CliUtil.java | 9 --- .../internal/cli/commands/ClientCommands.java | 10 .../commands/CommandAvailabilityIndicator.java | 63 .../internal/cli/commands/ConfigCommands.java | 10 .../CreateAlterDestroyRegionCommands.java | 10 .../internal/cli/commands/DataCommands.java | 19 +- .../internal/cli/commands/DeployCommands.java | 10 .../cli/commands/DiskStoreCommands.java | 14 - .../cli/commands/DurableClientCommands.java | 26 +++- ...xportImportClusterConfigurationCommands.java | 10 .../internal/cli/commands/FunctionCommands.java | 10 .../internal/cli/commands/IndexCommands.java| 8 --- .../cli/commands/LauncherLifecycleCommands.java | 9 --- .../internal/cli/commands/MemberCommands.java | 29 +++-- .../cli/commands/MiscellaneousCommands.java | 11 .../internal/cli/commands/PDXCommands.java | 14 - .../internal/cli/commands/QueueCommands.java| 11 .../internal/cli/commands/RegionCommands.java | 10 .../internal/cli/commands/ShellCommands.java| 7 --- .../internal/cli/commands/StatusCommands.java | 22 ++- .../internal/cli/commands/WanCommands.java | 52 ++-- .../cli/functions/DataCommandFunction.java | 4 +- .../cli/multistep/CLIMultiStepHelper.java | 21 ++- .../cli/multistep/MultiStepCommand.java | 4 ++ .../cli/remote/RemoteExecutionStrategy.java | 26 +++- .../internal/cli/result/AbstractResultData.java | 63 +--- .../management/internal/cli/shell/Gfsh.java | 11 +--- .../cli/shell/GfshExecutionStrategy.java| 2 +- .../geode/management/DataCommandMBeanTest.java | 59 ++ .../management/internal/cli/HeadlessGfsh.java | 11 +--- .../cli/commands/CliCommandTestBase.java| 4 -- .../cli/commands/MemberCommandsDUnitTest.java | 9 --- .../cli/commands/ShowDeadlockDUnitTest.java | 13 .../dunit/rules/GfshShellConnectionRule.java| 3 - .../internal/cli/LuceneIndexCommands.java | 10 +++- 37 files changed, 243 insertions(+), 376 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/f85d2163/geode-core/src/main/java/org/apache/geode/internal/GfeConsoleReaderFactory.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/GfeConsoleReaderFactory.java b/geode-core/src/main/java/org/apache/geode/internal/GfeConsoleReaderFactory.java index 120d625..8c5dba2 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/GfeConsoleReaderFactory.java +++ b/geode-core/src/main/java/org/apache/geode/internal/GfeConsoleReaderFactory.java @@ -15,12 +15,12 @@ package org.apache.geode.internal; -import java.io.Console; - -import org.apache.geode.management.internal.cli.CliUtil; import org.apache.geode.management.internal.cli.LogWrapper; +import org.apache.geode.management.internal.cli.shell.Gfsh; import org.apache.geode.management.internal.cli.util.GfshConsoleReader; +import java.io.Console; + /** * Factory for Console Reader Utility. * @@ -39,13 +39,12 @@ public class GfeConsoleReaderFactory { public static GfeConsoleReader createConsoleReader() { GfeConsoleReader consoleReader = null; -if (CliUtil.isGfshVM()) { +if (Gfsh.getCurrentInstance() != null) { LogWrapper.getInstance().info("GfeConsoleReaderFactory.createConsoleReader(): isGfshVM"); consoleReader = new GfshConsoleReader(); LogWrapper.getInstance().info("GfeConsoleReaderFactory.createConsoleReader(): consoleReader: " + consoleReader + "=" + consoleReader.isSupported()); -} -if (consoleReader == null) { +} else { consoleReader = new GfeConsoleReader(); } return consoleReader; http://gi
[16/51] [abbrv] geode git commit: Fix spotless failure
Fix spotless failure Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/8a10c1aa Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/8a10c1aa Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/8a10c1aa Branch: refs/heads/feature/GEM-1483 Commit: 8a10c1aac11f6383d720738c2a99164e3a5c04a9 Parents: 214cd73 Author: Jared Stewart Authored: Fri Jun 9 15:16:27 2017 -0700 Committer: Jared Stewart Committed: Fri Jun 9 15:16:27 2017 -0700 -- .../internal/tcpserver/TCPServerSSLJUnitTest.java| 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/8a10c1aa/geode-core/src/test/java/org/apache/geode/distributed/internal/tcpserver/TCPServerSSLJUnitTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/distributed/internal/tcpserver/TCPServerSSLJUnitTest.java b/geode-core/src/test/java/org/apache/geode/distributed/internal/tcpserver/TCPServerSSLJUnitTest.java index b3a0901..ee70018 100644 --- a/geode-core/src/test/java/org/apache/geode/distributed/internal/tcpserver/TCPServerSSLJUnitTest.java +++ b/geode-core/src/test/java/org/apache/geode/distributed/internal/tcpserver/TCPServerSSLJUnitTest.java @@ -76,10 +76,9 @@ public class TCPServerSSLJUnitTest { localhost = InetAddress.getLocalHost(); port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET); -server = -new DummyTcpServer(port, localhost, sslProperties, null, Mockito.mock(TcpHandler.class), -Mockito.mock(PoolStatHelper.class), Thread.currentThread().getThreadGroup(), -"server thread"); +server = new DummyTcpServer(port, localhost, sslProperties, null, +Mockito.mock(TcpHandler.class), Mockito.mock(PoolStatHelper.class), +Thread.currentThread().getThreadGroup(), "server thread"); server.start(); } @@ -140,8 +139,8 @@ public class TCPServerSSLJUnitTest { private List recordedSocketsTimeouts = new ArrayList<>(); public DummyTcpServer(int port, InetAddress bind_address, Properties sslConfig, - DistributionConfigImpl cfg, TcpHandler handler, PoolStatHelper poolHelper, - ThreadGroup threadGroup, String threadName) { +DistributionConfigImpl cfg, TcpHandler handler, PoolStatHelper poolHelper, +ThreadGroup threadGroup, String threadName) { super(port, bind_address, sslConfig, cfg, handler, poolHelper, threadGroup, threadName); if (cfg == null) { cfg = new DistributionConfigImpl(sslConfig);
[47/51] [abbrv] geode git commit: GEODE-2558: Upgrade Powermock version to fix failing tests
GEODE-2558: Upgrade Powermock version to fix failing tests Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/b616e80d Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/b616e80d Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/b616e80d Branch: refs/heads/feature/GEM-1483 Commit: b616e80d1f9583eead82917f95ba5d9da4eb4f05 Parents: 0d43e3d Author: Jared Stewart Authored: Wed Jun 14 10:14:55 2017 -0700 Committer: Kirk Lund Committed: Wed Jun 14 11:06:33 2017 -0700 -- .../cache/tier/sockets/command/Put61Test.java | 28 - .../cache/tier/sockets/command/Put65Test.java | 26 .../cache/tier/sockets/command/PutTest.java | 32 +--- .../internal/statistics/StatisticsImplTest.java | 6 ++-- gradle/dependency-versions.properties | 4 +-- 5 files changed, 46 insertions(+), 50 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/b616e80d/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put61Test.java -- diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put61Test.java b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put61Test.java index fb3a9dd..bd99e6c 100644 --- a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put61Test.java +++ b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put61Test.java @@ -14,29 +14,22 @@ */ package org.apache.geode.internal.cache.tier.sockets.command; -import static org.assertj.core.api.Assertions.*; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Matchers.eq; import static org.mockito.Matchers.isA; -import static org.mockito.Mockito.*; - -import org.junit.Before; -import org.junit.Test; -import org.junit.experimental.categories.Category; -import org.mockito.ArgumentCaptor; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; +import static org.mockito.Mockito.doThrow; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; import org.apache.geode.CancelCriterion; import org.apache.geode.cache.operations.PutOperationContext; import org.apache.geode.internal.Version; -import org.apache.geode.internal.cache.EntryEventImpl; import org.apache.geode.internal.cache.InternalCache; import org.apache.geode.internal.cache.LocalRegion; import org.apache.geode.internal.cache.tier.CachedRegionHelper; import org.apache.geode.internal.cache.tier.sockets.CacheServerStats; -import org.apache.geode.internal.cache.tier.sockets.ClientProxyMembershipID; import org.apache.geode.internal.cache.tier.sockets.Message; import org.apache.geode.internal.cache.tier.sockets.Part; import org.apache.geode.internal.cache.tier.sockets.ServerConnection; @@ -44,6 +37,13 @@ import org.apache.geode.internal.security.AuthorizeRequest; import org.apache.geode.internal.security.SecurityService; import org.apache.geode.security.NotAuthorizedException; import org.apache.geode.test.junit.categories.UnitTest; +import org.junit.Before; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.mockito.ArgumentCaptor; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; @Category(UnitTest.class) public class Put61Test { @@ -107,7 +107,7 @@ public class Put61Test { when(this.deltaPart.getObject()).thenReturn(true); -when(this.eventPart.getSerializedForm()).thenReturn(this.EVENT); +when(this.eventPart.getSerializedForm()).thenReturn(EVENT); when(this.valuePart.getSerializedForm()).thenReturn(VALUE); when(this.valuePart.isObject()).thenReturn(true); @@ -132,7 +132,7 @@ public class Put61Test { when(this.serverConnection.getClientVersion()).thenReturn(Version.CURRENT); when(this.localRegion.basicBridgePut(eq(KEY), eq(VALUE), eq(VALUE), eq(true), eq(CALLBACK_ARG), -any(ClientProxyMembershipID.class), eq(true), any(EntryEventImpl.class))).thenReturn(true); +any(), eq(true), any())).thenReturn(true); } @Test http://git-wip-us.apache.org/repos/asf/geode/blob/b616e80d/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put65Test.java -- diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put65Test.java b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put65Test.java index 81f17cb..8d52b88 100644
[40/51] [abbrv] geode git commit: GEODE-2818: add aliases to the undeploy command
GEODE-2818: add aliases to the undeploy command * this closes #560 Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/a6433273 Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/a6433273 Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/a6433273 Branch: refs/heads/feature/GEM-1483 Commit: a6433273251528d2cda3b5f1e6dc4dad4360275f Parents: db8e1df Author: Jinmei Liao Authored: Wed Jun 7 16:10:56 2017 -0700 Committer: Jinmei Liao Committed: Wed Jun 14 08:59:51 2017 -0700 -- .../internal/cli/commands/ConfigCommands.java | 7 +-- .../internal/cli/commands/DeployCommands.java | 50 +++- .../internal/cli/functions/DeployFunction.java | 3 -- .../cli/functions/UndeployFunction.java | 9 ++-- .../cli/GfshParserAutoCompletionTest.java | 6 +-- .../cli/commands/DeployCommandsDUnitTest.java | 36 +- 6 files changed, 74 insertions(+), 37 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/a6433273/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ConfigCommands.java -- diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ConfigCommands.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ConfigCommands.java index 19c72c3..a8afa7d 100644 --- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ConfigCommands.java +++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ConfigCommands.java @@ -81,9 +81,10 @@ public class ConfigCommands implements GfshCommand { @ResourceOperation(resource = Resource.CLUSTER, operation = Operation.READ) public Result describeConfig( @CliOption(key = CliStrings.MEMBER, optionContext = ConverterHint.ALL_MEMBER_IDNAME, - help = CliStrings.DESCRIBE_CONFIG__MEMBER__HELP, mandatory = true) - - String memberNameOrId, @CliOption(key = CliStrings.DESCRIBE_CONFIG__HIDE__DEFAULTS, help = CliStrings.DESCRIBE_CONFIG__HIDE__DEFAULTS__HELP, unspecifiedDefaultValue = "true", specifiedDefaultValue = "true") boolean hideDefaults) { + help = CliStrings.DESCRIBE_CONFIG__MEMBER__HELP, mandatory = true) String memberNameOrId, + @CliOption(key = CliStrings.DESCRIBE_CONFIG__HIDE__DEFAULTS, + help = CliStrings.DESCRIBE_CONFIG__HIDE__DEFAULTS__HELP, unspecifiedDefaultValue = "true", + specifiedDefaultValue = "true") boolean hideDefaults) { Result result = null; try { http://git-wip-us.apache.org/repos/asf/geode/blob/a6433273/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DeployCommands.java -- diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DeployCommands.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DeployCommands.java index 43a748e..9b79e1d 100644 --- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DeployCommands.java +++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DeployCommands.java @@ -15,6 +15,8 @@ package org.apache.geode.management.internal.cli.commands; import static org.apache.commons.io.FileUtils.ONE_MB; +import org.apache.commons.lang.ArrayUtils; +import org.apache.commons.lang.StringUtils; import org.apache.geode.SystemFailure; import org.apache.geode.cache.execute.ResultCollector; @@ -66,7 +68,7 @@ public class DeployCommands implements GfshCommand { * Deploy one or more JAR files to members of a group or all members. * * @param groups Group(s) to deploy the JAR to or null for all members - * @param jar JAR file to deploy + * @param jars JAR file to deploy * @param dir Directory of JAR files to deploy * @return The result of the attempt to deploy */ @@ -77,7 +79,8 @@ public class DeployCommands implements GfshCommand { public Result deploy( @CliOption(key = {CliStrings.GROUP, CliStrings.GROUPS}, help = CliStrings.DEPLOY__GROUP__HELP, optionContext = ConverterHint.MEMBERGROUP) String[] groups, - @CliOption(key = {CliStrings.JAR}, help = CliStrings.DEPLOY__JAR__HELP) String jar, + @CliOption(key = {CliStrings.JAR, CliStrings.JARS}, + help = CliStrings.DEPLOY__JAR__HELP) String[] jars, @CliOption(key = {CliStrings.DEPLOY__DIR}, help = CliStrings.DEPLOY__DIR__HELP) String dir) { try { @@ -157,8 +160,8 @@ public class DeployCommands implements GfshCommand { @CliOption(key = {CliStrings.GROUP, CliStrings.GROUPS}, help = CliStrings.UNDEPLOY__GROUP__HELP, optionContext = ConverterHint.
[24/51] [abbrv] geode git commit: GEODE-3065: Making RedisServerTest Flaky, bind exceptions
GEODE-3065: Making RedisServerTest Flaky, bind exceptions Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/122b07af Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/122b07af Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/122b07af Branch: refs/heads/feature/GEM-1483 Commit: 122b07afde7cd56898fae354fadc78fdd5dc721d Parents: 70483db Author: Udo Kohlmeyer Authored: Sat Jun 10 09:12:23 2017 -0700 Committer: Udo Kohlmeyer Committed: Sat Jun 10 09:12:23 2017 -0700 -- .../src/test/java/org/apache/geode/redis/RedisServerTest.java| 4 1 file changed, 4 insertions(+) -- http://git-wip-us.apache.org/repos/asf/geode/blob/122b07af/geode-core/src/test/java/org/apache/geode/redis/RedisServerTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/redis/RedisServerTest.java b/geode-core/src/test/java/org/apache/geode/redis/RedisServerTest.java index 81e639d..fcef010 100644 --- a/geode-core/src/test/java/org/apache/geode/redis/RedisServerTest.java +++ b/geode-core/src/test/java/org/apache/geode/redis/RedisServerTest.java @@ -18,6 +18,7 @@ import org.apache.geode.cache.Cache; import org.apache.geode.cache.CacheFactory; import org.apache.geode.cache.DataPolicy; import org.apache.geode.cache.Region; +import org.apache.geode.test.junit.categories.FlakyTest; import org.apache.geode.test.junit.categories.IntegrationTest; import org.junit.After; import org.junit.Before; @@ -49,6 +50,7 @@ public class RedisServerTest { } @Test + @Category(FlakyTest.class) // GEODE-3065 public void initializeRedisCreatesThreeRegions() { createCache(); assert (cache.rootRegions().size() == 0); @@ -59,6 +61,7 @@ public class RedisServerTest { } @Test + @Category(FlakyTest.class) // GEODE-3065 public void initializeRedisCreatesPartitionedRegionByDefault() { createCache(); assert (cache.rootRegions().size() == 0); @@ -70,6 +73,7 @@ public class RedisServerTest { } @Test + @Category(FlakyTest.class) // GEODE-3065 public void initializeRedisCreatesRegionsUsingSystemProperty() { createCache(); assert (cache.rootRegions().size() == 0);
[18/51] [abbrv] geode git commit: Add GfshParserRule to facilitate command unit tests
Add GfshParserRule to facilitate command unit tests Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/0ef7f56b Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/0ef7f56b Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/0ef7f56b Branch: refs/heads/feature/GEM-1483 Commit: 0ef7f56bd7a82afbd2af1e6968aaaed4303905c7 Parents: 8a10c1a Author: Jinmei Liao Authored: Sun Jun 4 23:51:42 2017 -0700 Committer: Jared Stewart Committed: Fri Jun 9 15:17:11 2017 -0700 -- .../management/internal/cli/GfshParser.java | 33 +-- .../internal/cli/remote/CommandProcessor.java | 3 +- .../management/internal/cli/shell/Gfsh.java | 3 +- .../cli/GfshParserAutoCompletionTest.java | 222 +-- .../internal/cli/GfshParserConverterTest.java | 95 +++- .../internal/cli/GfshParserParsingTest.java | 10 +- .../commands/LauncherLifecycleCommandsTest.java | 51 + .../geode/test/dunit/rules/GfshParserRule.java | 126 +++ 8 files changed, 321 insertions(+), 222 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/0ef7f56b/geode-core/src/main/java/org/apache/geode/management/internal/cli/GfshParser.java -- diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/GfshParser.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/GfshParser.java index b5c24cb..c31c50d 100755 --- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/GfshParser.java +++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/GfshParser.java @@ -53,34 +53,20 @@ public class GfshParser extends SimpleParser { private static Pattern PATTERN = Pattern.compile("\\s*([^\\s']*)'([^']*)'\\s+|\\s*([^\\s\"]*)\"([^\"]*)\"\\s+|\\S+"); - - private CommandManager commandManager = null; - - public GfshParser() { -this(null); - } - - public GfshParser(Properties cacheProperties) { -this.commandManager = new CommandManager(cacheProperties); - + public GfshParser(CommandManager commandManager) { for (CommandMarker command : commandManager.getCommandMarkers()) { add(command); } -List> converters = commandManager.getConverters(); -for (Converter converter : converters) { +for (Converter converter : commandManager.getConverters()) { if (converter.getClass().isAssignableFrom(ArrayConverter.class)) { ArrayConverter arrayConverter = (ArrayConverter) converter; -arrayConverter.setConverters(new HashSet<>(converters)); +arrayConverter.setConverters(new HashSet<>(commandManager.getConverters())); } add(converter); } } - public CommandManager getCommandManager() { -return commandManager; - } - static String convertToSimpleParserInput(String userInput) { List inputTokens = splitUserInput(userInput); return getSimpleParserInputFromTokens(inputTokens); @@ -294,19 +280,6 @@ public class GfshParser extends SimpleParser { return cursor; } - // convenience method for testing - int completeAdvanced(String userInput, final List candidates) { -return completeAdvanced(userInput, userInput.length(), candidates); - } - - /** - * test only used to demonstrate what's the super class's completeAdvanced behavior - * - */ - int completeSuperAdvanced(String userInput, final List candidates) { -return super.completeAdvanced(userInput, userInput.length(), candidates); - } - /** * @param buffer use the buffer to find the completion candidates * http://git-wip-us.apache.org/repos/asf/geode/blob/0ef7f56b/geode-core/src/main/java/org/apache/geode/management/internal/cli/remote/CommandProcessor.java -- diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/remote/CommandProcessor.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/remote/CommandProcessor.java index 7ec7699..6e5b650 100755 --- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/remote/CommandProcessor.java +++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/remote/CommandProcessor.java @@ -19,6 +19,7 @@ import org.apache.geode.internal.security.SecurityServiceFactory; import org.apache.geode.management.cli.CommandProcessingException; import org.apache.geode.management.cli.CommandStatement; import org.apache.geode.management.cli.Result; +import org.apache.geode.management.internal.cli.CommandManager; import org.apache.geode.management.internal.cli.GfshParser; import org.apache.geode.management.internal.cli.LogWrapper; import org.apache.geode.management.internal.cli.result.ResultBuilder; @@ -5
[45/51] [abbrv] geode git commit: GEODE-2626: fix FastLoggerJUnitTest use of Mockito 2.7.11
GEODE-2626: fix FastLoggerJUnitTest use of Mockito 2.7.11 Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/e3a1ae07 Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/e3a1ae07 Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/e3a1ae07 Branch: refs/heads/feature/GEM-1483 Commit: e3a1ae07c4837a5df5b1874490b9ec96f4c16ac8 Parents: c41d788 Author: Kirk Lund Authored: Tue Jun 13 11:00:07 2017 -0700 Committer: Kirk Lund Committed: Wed Jun 14 11:06:33 2017 -0700 -- .../apache/geode/internal/logging/log4j/FastLoggerJUnitTest.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/e3a1ae07/geode-core/src/test/java/org/apache/geode/internal/logging/log4j/FastLoggerJUnitTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/internal/logging/log4j/FastLoggerJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/logging/log4j/FastLoggerJUnitTest.java index e162087..891ac3c 100755 --- a/geode-core/src/test/java/org/apache/geode/internal/logging/log4j/FastLoggerJUnitTest.java +++ b/geode-core/src/test/java/org/apache/geode/internal/logging/log4j/FastLoggerJUnitTest.java @@ -16,7 +16,6 @@ package org.apache.geode.internal.logging.log4j; import static org.hamcrest.CoreMatchers.*; import static org.junit.Assert.*; -import static org.mockito.Mockito.any; import static org.mockito.Mockito.*; import org.apache.logging.log4j.Level; @@ -97,7 +96,7 @@ public class FastLoggerJUnitTest { assertThat(fastLogger.isDebugEnabled(), is(true)); assertThat(fastLogger.isDebugEnabled(this.mockedMarker), is(true)); -verify(this.mockedLogger, times(1)).isEnabled(eq(Level.DEBUG), any(Marker.class), +verify(this.mockedLogger, times(1)).isEnabled(eq(Level.DEBUG), isNull(Marker.class), isNull(String.class)); verify(this.mockedLogger, times(1)).isEnabled(eq(Level.DEBUG), eq(this.mockedMarker), isNull(Object.class), isNull(Throwable.class));
[07/51] [abbrv] geode git commit: GEODE-2632: use immutable SecurityService impls to improve performance
http://git-wip-us.apache.org/repos/asf/geode/blob/0211029b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/PutAll70.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/PutAll70.java b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/PutAll70.java index fb2bdb8..1bf4955 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/PutAll70.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/PutAll70.java @@ -12,9 +12,6 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. */ -/** - * Author: Gester Zhou - */ package org.apache.geode.internal.cache.tier.sockets.command; import java.io.IOException; @@ -49,12 +46,12 @@ import org.apache.geode.internal.cache.versions.VersionTag; import org.apache.geode.internal.i18n.LocalizedStrings; import org.apache.geode.internal.logging.log4j.LocalizedMessage; import org.apache.geode.internal.security.AuthorizeRequest; +import org.apache.geode.internal.security.SecurityService; public class PutAll70 extends BaseCommand { private final static PutAll70 singleton = new PutAll70(); - public static Command getCommand() { return singleton; } @@ -62,8 +59,8 @@ public class PutAll70 extends BaseCommand { private PutAll70() {} @Override - public void cmdExecute(Message clientMessage, ServerConnection serverConnection, long startp) - throws IOException, InterruptedException { + public void cmdExecute(final Message clientMessage, final ServerConnection serverConnection, + final SecurityService securityService, long startp) throws IOException, InterruptedException { long start = startp; // copy this since we need to modify it Part regionNamePart = null, numberOfKeysPart = null, keyPart = null, valuePart = null; String regionName = null; @@ -73,7 +70,7 @@ public class PutAll70 extends BaseCommand { boolean replyWithMetaData = false; VersionedObjectList response = null; -StringBuffer errMessage = new StringBuffer(); +StringBuilder errMessage = new StringBuilder(); CachedRegionHelper crHelper = serverConnection.getCachedRegionHelper(); CacheServerStats stats = serverConnection.getCacheServerStats(); @@ -209,7 +206,7 @@ public class PutAll70 extends BaseCommand { serverConnection.setRequestSpecificTimeout(timeout); } - this.securityService.authorizeRegionWrite(regionName); + securityService.authorizeRegionWrite(regionName); AuthorizeRequest authzRequest = serverConnection.getAuthzRequest(); if (authzRequest != null) { http://git-wip-us.apache.org/repos/asf/geode/blob/0211029b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/PutAll80.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/PutAll80.java b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/PutAll80.java index c6c26f7..3a8f0db 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/PutAll80.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/PutAll80.java @@ -12,9 +12,6 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. */ -/** - * Author: Gester Zhou - */ package org.apache.geode.internal.cache.tier.sockets.command; import java.io.IOException; @@ -50,6 +47,7 @@ import org.apache.geode.internal.cache.versions.VersionTag; import org.apache.geode.internal.i18n.LocalizedStrings; import org.apache.geode.internal.logging.log4j.LocalizedMessage; import org.apache.geode.internal.security.AuthorizeRequest; +import org.apache.geode.internal.security.SecurityService; import org.apache.geode.internal.util.Breadcrumbs; public class PutAll80 extends BaseCommand { @@ -75,8 +73,8 @@ public class PutAll80 extends BaseCommand { } @Override - public void cmdExecute(Message clientMessage, ServerConnection serverConnection, long startp) - throws IOException, InterruptedException { + public void cmdExecute(final Message clientMessage, final ServerConnection serverConnection, + final SecurityService securityService, long startp) throws IOException, InterruptedException { long start = startp; // copy this since we need to modify it Part regionNamePart = null, numberOfKeysPart = null, keyPart = null, valuePart = null; String regionName = null; @@ -86,7 +84,7 @@ public class PutAll80 extends BaseCommand { boolean replyWithMetaData = false; VersionedObjectList response = null; -StringBuffer errMessage = new StringBuffer(); +
[06/51] [abbrv] geode git commit: GEODE-2632: use immutable SecurityService impls to improve performance
http://git-wip-us.apache.org/repos/asf/geode/blob/0211029b/geode-core/src/main/java/org/apache/geode/internal/security/EnabledSecurityService.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/security/EnabledSecurityService.java b/geode-core/src/main/java/org/apache/geode/internal/security/EnabledSecurityService.java new file mode 100644 index 000..f971dee --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/internal/security/EnabledSecurityService.java @@ -0,0 +1,387 @@ +/* + * 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.security; + +import org.apache.commons.lang.SerializationException; +import org.apache.commons.lang.StringUtils; +import org.apache.geode.GemFireIOException; +import org.apache.geode.internal.cache.EntryEventImpl; +import org.apache.geode.internal.logging.LogService; +import org.apache.geode.internal.security.shiro.GeodeAuthenticationToken; +import org.apache.geode.internal.security.shiro.RealmInitializer; +import org.apache.geode.internal.security.shiro.ShiroPrincipal; +import org.apache.geode.internal.util.BlobHelper; +import org.apache.geode.management.internal.security.ResourceOperation; +import org.apache.geode.security.AuthenticationFailedException; +import org.apache.geode.security.GemFireSecurityException; +import org.apache.geode.security.NotAuthorizedException; +import org.apache.geode.security.PostProcessor; +import org.apache.geode.security.ResourcePermission; +import org.apache.geode.security.ResourcePermission.Operation; +import org.apache.geode.security.ResourcePermission.Resource; +import org.apache.geode.security.SecurityManager; +import org.apache.logging.log4j.Logger; +import org.apache.shiro.SecurityUtils; +import org.apache.shiro.ShiroException; +import org.apache.shiro.subject.Subject; +import org.apache.shiro.subject.support.SubjectThreadState; +import org.apache.shiro.util.ThreadContext; +import org.apache.shiro.util.ThreadState; + +import java.io.IOException; +import java.io.Serializable; +import java.security.AccessController; +import java.util.Properties; +import java.util.Set; +import java.util.concurrent.Callable; + +/** + * Security service with SecurityManager and an optional PostProcessor. + */ +public class EnabledSecurityService implements SecurityService { + private static Logger logger = LogService.getLogger(LogService.SECURITY_LOGGER_NAME); + + private final SecurityManager securityManager; + + private final PostProcessor postProcessor; + + EnabledSecurityService(final SecurityManager securityManager, final PostProcessor postProcessor, + final RealmInitializer realmInitializer) { +this.securityManager = securityManager; +this.postProcessor = postProcessor; +realmInitializer.initialize(this.securityManager); + } + + @Override + public void initSecurity(final Properties securityProps) { +this.securityManager.init(securityProps); +if (this.postProcessor != null) { + this.postProcessor.init(securityProps); +} + } + + /** + * It first looks the shiro subject in AccessControlContext since JMX will use multiple threads to + * process operations from the same client, then it looks into Shiro's thead context. + * + * @return the shiro subject, null if security is not enabled + */ + @Override + public Subject getSubject() { +Subject currentUser; + +// First try get the principal out of AccessControlContext instead of Shiro's Thread context +// since threads can be shared between JMX clients. +javax.security.auth.Subject jmxSubject = +javax.security.auth.Subject.getSubject(AccessController.getContext()); + +if (jmxSubject != null) { + Set principals = jmxSubject.getPrincipals(ShiroPrincipal.class); + if (!principals.isEmpty()) { +ShiroPrincipal principal = principals.iterator().next(); +currentUser = principal.getSubject(); +ThreadContext.bind(currentUser); +return currentUser; + } +} + +// in other cases like rest call, client operations, we get it from the current thread +currentUser = SecurityUtils.getSubject(); + +if (current
[27/51] [abbrv] geode git commit: GEODE-290: Remove deprecated methods from launcher classes
GEODE-290: Remove deprecated methods from launcher classes * Removed deprecated stopWithPort from LocatorLauncher class. * Removed deprecated members from LocatorLauncher and ServerLauncher classes. * Modified test cases to use constants alternate to deprecated ones. This closes #568 Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/d1db2f02 Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/d1db2f02 Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/d1db2f02 Branch: refs/heads/feature/GEM-1483 Commit: d1db2f02d2ce45a437b34488934e5b1d53c7b5ca Parents: ad4e405 Author: Deepak Dixit Authored: Tue Jun 6 22:39:14 2017 +0530 Committer: Kirk Lund Committed: Mon Jun 12 11:22:51 2017 -0700 -- .../geode/distributed/LocatorLauncher.java | 26 .../geode/distributed/ServerLauncher.java | 14 --- .../geode/distributed/LocatorLauncherTest.java | 6 ++--- .../geode/distributed/ServerLauncherTest.java | 4 +-- 4 files changed, 5 insertions(+), 45 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/d1db2f02/geode-core/src/main/java/org/apache/geode/distributed/LocatorLauncher.java -- diff --git a/geode-core/src/main/java/org/apache/geode/distributed/LocatorLauncher.java b/geode-core/src/main/java/org/apache/geode/distributed/LocatorLauncher.java index c175744..c5a2de8 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/LocatorLauncher.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/LocatorLauncher.java @@ -86,12 +86,6 @@ import joptsimple.OptionSet; @SuppressWarnings({"unused"}) public class LocatorLauncher extends AbstractLauncher { - /** - * @deprecated This is specific to the internal implementation and may go away in a future - * release. - */ - public static final Integer DEFAULT_LOCATOR_PORT = getDefaultLocatorPort(); - private static final Boolean DEFAULT_LOAD_SHARED_CONFIG_FROM_DIR = Boolean.FALSE; private static final Map helpMap = new HashMap<>(); @@ -137,12 +131,6 @@ public class LocatorLauncher extends AbstractLauncher { usageMap.put(Command.VERSION, "version"); } - /** - * @deprecated This is specific to the internal implementation and may go away in a future - * release. - */ - public static final String DEFAULT_LOCATOR_PID_FILE = "vf.gf.locator.pid"; - private static final String DEFAULT_LOCATOR_LOG_EXT = ".log"; private static final String DEFAULT_LOCATOR_LOG_NAME = "locator"; private static final String LOCATOR_SERVICE_NAME = "Locator"; @@ -1082,20 +1070,6 @@ public class LocatorLauncher extends AbstractLauncher { } } - @Deprecated - private LocatorState stopWithPort() { -try { - new TcpClient().stop(getBindAddress(), getPort()); - return new LocatorState(this, Status.STOPPED); -} catch (ConnectException e) { - if (getBindAddress() == null) { -return createNoResponseState(e, "Failed to connect to locator on port " + getPort()); - } else { -return createNoResponseState(e, "Failed to connect to locator on " + getId()); - } -} - } - private LocatorState stopWithWorkingDirectory() { int parsedPid = 0; try { http://git-wip-us.apache.org/repos/asf/geode/blob/d1db2f02/geode-core/src/main/java/org/apache/geode/distributed/ServerLauncher.java -- diff --git a/geode-core/src/main/java/org/apache/geode/distributed/ServerLauncher.java b/geode-core/src/main/java/org/apache/geode/distributed/ServerLauncher.java index 395b262..158e7bf 100755 --- a/geode-core/src/main/java/org/apache/geode/distributed/ServerLauncher.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/ServerLauncher.java @@ -98,13 +98,6 @@ import joptsimple.OptionSet; @SuppressWarnings({"unused"}) public class ServerLauncher extends AbstractLauncher { - /** - * @deprecated This is specific to the internal implementation and may go away in a future - * release. - */ - @Deprecated - protected static final Integer DEFAULT_SERVER_PORT = getDefaultServerPort(); - private static final Map helpMap = new HashMap<>(); static { @@ -154,13 +147,6 @@ public class ServerLauncher extends AbstractLauncher { usageMap.put(Command.VERSION, "version"); } - /** - * @deprecated This is specific to the internal implementation and may go away in a future - * release. - */ - @Deprecated - public static final String DEFAULT_SERVER_PID_FILE = "vf.gf.server.pid"; - private static final String DEFAULT_SERVER_LOG_EXT = ".log"; private static final String DEFAULT_SERVER_LOG_NAME = "gemfire"; priva
[31/51] [abbrv] geode git commit: GEODE-3048: Introduce a rule to identify tests that require GEODE_HOME
GEODE-3048: Introduce a rule to identify tests that require GEODE_HOME Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/2c4b5372 Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/2c4b5372 Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/2c4b5372 Branch: refs/heads/feature/GEM-1483 Commit: 2c4b53722b43ea654114b9e730bbba4ee0472482 Parents: eb3312a Author: Jared Stewart Authored: Mon Jun 12 14:18:07 2017 -0700 Committer: Jared Stewart Committed: Mon Jun 12 15:36:00 2017 -0700 -- .../test/dunit/rules/RequiresGeodeHome.java | 50 1 file changed, 50 insertions(+) -- http://git-wip-us.apache.org/repos/asf/geode/blob/2c4b5372/geode-assembly/src/test/java/org/apache/geode/test/dunit/rules/RequiresGeodeHome.java -- diff --git a/geode-assembly/src/test/java/org/apache/geode/test/dunit/rules/RequiresGeodeHome.java b/geode-assembly/src/test/java/org/apache/geode/test/dunit/rules/RequiresGeodeHome.java new file mode 100644 index 000..02f474f --- /dev/null +++ b/geode-assembly/src/test/java/org/apache/geode/test/dunit/rules/RequiresGeodeHome.java @@ -0,0 +1,50 @@ +/* + * 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.test.dunit.rules; + +import static org.apache.commons.lang.SystemUtils.LINE_SEPARATOR; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.assertNotNull; + +import java.io.File; + +import org.junit.rules.ExternalResource; + +/** + * This {@code Rule} is used to indicate tests that require the GEODE_HOME environment varible to be + * set. (For example, any test that relies on the assembled Pulse WAR or GFSH binary.) + */ +public class RequiresGeodeHome extends ExternalResource { + private static final String GEODE_HOME_NOT_SET_MESSAGE = + "This test requires a GEODE_HOME environment variable that points to the location " + + "of geode-assembly/build/install/apache-geode." + LINE_SEPARATOR + + "For instructions on how to set this variable if running tests through IntelliJ, see " + + "https://stackoverflow.com/a/32761503/3988499";; + + @Override + protected void before() { +getGeodeHome(); + } + + public File getGeodeHome() { +String geodeHomePath = System.getenv("GEODE_HOME"); +assertNotNull(GEODE_HOME_NOT_SET_MESSAGE, geodeHomePath); + +File geodeHome = new File(geodeHomePath); +assertThat(geodeHome).exists(); + +return geodeHome; + } +}
[26/51] [abbrv] geode git commit: Update geode-book README instructions
Update geode-book README instructions Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/ad4e405f Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/ad4e405f Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/ad4e405f Branch: refs/heads/feature/GEM-1483 Commit: ad4e405f86364aa59e59616d78303961724ffed4 Parents: f541043 Author: Dave Barnes Authored: Mon Jun 12 11:21:31 2017 -0700 Committer: Dave Barnes Committed: Mon Jun 12 11:22:08 2017 -0700 -- geode-book/README.md | 22 -- 1 file changed, 16 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/ad4e405f/geode-book/README.md -- diff --git a/geode-book/README.md b/geode-book/README.md index db753f7..f381b16 100644 --- a/geode-book/README.md +++ b/geode-book/README.md @@ -65,17 +65,27 @@ For Geode, a preconfigured **book** is provided in the directory `{geode-project ## Publishing the User Guide to the Geode Website -Once you have reviewed your local build of the User Guide, you can move it to the Apache Geode website by doing the following: +Once you have reviewed your local build of the User Guide, you can publish it by copying it to the Apache Geode website. The target directory should contain a Geode version number. -1. Navigate to: `{geode-project-dir}/geode-book/final_app/public/docs/guide/NN`, where `NN` is the product version of your documentation (e.g., `{geode-project-dir}/geode-book/final_app/public/docs/guide/11` if you are building the documentation for Apache Geode 1.1). +To copy the User Guide to the website repo: -2. To move the directory, enter: +1. Create the destination directory by navigating to the geode-site repo. Check out the *master* branch and create a destination directory for the User Guide. The naming convention is: + +``` +{geode-site}/website/content/docs/guide/XY +``` +where `XY` is the product version of your documentation (e.g., `{geode-site}/website/content/docs/guide/12` if you are publishing the documentation for Apache Geode 1.2). + +2. Navigate to the User Guide you have built in the Geode repository: `{geode-project-dir}/geode-book/final_app/public/docs/guide/XY`. + +3. Use `tar` to copy the directory in order to preserve links and other filesystem niceties. Create the tarfile in your Desktop for easy access on the retrieval side. + + To copy the directory, enter: ``` $ tar cvf ~/Desktop/new-guide-content.tar . -$ cd ../../../../../../geode-site/website/content/docs/guide/NN +$ cd {geode-site}/website/content/docs/guide/XY $ tar xvf ~/Desktop/new-guide-content.tar ``` - **Note:** If the "`NN`" directory doesn't exist in the `{geode-project-dir}/geode-site/website/content/docs/guide/` directory, you will need to create it first. -3. Follow the instructions at `{geode-project-dir}/geode-site/website/README.md` to build, review, and publish the Apache Geode website. +4. Follow the instructions in the README.md file on the *master* branch of the geode-site repo (`{geode-site}/README.md`) to build, review, and publish the Apache Geode website. You can also view the geode-site README.md file on [github: https://github.com/apache/geode-site](https://github.com/apache/geode-site).
[13/51] [abbrv] geode git commit: GEODE-3025: Lucene queries are not allowed withing a transaction.
GEODE-3025: Lucene queries are not allowed withing a transaction. This closes #562 Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/1ff5ccfe Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/1ff5ccfe Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/1ff5ccfe Branch: refs/heads/feature/GEM-1483 Commit: 1ff5ccfe3816ae475b62f2ed76189252afb26832 Parents: 2579a0d Author: nabarun Authored: Thu Jun 8 10:33:04 2017 -0700 Committer: nabarun Committed: Fri Jun 9 13:46:59 2017 -0700 -- .../cache/lucene/internal/LuceneQueryImpl.java | 3 ++ .../distributed/LuceneQueryFunction.java| 1 - .../LuceneIndexMaintenanceIntegrationTest.java | 26 -- .../lucene/LuceneQueriesClientDUnitTest.java| 38 .../internal/LuceneQueryImplJUnitTest.java | 12 ++- 5 files changed, 14 insertions(+), 66 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/1ff5ccfe/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneQueryImpl.java -- diff --git a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneQueryImpl.java b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneQueryImpl.java index 328eb3f..e84b27e 100644 --- a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneQueryImpl.java +++ b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneQueryImpl.java @@ -108,6 +108,9 @@ public class LuceneQueryImpl implements LuceneQuery { TopEntriesCollectorManager manager = new TopEntriesCollectorManager(null, limit); LuceneFunctionContext context = new LuceneFunctionContext<>(query, indexName, manager, limit); +if (region.getCache().getCacheTransactionManager().exists()) { + throw new LuceneQueryException(LUCENE_QUERY_CANNOT_BE_EXECUTED_WITHIN_A_TRANSACTION); +} // TODO provide a timeout to the user? TopEntries entries = null; http://git-wip-us.apache.org/repos/asf/geode/blob/1ff5ccfe/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/distributed/LuceneQueryFunction.java -- diff --git a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/distributed/LuceneQueryFunction.java b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/distributed/LuceneQueryFunction.java index b60652f..c40b3a4 100644 --- a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/distributed/LuceneQueryFunction.java +++ b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/distributed/LuceneQueryFunction.java @@ -21,7 +21,6 @@ import java.util.Collection; import org.apache.geode.cache.CacheClosedException; import org.apache.geode.cache.execute.Function; -import org.apache.geode.cache.lucene.LuceneIndexDestroyedException; import org.apache.geode.cache.lucene.LuceneIndexNotFoundException; import org.apache.geode.cache.lucene.internal.LuceneIndexImpl; import org.apache.geode.cache.lucene.internal.LuceneIndexStats; http://git-wip-us.apache.org/repos/asf/geode/blob/1ff5ccfe/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneIndexMaintenanceIntegrationTest.java -- diff --git a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneIndexMaintenanceIntegrationTest.java b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneIndexMaintenanceIntegrationTest.java index f9273c1..2f39d78 100644 --- a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneIndexMaintenanceIntegrationTest.java +++ b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneIndexMaintenanceIntegrationTest.java @@ -46,32 +46,6 @@ public class LuceneIndexMaintenanceIntegrationTest extends LuceneIntegrationTest private static int WAIT_FOR_FLUSH_TIME = 1; - @Test - public void indexIsNotUpdatedIfTransactionHasNotCommittedYet() throws Exception { -luceneService.createIndexFactory().setFields("title", "description").create(INDEX_NAME, -REGION_NAME); - -Region region = createRegion(REGION_NAME, RegionShortcut.PARTITION); -region.put("object-1", new TestObject("title 1", "hello world")); -region.put("object-2", new TestObject("title 2", "this will not match")); -region.put("object-3", new TestObject("title 3", "hello world")); -region.put("object-4", new TestObject("hello world", "hello world")); - -LuceneIndex index = luceneService.getIndex(INDEX_NAME, REGION_NAME); -luceneService.waitUntilFlushed(INDEX_NAME, REGION_NAME, WAIT_FOR_FLUSH_TIME, -TimeUnit.MILLISECONDS); -LuceneQue
[50/51] [abbrv] geode git commit: GEODE-3055: real root cause is: The old primary's the shadow bucket is not initialized when rebalance remove it. Thus the new primary candidate can never initialize f
GEODE-3055: real root cause is: The old primary's the shadow bucket is not initialized when rebalance remove it. Thus the new primary candidate can never initialize from it. The fix is to wait until new primary exists before remove the old primary's bucket in rebalance. Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/56a3fa75 Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/56a3fa75 Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/56a3fa75 Branch: refs/heads/feature/GEM-1483 Commit: 56a3fa75ad35943b1e447af00bdba37d3d225297 Parents: 32c74ec Author: zhouxh Authored: Wed Jun 14 14:31:30 2017 -0700 Committer: zhouxh Committed: Wed Jun 14 15:01:32 2017 -0700 -- .../asyncqueue/internal/AsyncEventQueueImpl.java | 5 ++--- .../internal/cache/PartitionedRegionDataStore.java | 17 ++--- .../internal/cache/wan/AbstractGatewaySender.java | 6 ++ ...tilParallelGatewaySenderFlushedCoordinator.java | 16 +--- ...elGatewaySenderFlushedCoordinatorJUnitTest.java | 15 +-- .../distributed/WaitUntilFlushedFunction.java | 12 +--- .../WaitUntilFlushedFunctionJUnitTest.java | 5 + 7 files changed, 26 insertions(+), 50 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/56a3fa75/geode-core/src/main/java/org/apache/geode/cache/asyncqueue/internal/AsyncEventQueueImpl.java -- diff --git a/geode-core/src/main/java/org/apache/geode/cache/asyncqueue/internal/AsyncEventQueueImpl.java b/geode-core/src/main/java/org/apache/geode/cache/asyncqueue/internal/AsyncEventQueueImpl.java index a420dab..bf7e874 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/asyncqueue/internal/AsyncEventQueueImpl.java +++ b/geode-core/src/main/java/org/apache/geode/cache/asyncqueue/internal/AsyncEventQueueImpl.java @@ -217,8 +217,7 @@ public class AsyncEventQueueImpl implements AsyncEventQueue { return ((AbstractGatewaySender) this.sender).isForwardExpirationDestroy(); } - public boolean waitUntilFlushed(Set bucketIds, long timeout, TimeUnit unit) - throws InterruptedException { -return ((AbstractGatewaySender) this.sender).waitUntilFlushed(bucketIds, timeout, unit); + public boolean waitUntilFlushed(long timeout, TimeUnit unit) throws InterruptedException { +return ((AbstractGatewaySender) this.sender).waitUntilFlushed(timeout, unit); } } http://git-wip-us.apache.org/repos/asf/geode/blob/56a3fa75/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionDataStore.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionDataStore.java b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionDataStore.java index 7cef0a5..74b8e6d 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionDataStore.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionDataStore.java @@ -1472,6 +1472,19 @@ public class PartitionedRegionDataStore implements HasCachePerfStats { } BucketAdvisor bucketAdvisor = bucketRegion.getBucketAdvisor(); + InternalDistributedMember primary = bucketAdvisor.getPrimary(); + InternalDistributedMember myId = + this.partitionedRegion.getDistributionManager().getDistributionManagerId(); + if (primary == null || myId.equals(primary)) { +if (logger.isDebugEnabled()) { + logger.debug("Bucket region " + bucketRegion + + " does not have a remote primary yet. Not to remove."); +} +return false; + } + if (logger.isDebugEnabled()) { +logger.debug("Bucket region " + bucketRegion + " has primary at " + primary); + } Lock writeLock = bucketAdvisor.getActiveWriteLock(); // Fix for 43613 - don't remove the bucket @@ -1512,9 +1525,7 @@ public class PartitionedRegionDataStore implements HasCachePerfStats { // wait for in progress writes. I choose to use the StateFlushOperation // because it won't block write operations while we're trying to acquire // the activePrimaryMoveLock - InternalDistributedMember primary = bucketAdvisor.getPrimary(); - InternalDistributedMember myId = - this.partitionedRegion.getDistributionManager().getDistributionManagerId(); + primary = bucketAdvisor.getPrimary(); if (!myId.equals(primary)) { StateFlushOperation flush = new StateFlushOperation(bucketRegion); int executor = DistributionManager.WAITING_POOL_EXECUTOR; http://git-wip-us.apache.org/repos/asf/geode/blob/56a3fa75/geode-core/src/main/java/org/apache/geode/in
[15/51] [abbrv] geode git commit: GEODE-3023: TcpServer move soTimout for the socket for SSL Locators
GEODE-3023: TcpServer move soTimout for the socket for SSL Locators Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/214cd732 Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/214cd732 Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/214cd732 Branch: refs/heads/feature/GEM-1483 Commit: 214cd732d17b20252f8b52b24dedfa088ec3b245 Parents: 76784eb Author: Udo Kohlmeyer Authored: Fri Jun 9 15:06:14 2017 -0700 Committer: Udo Kohlmeyer Committed: Fri Jun 9 15:06:14 2017 -0700 -- .../internal/tcpserver/TcpServer.java | 67 .../tcpserver/TCPServerSSLJUnitTest.java| 167 +++ .../internal/tcpserver/TcpServerJUnitTest.java | 40 ++--- .../geode/internal/net/DummySocketCreator.java | 45 + 4 files changed, 266 insertions(+), 53 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/214cd732/geode-core/src/main/java/org/apache/geode/distributed/internal/tcpserver/TcpServer.java -- diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/tcpserver/TcpServer.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/tcpserver/TcpServer.java index 86fe532..976f504 100755 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/tcpserver/TcpServer.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/tcpserver/TcpServer.java @@ -14,32 +14,6 @@ */ package org.apache.geode.distributed.internal.tcpserver; -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.EOFException; -import java.io.File; -import java.io.IOException; -import java.io.StreamCorruptedException; -import java.net.InetAddress; -import java.net.ServerSocket; -import java.net.Socket; -import java.net.SocketAddress; -import java.net.URL; -import java.util.Date; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.Properties; -import java.util.concurrent.SynchronousQueue; -import java.util.concurrent.ThreadFactory; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicInteger; - -import javax.net.ssl.SSLException; - -import org.apache.logging.log4j.Logger; - import org.apache.geode.CancelException; import org.apache.geode.DataSerializer; import org.apache.geode.SystemFailure; @@ -62,6 +36,31 @@ import org.apache.geode.internal.logging.LogService; import org.apache.geode.internal.net.SocketCreator; import org.apache.geode.internal.net.SocketCreatorFactory; import org.apache.geode.internal.security.SecurableCommunicationChannel; +import org.apache.logging.log4j.Logger; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.EOFException; +import java.io.File; +import java.io.IOException; +import java.io.StreamCorruptedException; +import java.net.InetAddress; +import java.net.ServerSocket; +import java.net.Socket; +import java.net.SocketAddress; +import java.net.URL; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Properties; +import java.util.concurrent.SynchronousQueue; +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; +import javax.net.ssl.SSLException; /** * TCP server which listens on a port and delegates requests to a request handler. The server uses @@ -128,7 +127,7 @@ public class TcpServer { private final String threadName; private volatile Thread serverThread; - private SocketCreator socketCreator; + protected SocketCreator socketCreator; /* * GemStoneAddition - Initialize versions map. Warning: This map must be compatible with all @@ -164,13 +163,14 @@ public class TcpServer { } cfg = new DistributionConfigImpl(sslConfig); } + } + protected SocketCreator getSocketCreator() { if (this.socketCreator == null) { this.socketCreator = SocketCreatorFactory.getSocketCreatorForComponent(SecurableCommunicationChannel.LOCATOR); -} else { - throw new RuntimeException("The socket Creator already exists"); } +return socketCreator; } private static PooledExecutorWithDMStats createExecutor(PoolStatHelper poolHelper, @@ -210,10 +210,10 @@ public class TcpServer { private void startServerThread() throws IOException { if (srv_sock == null || srv_sock.isClosed()) { if (bind_address == null) { -srv_sock = socketCreator.createServerSocket(port, BACKLOG); +srv_sock = getSocketCreator().createServerSocket(port, BAC
[32/51] [abbrv] geode git commit: GEODE-3068: fix alphabetic ordering
GEODE-3068: fix alphabetic ordering Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/65471c11 Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/65471c11 Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/65471c11 Branch: refs/heads/feature/GEM-1483 Commit: 65471c1174df161c46237f87145d81d27a1663a9 Parents: 2c4b537 Author: Kirk Lund Authored: Mon Jun 12 16:58:18 2017 -0700 Committer: Kirk Lund Committed: Mon Jun 12 16:58:18 2017 -0700 -- gradle/dependency-versions.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/65471c11/gradle/dependency-versions.properties -- diff --git a/gradle/dependency-versions.properties b/gradle/dependency-versions.properties index 98deadc..132ea86 100644 --- a/gradle/dependency-versions.properties +++ b/gradle/dependency-versions.properties @@ -21,6 +21,7 @@ bcel.version = 6.0 catch-exception.version = 1.4.4 catch-throwable.version = 1.4.4 cglib.version = 3.2.4 +codec.version = 1.10 commons-collections.version = 3.2.2 commons-configuration.version = 1.10 commons-fileupload.version = 1.3.2 @@ -65,7 +66,6 @@ junit-quickcheck.version = 0.7 JUnitParams.version = 1.0.6 log4j.version = 2.7 lucene.version = 6.4.1 -codec.version = 1.10 mockito-core.version = 1.10.19 mockrunner.version = 1.1.2 mortbay-jetty-servlet-api.version=3.0.20100224
[33/51] [abbrv] geode git commit: GEODE-2294: revert to avoid rest protocol change
GEODE-2294: revert to avoid rest protocol change Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/9faa9781 Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/9faa9781 Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/9faa9781 Branch: refs/heads/feature/GEM-1483 Commit: 9faa9781bfb7aadb54327dc4e09d5b86cc39253a Parents: 65471c1 Author: Jinmei Liao Authored: Tue Jun 13 10:28:08 2017 -0700 Committer: Jinmei Liao Committed: Tue Jun 13 10:56:00 2017 -0700 -- .../web/controllers/AbstractBaseController.java | 62 ++-- .../AbstractBaseControllerJUnitTest.java| 24 +--- 2 files changed, 45 insertions(+), 41 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/9faa9781/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/controllers/AbstractBaseController.java -- diff --git a/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/controllers/AbstractBaseController.java b/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/controllers/AbstractBaseController.java index d8eb572..00623c3 100644 --- a/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/controllers/AbstractBaseController.java +++ b/geode-web-api/src/main/java/org/apache/geode/rest/internal/web/controllers/AbstractBaseController.java @@ -14,41 +14,10 @@ */ package org.apache.geode.rest.internal.web.controllers; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URI; -import java.net.URLDecoder; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.atomic.AtomicLong; - -import javax.annotation.PostConstruct; - import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.ObjectMapper; -import org.apache.logging.log4j.Logger; -import org.json.JSONArray; -import org.json.JSONException; -import org.json.JSONObject; -import org.json.JSONTokener; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.util.Assert; -import org.springframework.util.ClassUtils; -import org.springframework.util.CollectionUtils; -import org.springframework.util.StringUtils; -import org.springframework.web.servlet.support.ServletUriComponentsBuilder; - import org.apache.geode.SerializationException; import org.apache.geode.cache.CacheLoaderException; import org.apache.geode.cache.CacheWriterException; @@ -81,6 +50,35 @@ import org.apache.geode.rest.internal.web.util.IdentifiableUtils; import org.apache.geode.rest.internal.web.util.JSONUtils; import org.apache.geode.rest.internal.web.util.NumberUtils; import org.apache.geode.rest.internal.web.util.ValidationUtils; +import org.apache.logging.log4j.Logger; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.json.JSONTokener; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.util.Assert; +import org.springframework.util.ClassUtils; +import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; +import org.springframework.web.servlet.support.ServletUriComponentsBuilder; + +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URI; +import java.net.URLDecoder; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.atomic.AtomicLong; +import javax.annotation.PostConstruct; /** * AbstractBaseController class contains common functionalities required for other controllers. @@ -722,7 +720,7 @@ public abstract class AbstractBaseController { } String convertErrorAsJson(String errorMessage) { -return ("{" + "\"message\"" + ":" + "\"" + errorMessage + "\"" + "}"); +return ("{" + "\"cause\"" + ":" + "\"" + errorMessage + "\"" + "}"); } String convertErrorAsJson(Throwable t) { http://git-wip-us.apache.org/repos/asf/geode/blob/9faa9781/geode-web-api/src/test/java/org/apache/geode/rest/internal/web/controllers/AbstractBaseCont
[25/51] [abbrv] geode git commit: GEODE-2925: add target for resource operation for finer grained security
GEODE-2925: add target for resource operation for finer grained security * add finer authorize* call in security service * add target to the MXBean authorization check * use enum type instead of raw strings for resource/operation Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/f5410435 Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/f5410435 Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/f5410435 Branch: refs/heads/feature/GEM-1483 Commit: f541043580bf245fbd4b62b2300c494ebc58ab6b Parents: 122b07a Author: Jinmei Liao Authored: Wed May 31 13:50:23 2017 -0700 Committer: Jinmei Liao Committed: Mon Jun 12 11:05:23 2017 -0700 -- .../security/ExampleSecurityManager.java| 6 +- .../security/CustomSecurityService.java | 93 +++- .../security/DisabledSecurityService.java | 59 - .../security/EnabledSecurityService.java| 80 + .../security/LegacySecurityService.java | 59 - .../internal/security/SecurityService.java | 23 +++-- .../cli/commands/DiskStoreCommands.java | 52 +-- .../internal/cli/remote/CommandProcessor.java | 6 +- .../internal/security/AccessControlMBean.java | 6 +- .../internal/security/MBeanServerWrapper.java | 13 ++- .../internal/security/ResourceOperation.java| 14 +-- .../geode/security/ResourcePermission.java | 75 ++-- .../security/ResourcePermissionTest.java| 67 -- .../internal/security/TestCommand.java | 33 --- .../security/SimpleSecurityManagerTest.java | 11 ++- .../geode/security/TestSecurityManager.java | 6 +- .../geode/codeAnalysis/excludedClasses.txt | 1 + .../web/security/RestSecurityService.java | 6 +- 18 files changed, 370 insertions(+), 240 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/f5410435/geode-core/src/main/java/org/apache/geode/examples/security/ExampleSecurityManager.java -- diff --git a/geode-core/src/main/java/org/apache/geode/examples/security/ExampleSecurityManager.java b/geode-core/src/main/java/org/apache/geode/examples/security/ExampleSecurityManager.java index 84f97de..c1d7ebf 100644 --- a/geode-core/src/main/java/org/apache/geode/examples/security/ExampleSecurityManager.java +++ b/geode-core/src/main/java/org/apache/geode/examples/security/ExampleSecurityManager.java @@ -21,6 +21,8 @@ import org.apache.geode.management.internal.security.ResourceConstants; import org.apache.geode.security.AuthenticationFailedException; import org.apache.geode.security.NotAuthorizedException; import org.apache.geode.security.ResourcePermission; +import org.apache.geode.security.ResourcePermission.Operation; +import org.apache.geode.security.ResourcePermission.Resource; import org.apache.geode.security.SecurityManager; import org.apache.shiro.authz.Permission; @@ -243,8 +245,8 @@ public class ExampleSecurityManager implements SecurityManager { String regionPart = (regionNames != null) ? regionNames : "*"; String keyPart = (keys != null) ? keys : "*"; -role.permissions -.add(new ResourcePermission(resourcePart, operationPart, regionPart, keyPart)); +role.permissions.add(new ResourcePermission(Resource.valueOf(resourcePart), +Operation.valueOf(operationPart), regionPart, keyPart)); } roleMap.put(role.name, role); http://git-wip-us.apache.org/repos/asf/geode/blob/f5410435/geode-core/src/main/java/org/apache/geode/internal/security/CustomSecurityService.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/security/CustomSecurityService.java b/geode-core/src/main/java/org/apache/geode/internal/security/CustomSecurityService.java index c4946e7..0ba1cb6 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/security/CustomSecurityService.java +++ b/geode-core/src/main/java/org/apache/geode/internal/security/CustomSecurityService.java @@ -14,13 +14,6 @@ */ package org.apache.geode.internal.security; -import java.io.IOException; -import java.io.Serializable; -import java.security.AccessController; -import java.util.Properties; -import java.util.Set; -import java.util.concurrent.Callable; - import org.apache.commons.lang.SerializationException; import org.apache.commons.lang.StringUtils; import org.apache.geode.GemFireIOException; @@ -32,8 +25,12 @@ import org.apache.geode.internal.util.BlobHelper; import org.apache.geode.security.AuthenticationFailedException; import org.apache.geode.security.GemFireSecurityException; import org.apache.geode.security.NotAuthorizedException;
[20/51] [abbrv] geode git commit: GEODE-3042: Quick doc of new string-based partition resolver
GEODE-3042: Quick doc of new string-based partition resolver This closes #572 Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/8c41fd32 Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/8c41fd32 Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/8c41fd32 Branch: refs/heads/feature/GEM-1483 Commit: 8c41fd32c4fea2ed3b682ab5c2fdf9d49f58abe9 Parents: d55ef2e Author: Karen Miller Authored: Fri Jun 9 14:37:04 2017 -0700 Committer: Karen Miller Committed: Fri Jun 9 15:48:13 2017 -0700 -- ...partitioning_and_data_colocation.html.md.erb | 13 ++- ...using_custom_partition_resolvers.html.md.erb | 106 +-- .../gfsh/command-pages/create.html.md.erb | 5 + 3 files changed, 89 insertions(+), 35 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/8c41fd32/geode-docs/developing/partitioned_regions/custom_partitioning_and_data_colocation.html.md.erb -- diff --git a/geode-docs/developing/partitioned_regions/custom_partitioning_and_data_colocation.html.md.erb b/geode-docs/developing/partitioned_regions/custom_partitioning_and_data_colocation.html.md.erb index 3e4f185..0876613 100644 --- a/geode-docs/developing/partitioned_regions/custom_partitioning_and_data_colocation.html.md.erb +++ b/geode-docs/developing/partitioned_regions/custom_partitioning_and_data_colocation.html.md.erb @@ -31,8 +31,15 @@ This figure shows a region with customer data that is grouped into buckets by cu -With custom partitioning, you have two choices: - +With custom partitioning, you have three choices: + +- **Default string-based partition resolver**. A default partition +resolver at `org.apache.geode.cache.util.StringPrefixPartitionResolver` +groups entries into buckets based on a string portion of the key. +All keys must be strings, specified with a syntax that includes +a '|' character that delimits the string. +The substring that precedes the '|' delimiter within the key +partitions the entry. - **Standard custom partitioning**. With standard partitioning, you group entries into buckets, but you do not specify where the buckets reside. Geode always keeps the entries in the buckets you have specified, but may move the buckets around for load balancing. - **Fixed custom partitioning**. With fixed partitioning, you provide standard partitioning plus you specify the exact member where each data entry resides. You do this by assigning the data entry to a bucket and to a partition and by naming specific members as primary and secondary hosts of each partition. @@ -53,6 +60,6 @@ This figure shows two regions with data colocation where the data is partitioned -Data colocation requires the same data partitioning mechanism for all of the colocated regions. You can use the default partitioning provided by Geode or custom partitioning. +Data colocation requires the same data partitioning mechanism for all of the colocated regions. You can use the default partitioning provided by Geode or any of the custom partitioning strategies. You must use the same high availability settings across your colocated regions. http://git-wip-us.apache.org/repos/asf/geode/blob/8c41fd32/geode-docs/developing/partitioned_regions/using_custom_partition_resolvers.html.md.erb -- diff --git a/geode-docs/developing/partitioned_regions/using_custom_partition_resolvers.html.md.erb b/geode-docs/developing/partitioned_regions/using_custom_partition_resolvers.html.md.erb index 61a0e36..40b2237 100644 --- a/geode-docs/developing/partitioned_regions/using_custom_partition_resolvers.html.md.erb +++ b/geode-docs/developing/partitioned_regions/using_custom_partition_resolvers.html.md.erb @@ -27,6 +27,7 @@ If you are colocating data between regions and custom partitioning the data in t +For the default implementation of string-based partitioning, use `org.apache.geode.cache.util.StringPrefixPartitionResolver`. For standard partitioning, use `org.apache.geode.cache.PartitionResolver`. To implement fixed partitioning, use `org.apache.geode.cache.FixedPartitionResolver`. @@ -34,18 +35,26 @@ For standard partitioning, use `org.apache.geode.cache.PartitionResolver`. To im **Prerequisites** - Create partitioned regions. See [Understanding Partitioning](how_partitioning_works.html) and [Configuring Partitioned Regions](managing_partitioned_regions.html#configure_partitioned_regions). -- Decide whether to use standard custom partitioning or fixed custom partitioning. See [Understanding Custom Partitioning and Data Colocation](custom_partitioning_and_data_colocation.html#custom_partitioning_and_data_colocation). +- Decide wheth
[49/51] [abbrv] geode git commit: GEODE-3070: Fix gemfire.jar to be geode-dependencies.jar
GEODE-3070: Fix gemfire.jar to be geode-dependencies.jar Updated a few other errors found along the way, including the name of the RAR file for JTA transactions, and outdated output of sample gfsh commands in the gfsh tutorial. Also added a final step that shuts down the cluster in the tutorial. This closes #579 Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/7bc31116 Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/7bc31116 Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/7bc31116 Branch: refs/heads/feature/GEM-1483 Commit: 7bc31116bdefcab96f68bdb37699b32d8c2dc10c Parents: d9869ff Author: Karen Miller Authored: Tue Jun 13 15:55:56 2017 -0700 Committer: Karen Miller Committed: Wed Jun 14 13:38:27 2017 -0700 -- .../transactions/JTA_transactions.html.md.erb | 21 +++-- .../tools_modules/gfsh/tour_of_gfsh.html.md.erb | 86 +--- 2 files changed, 68 insertions(+), 39 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/7bc31116/geode-docs/developing/transactions/JTA_transactions.html.md.erb -- diff --git a/geode-docs/developing/transactions/JTA_transactions.html.md.erb b/geode-docs/developing/transactions/JTA_transactions.html.md.erb index e218684..3164dce 100644 --- a/geode-docs/developing/transactions/JTA_transactions.html.md.erb +++ b/geode-docs/developing/transactions/JTA_transactions.html.md.erb @@ -122,8 +122,9 @@ To accomplish this, the application server container must use a JCA Resource Ada # How to Run JTA Transactions with Geode as a "Last Resource" -1. Locate the `$GEMFIRE/lib/gemfire-jca.rar` file in your Geode installation. -2. Add your container-specific XML file to the `gemfire-jca.rar` file. +1. Locate the version-specific `geode-jca` RAR file within +the `lib` directory of your Geode installation. +2. Add your container-specific XML file to the `geode-jca` RAR file. Create a container-specific resource adapter XML file named-ra.xml. For example, an XML file for a WebLogic resource adapter XML file might look something like this: @@ -144,17 +145,21 @@ To accomplish this, the application server container must use a JCA Resource Ada META-INF/weblogic-ra.xml ``` -Navigate to the directory above the `META-INF` folder and execute the following command: +Navigate to the directory above the `META-INF` folder and execute the following command, with appropriate substitutions for +path and file names: ``` pre -$ jar -uf /lib/gemfire-jca.rar META-INF/weblogic-ra.xml +$ jar -uf /path/to/lib/geode-jca-X-X-X.rar META-INF/weblogic-ra.xml ``` -3. Make sure that `$GEMFIRE/lib/gemfire.jar` is accessible in the CLASSPATH of the JTA transaction coordinator container. -4. Deploy `gemfire-jca.rar` file on the JTA transaction coordinator container . When deploying the file, you specify the JNDI name and so on. +3. Make sure that the `geode-dependencies.jar` is accessible in +the CLASSPATH of the JTA transaction coordinator container. +4. Deploy the version-specific `geode-jca` RAR file on +the JTA transaction coordinator container. +When deploying the file, you specify the JNDI name and so on. 5. Configure Geode for any necessary transactional behavior. Enable `copy-on-read` and specify a transaction listener, if you need one. See [Setting Global Copy on Read](working_with_transactions.html#concept_vx2_gs4_5k) and [Configuring Transaction Plug-In Event Handlers](working_with_transactions.html#concept_ocw_vf1_wk) for details. -6. Get an initial context through `com.gemstone.cache.Cache.getJNDIContext`. For example: +6. Get an initial context through `org.apache.geode.cache.GemFireCache.getJNDIContext`. For example: ``` pre Context ctx = cache.getJNDIContext(); @@ -215,7 +220,7 @@ To run a global transaction, perform the following steps: 3. Configure Geode for any necessary transactional behavior. Enable `copy-on-read` for your cache and specify a transaction listener, if you need one. See [Setting Global Copy on Read](working_with_transactions.html#concept_vx2_gs4_5k) and [Configuring Transaction Plug-In Event Handlers](working_with_transactions.html#concept_ocw_vf1_wk) for details. 4. Make sure that JTA transactions are not disabled in the `cache.xml` file or the application code. 5. Initialize the Geode cache. -6. Get an initial context through `org.apache.geode.cache.Cache.getJNDIContext`. For example: +6. Get an initial context through `org.apache.geode.cache.GemFireCache.getJNDIContext`. For example: ``` pre Context ctx = cache.getJNDIContext(); http://git-wip-us.apache.org/repos/asf/geode/blob/7bc31116/geode-docs/tools_modules/gfsh/tour_of_gfsh.h
[46/51] [abbrv] geode git commit: GEODE-2629: fix ConnectionJUnitTest use of Mockito 2.7.11
GEODE-2629: fix ConnectionJUnitTest use of Mockito 2.7.11 Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/0d43e3d8 Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/0d43e3d8 Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/0d43e3d8 Branch: refs/heads/feature/GEM-1483 Commit: 0d43e3d86acbe0ee136046be8ef00f90ff0c0242 Parents: e3a1ae0 Author: Kirk Lund Authored: Tue Jun 13 11:05:54 2017 -0700 Committer: Kirk Lund Committed: Wed Jun 14 11:06:33 2017 -0700 -- .../internal/cache/tier/sockets/command/PutTest.java | 10 +++--- .../apache/geode/internal/tcp/ConnectionJUnitTest.java| 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/0d43e3d8/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/PutTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/PutTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/PutTest.java index 2578e00..2b22f13 100644 --- a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/PutTest.java +++ b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/PutTest.java @@ -20,6 +20,7 @@ import static org.mockito.Matchers.eq; import static org.mockito.Matchers.isA; import static org.mockito.Mockito.*; +import org.apache.geode.internal.cache.EventIDHolder; import org.junit.Before; import org.junit.Test; import org.junit.experimental.categories.Category; @@ -104,7 +105,7 @@ public class PutTest { when(this.callbackArgsPart.getObject()).thenReturn(CALLBACK_ARG); -when(this.eventPart.getSerializedForm()).thenReturn(this.EVENT); +when(this.eventPart.getSerializedForm()).thenReturn(EVENT); when(this.valuePart.getSerializedForm()).thenReturn(VALUE); when(this.valuePart.isObject()).thenReturn(true); @@ -127,8 +128,11 @@ public class PutTest { when(this.serverConnection.getErrorResponseMessage()).thenReturn(this.errorResponseMessage); when(this.serverConnection.getClientVersion()).thenReturn(Version.CURRENT); -when(this.localRegion.basicBridgePut(eq(KEY), eq(VALUE), eq(null), eq(true), eq(CALLBACK_ARG), -any(ClientProxyMembershipID.class), eq(true), any(EntryEventImpl.class))).thenReturn(true); +when(this.localRegion.basicBridgePut(eq(KEY), eq(VALUE), isNull(), eq(true), eq(CALLBACK_ARG), +isA(ClientProxyMembershipID.class), eq(true), isA(EntryEventImpl.class))).thenReturn(true); + +// here's the actual call made by tests of basicBridgePut... +// region.basicBridgePut(key, value, null, isObject, callbackArg, serverConnection.getProxyID(), true, new EventIDHolder(eventId)); } @Test http://git-wip-us.apache.org/repos/asf/geode/blob/0d43e3d8/geode-core/src/test/java/org/apache/geode/internal/tcp/ConnectionJUnitTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/internal/tcp/ConnectionJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/tcp/ConnectionJUnitTest.java index 193240d..aeeb60f 100755 --- a/geode-core/src/test/java/org/apache/geode/internal/tcp/ConnectionJUnitTest.java +++ b/geode-core/src/test/java/org/apache/geode/internal/tcp/ConnectionJUnitTest.java @@ -80,6 +80,6 @@ public class ConnectionJUnitTest { Connection conn = new Connection(table, socket); conn.setSharedUnorderedForTest(); conn.run(); -verify(membership).suspectMember(any(InternalDistributedMember.class), any(String.class)); +verify(membership).suspectMember(isNull(InternalDistributedMember.class), any(String.class)); } }
[30/51] [abbrv] geode git commit: GEODE-3066: Test tweaks to stabilize it.
GEODE-3066: Test tweaks to stabilize it. * Regions created before senders and receivers are started. * Added a listener to slow down the puts so that when the remote region is destroyed, the put operation is still ongoing. This closes #574 Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/eb3312ae Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/eb3312ae Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/eb3312ae Branch: refs/heads/feature/GEM-1483 Commit: eb3312aed9767eb2fc08599a372c8dbcbeddf237 Parents: 8cd03e8 Author: nabarun Authored: Mon Jun 12 11:33:37 2017 -0700 Committer: nabarun Committed: Mon Jun 12 14:18:19 2017 -0700 -- .../serial/SerialWANPropagationDUnitTest.java | 25 1 file changed, 15 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/eb3312ae/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialWANPropagationDUnitTest.java -- diff --git a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialWANPropagationDUnitTest.java b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialWANPropagationDUnitTest.java index a60614c..5f69f69 100644 --- a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialWANPropagationDUnitTest.java +++ b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialWANPropagationDUnitTest.java @@ -360,14 +360,6 @@ public class SerialWANPropagationDUnitTest extends WANTestBase { // these are part of remote site createCacheInVMs(nyPort, vm2, vm3); -createReceiverInVMs(vm2, vm3); - -// these are part of local site -createCacheInVMs(lnPort, vm4, vm5, vm6, vm7); - -// senders are created on local site -vm4.invoke(() -> WANTestBase.createSender("ln", 2, false, 100, 500, false, false, null, true)); -vm5.invoke(() -> WANTestBase.createSender("ln", 2, false, 100, 500, false, false, null, true)); // create one RR (RR_1) on remote site vm2.invoke( @@ -375,8 +367,13 @@ public class SerialWANPropagationDUnitTest extends WANTestBase { vm3.invoke( () -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR_1", null, isOffHeap())); -// start the senders on local site -startSenderInVMs("ln", vm4, vm5); +createReceiverInVMs(vm2, vm3); + +vm2.invoke(() -> addListenerToSleepAfterCreateEvent(1000, getTestMethodName() + "_RR_1")); +vm3.invoke(() -> addListenerToSleepAfterCreateEvent(1000, getTestMethodName() + "_RR_1")); + +// these are part of local site +createCacheInVMs(lnPort, vm4, vm5, vm6, vm7); // create one RR (RR_1) on local site vm4.invoke( @@ -388,6 +385,14 @@ public class SerialWANPropagationDUnitTest extends WANTestBase { vm7.invoke( () -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR_1", "ln", isOffHeap())); +// senders are created on local site +vm4.invoke(() -> WANTestBase.createSender("ln", 2, false, 100, 500, false, false, null, true)); +vm5.invoke(() -> WANTestBase.createSender("ln", 2, false, 100, 500, false, false, null, true)); + + +// start the senders on local site +startSenderInVMs("ln", vm4, vm5); + IgnoredException.addIgnoredException(BatchException70.class.getName()); IgnoredException.addIgnoredException(ServerOperationException.class.getName());
[21/51] [abbrv] geode git commit: GEODE-2788: Add official Socket timeout parameter when connecting to servers/locators
GEODE-2788: Add official Socket timeout parameter when connecting to servers/locators When connecting from the client to the servers/locators, if the servers/locators is not started, the connection can not be established and a Socket timeout occurs. This timeout value is 59 seconds by default. This timeout value is too long. This timeout value can be changed by specifying the unofficial parameter "gemfire.PoolImpl.HANDSHAKE_TIMEOUT" in java system property, but I corresponded so that it can be specified by official parameters. The official parameters are specified by the attribute of Pool.(default:59000 ms) For example, cache.xml like this: API like this: ClientCacheFactory().addPoolLocator("localhost", 10334).setPoolSocketConnecTimeout(15000); or PoolManager.createFactory().addServer("localhost", 40404).setSocketConnectTimeout(15000); Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/61b1d0c4 Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/61b1d0c4 Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/61b1d0c4 Branch: refs/heads/feature/GEM-1483 Commit: 61b1d0c48f9ddd7e77367e2039a9c03900168823 Parents: 8c41fd3 Author: masaki.yamakawa Authored: Sun Apr 23 00:44:08 2017 +0900 Committer: Udo Kohlmeyer Committed: Fri Jun 9 16:04:17 2017 -0700 -- .../geode/cache/client/ClientCacheFactory.java | 15 +++ .../org/apache/geode/cache/client/Pool.java | 7 ++ .../apache/geode/cache/client/PoolFactory.java | 20 +++ .../geode/cache/client/internal/PoolImpl.java | 21 ++-- .../geode/internal/cache/PoolFactoryImpl.java | 16 .../geode/internal/cache/xmlcache/CacheXml.java | 1 + .../cache/xmlcache/CacheXmlGenerator.java | 6 + .../internal/cache/xmlcache/CacheXmlParser.java | 4 +++ .../geode.apache.org/schema/cache/cache-1.0.xsd | 3 ++- .../client/ClientCacheFactoryJUnitTest.java | 26 .../AutoConnectionSourceImplJUnitTest.java | 4 +++ .../internal/ConnectionPoolImplJUnitTest.java | 6 - .../client/internal/QueueManagerJUnitTest.java | 4 +++ .../ClientCacheFactoryJUnitTest_single_pool.xml | 11 + .../sanctionedDataSerializables.txt | 4 +-- 15 files changed, 127 insertions(+), 21 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/61b1d0c4/geode-core/src/main/java/org/apache/geode/cache/client/ClientCacheFactory.java -- diff --git a/geode-core/src/main/java/org/apache/geode/cache/client/ClientCacheFactory.java b/geode-core/src/main/java/org/apache/geode/cache/client/ClientCacheFactory.java index 4839a7c..8f48862 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/client/ClientCacheFactory.java +++ b/geode-core/src/main/java/org/apache/geode/cache/client/ClientCacheFactory.java @@ -274,6 +274,21 @@ public class ClientCacheFactory { } /** + * Sets the socket connect timeout for this pool. The number of milli seconds specified as socket + * timeout when the client connects to the servers/locators. A timeout of zero is interpreted as + * an infinite timeout. The connection will then block until established or an error occurs. + * + * @param socketConnectTimeout timeout in milliseconds when the client connects to the servers + * @return a reference to this + * @throws IllegalArgumentException if socketConnectTimeout is less than or equal to + * -1. + */ + public ClientCacheFactory setPoolSocketConnectTimeout(int socketConnectTimeout) { +getPoolFactory().setSocketConnectTimeout(socketConnectTimeout); +return this; + } + + /** * Sets the free connection timeout for this pool. If the pool has a max connections setting, * operations will block if all of the connections are in use. The free connection timeout * specifies how long those operations will block waiting for a free connection before receiving http://git-wip-us.apache.org/repos/asf/geode/blob/61b1d0c4/geode-core/src/main/java/org/apache/geode/cache/client/Pool.java -- diff --git a/geode-core/src/main/java/org/apache/geode/cache/client/Pool.java b/geode-core/src/main/java/org/apache/geode/cache/client/Pool.java index 69cec87..e910e01 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/client/Pool.java +++ b/geode-core/src/main/java/org/apache/geode/cache/client/Pool.java @@ -62,6 +62,13 @@ public interface Pool { public String getName(); /** + * Returns the socket connect timeout of this pool. + * + * @see PoolFactory#setSocketConnectTimeout(int) + */ + public int getSocketConnectTimeout(); + + /** * Returns the connection timeout of this
[42/51] [abbrv] geode git commit: GEODE-2558: Upgrade mockito to 2.7.11 and powermock to 1.7.0RC2
GEODE-2558: Upgrade mockito to 2.7.11 and powermock to 1.7.0RC2 * mockito-core.version = 2.7.11 * powermock.version = 1.7.0RC2 * fix compilation errors * there are several test failures in geode-core and geode-lucene geode-core test failures: * GMSMembershipManagerJUnitTest.testDirectChannelSend * GMSMembershipManagerJUnitTest.testDirectChannelSendAllRecipients * GMSMembershipManagerJUnitTest.testDirectChannelSendFailureDueToForcedDisconnect * GMSMembershipManagerJUnitTest.testDirectChannelSendFailureToOneRecipient * Put61Test.integratedSecurityShouldSucceedIfAuthorized * Put61Test.noSecurityShouldSucceed * Put61Test.oldSecurityShouldSucceedIfAuthorized * Put65Test.integratedSecurityShouldSucceedIfAuthorized * Put65Test.noSecurityShouldSucceed * Put65Test.oldSecurityShouldSucceedIfAuthorized * PutTest.integratedSecurityShouldSucceedIfAuthorized * PutTest.noSecurityShouldSucceed * PutTest.oldSecurityShouldSucceedIfAuthorized * FastLoggerJUnitTest.delegateIsDebugEnabledWhenIsDelegating * FastLoggerJUnitTest.delegateIsDebugEnabledWhenIsDelegating * FastLoggerJUnitTest.delegateIsDebugEnabledWhenIsDelegating * OffHeapRegionEntryHelperJUnitTest.releaseEntryShouldSetValueToRemovePhase2 * OffHeapRegionEntryHelperJUnitTest.releaseEntryShouldSetValueToRemovePhase2AndSetsAsyncToFalseForDiskEntry * OffHeapRegionEntryHelperJUnitTest.setValueShouldChangeTheRegionEntryAddressToNewAddressAndDoesNothingIfOldAddressIsATokenAddress * OffHeapRegionEntryHelperJUnitTest.setValueShouldChangeTheRegionEntryAddressToNewAddressAndDoesNothingIfOldAddressIsAnEncodedAddress * OffHeapRegionEntryHelperJUnitTest.setValueShouldChangeTheRegionEntryAddressToNewAddressAndReleaseOldValueIfItsOnOffHeap * StatisticsImplTest.invokeSuppliersShouldLogErrorOnlyOnce * ConnectionJUnitTest.testSuspicionRaised geode-lucene test failures: * StringQueryProviderJUnitTest.usesCustomAnalyzer * RegionDirectoryJUnitTest.testFsyncDoesntCreateNewFiles * RegionDirectoryJUnitTest.testPendingDeletions Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/90900ac5 Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/90900ac5 Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/90900ac5 Branch: refs/heads/feature/GEM-1483 Commit: 90900ac5292fea85cec513653e489dfdadafd311 Parents: cecad6c Author: Kirk Lund Authored: Fri Feb 24 21:10:50 2017 -0800 Committer: Kirk Lund Committed: Wed Jun 14 11:06:32 2017 -0700 -- geode-core/build.gradle | 4 .../query/internal/index/HashIndexSetJUnitTest.java | 2 +- .../gms/messenger/JGroupsMessengerJUnitTest.java| 6 +++--- .../partitioned/DeposePrimaryBucketMessageTest.java | 1 - .../cache/partitioned/FetchEntryMessageTest.java| 1 - .../partitioned/FetchPartitionDetailsMessageTest.java | 1 - .../cache/partitioned/MoveBucketMessageTest.java| 1 - .../cache/partitioned/RemoveBucketMessageTest.java | 1 - .../cache/tier/sockets/command/ContainsKey66Test.java | 2 +- .../cache/tier/sockets/command/CreateRegionTest.java| 2 +- .../cache/tier/sockets/command/Destroy65Test.java | 2 +- .../cache/tier/sockets/command/DestroyRegionTest.java | 2 +- .../cache/tier/sockets/command/DestroyTest.java | 2 +- .../tier/sockets/command/ExecuteFunction65Test.java | 2 +- .../tier/sockets/command/ExecuteFunction66Test.java | 2 +- .../cache/tier/sockets/command/ExecuteFunctionTest.java | 2 +- .../internal/cache/tier/sockets/command/Get70Test.java | 2 +- .../cache/tier/sockets/command/GetAll651Test.java | 2 +- .../cache/tier/sockets/command/GetAll70Test.java| 2 +- .../internal/cache/tier/sockets/command/GetAllTest.java | 2 +- .../tier/sockets/command/GetAllWithCallbackTest.java| 2 +- .../cache/tier/sockets/command/InvalidateTest.java | 2 +- .../internal/cache/tier/sockets/command/KeySetTest.java | 2 +- .../internal/cache/tier/sockets/command/Put61Test.java | 2 +- .../internal/cache/tier/sockets/command/Put65Test.java | 2 +- .../internal/cache/tier/sockets/command/PutTest.java| 2 +- .../tier/sockets/command/RegisterInterest61Test.java| 2 +- .../sockets/command/RegisterInterestList61Test.java | 2 +- .../sockets/command/RegisterInterestList66Test.java | 2 +- .../tier/sockets/command/RegisterInterestListTest.java | 2 +- .../tier/sockets/command/RegisterInterestTest.java | 2 +- .../cache/tier/sockets/command/RemoveAllTest.java | 2 +- .../cache/tier/sockets/command/RequestTest.java | 2 +- .../tier/sockets/command/UnregisterInterestTest.java| 2 +- .../internal/cache/wan/serial/DestroyMessageTest.java | 1 - .../cache/xmlcache/DefaultEntityResolver2Test.java | 1 - .../internal/CompositeBuilderViaFromTest.java | 1 - .../internal/CompositeBuilderViaProxyTest.java
[12/51] [abbrv] geode git commit: GEODE-3054: escaping the escape character in the command string before passing it to the SimpleParser
GEODE-3054: escaping the escape character in the command string before passing it to the SimpleParser Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/2579a0db Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/2579a0db Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/2579a0db Branch: refs/heads/feature/GEM-1483 Commit: 2579a0db0f9e1acad55d3be8dd3a3d5bb33f32d5 Parents: 0211029 Author: Jinmei Liao Authored: Thu Jun 8 11:08:03 2017 -0700 Committer: Jinmei Liao Committed: Fri Jun 9 10:42:03 2017 -0700 -- .../management/internal/cli/GfshParser.java | 2 + .../internal/cli/MultipleValueAdapter.java | 35 - .../internal/cli/MultipleValueConverter.java| 55 .../internal/cli/GfshParserParsingTest.java | 29 +++ 4 files changed, 31 insertions(+), 90 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/2579a0db/geode-core/src/main/java/org/apache/geode/management/internal/cli/GfshParser.java -- diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/GfshParser.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/GfshParser.java index df16e9b..b5c24cb 100755 --- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/GfshParser.java +++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/GfshParser.java @@ -177,6 +177,8 @@ public class GfshParser extends SimpleParser { public GfshParseResult parse(String userInput) { String rawInput = convertToSimpleParserInput(userInput); +// this tells the simpleParser not to interpret backslash as escaping character +rawInput = rawInput.replace("\\", ""); // User SimpleParser to parse the input ParseResult result = super.parse(rawInput); http://git-wip-us.apache.org/repos/asf/geode/blob/2579a0db/geode-core/src/main/java/org/apache/geode/management/internal/cli/MultipleValueAdapter.java -- diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/MultipleValueAdapter.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/MultipleValueAdapter.java deleted file mode 100644 index 5c466a0..000 --- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/MultipleValueAdapter.java +++ /dev/null @@ -1,35 +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.management.internal.cli; - -import java.util.List; - -import org.springframework.shell.core.Completion; -import org.springframework.shell.core.MethodTarget; - -public abstract class MultipleValueAdapter implements MultipleValueConverter { - - @Override - public T convertFromText(String value, Class targetType, String optionContext) { -return null; - } - - @Override - public boolean getAllPossibleValues(List completions, Class targetType, - String existingData, String optionContext, MethodTarget target) { -return false; - } - -} http://git-wip-us.apache.org/repos/asf/geode/blob/2579a0db/geode-core/src/main/java/org/apache/geode/management/internal/cli/MultipleValueConverter.java -- diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/MultipleValueConverter.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/MultipleValueConverter.java deleted file mode 100644 index e3e1fec..000 --- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/MultipleValueConverter.java +++ /dev/null @@ -1,55 +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
[17/51] [abbrv] geode git commit: GEODE-2933: Add jmx-manager-hostname-for-clients for startLocator
GEODE-2933: Add jmx-manager-hostname-for-clients for startLocator Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/d5bde9fb Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/d5bde9fb Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/d5bde9fb Branch: refs/heads/feature/GEM-1483 Commit: d5bde9fb69ab511de1a6c98ce7a16aae0a143326 Parents: 0ef7f56 Author: Jared Stewart Authored: Mon Jun 5 10:54:13 2017 -0700 Committer: Jared Stewart Committed: Fri Jun 9 15:17:11 2017 -0700 -- .../cli/commands/LauncherLifecycleCommands.java | 95 ++- .../internal/cli/i18n/CliStrings.java | 6 ++ .../cli/GfshParserAutoCompletionTest.java | 24 ++--- .../internal/cli/GfshParserParsingTest.java | 9 +- .../commands/LauncherLifecycleCommandsTest.java | 97 +--- 5 files changed, 157 insertions(+), 74 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/d5bde9fb/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/LauncherLifecycleCommands.java -- diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/LauncherLifecycleCommands.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/LauncherLifecycleCommands.java index 89a236b..45fbf1b 100755 --- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/LauncherLifecycleCommands.java +++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/LauncherLifecycleCommands.java @@ -22,6 +22,7 @@ import static org.apache.geode.distributed.ConfigurationProperties.ENABLE_TIME_S import static org.apache.geode.distributed.ConfigurationProperties.GROUPS; import static org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_BIND_ADDRESS; import static org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_PORT; +import static org.apache.geode.distributed.ConfigurationProperties.JMX_MANAGER_HOSTNAME_FOR_CLIENTS; import static org.apache.geode.distributed.ConfigurationProperties.LOAD_CLUSTER_CONFIGURATION_FROM_DIR; import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS; import static org.apache.geode.distributed.ConfigurationProperties.LOCATOR_WAIT_TIME; @@ -48,6 +49,7 @@ import org.apache.commons.lang.ArrayUtils; import org.apache.geode.SystemFailure; import org.apache.geode.cache.server.CacheServer; import org.apache.geode.distributed.AbstractLauncher; +import org.apache.geode.distributed.ConfigurationProperties; import org.apache.geode.distributed.LocatorLauncher; import org.apache.geode.distributed.LocatorLauncher.LocatorState; import org.apache.geode.distributed.ServerLauncher; @@ -170,6 +172,8 @@ public class LauncherLifecycleCommands implements GfshCommand { help = CliStrings.START_LOCATOR__GROUP__HELP) final String group, @CliOption(key = CliStrings.START_LOCATOR__HOSTNAME_FOR_CLIENTS, help = CliStrings.START_LOCATOR__HOSTNAME_FOR_CLIENTS__HELP) final String hostnameForClients, + @CliOption(key = ConfigurationProperties.JMX_MANAGER_HOSTNAME_FOR_CLIENTS, + help = CliStrings.START_LOCATOR__JMX_MANAGER_HOSTNAME_FOR_CLIENTS__HELP) final String jmxManagerHostnameForClients, @CliOption(key = CliStrings.START_LOCATOR__INCLUDE_SYSTEM_CLASSPATH, specifiedDefaultValue = "true", unspecifiedDefaultValue = "false", help = CliStrings.START_LOCATOR__INCLUDE_SYSTEM_CLASSPATH__HELP) final Boolean includeSystemClasspath, @@ -246,20 +250,20 @@ public class LauncherLifecycleCommands implements GfshCommand { Properties gemfireProperties = new Properties(); - gemfireProperties.setProperty(GROUPS, StringUtils.defaultString(group)); - gemfireProperties.setProperty(LOCATORS, StringUtils.defaultString(locators)); - gemfireProperties.setProperty(LOG_LEVEL, StringUtils.defaultString(logLevel)); - gemfireProperties.setProperty(MCAST_ADDRESS, StringUtils.defaultString(mcastBindAddress)); - gemfireProperties.setProperty(MCAST_PORT, StringUtils.defaultString(mcastPort)); - gemfireProperties.setProperty(ENABLE_CLUSTER_CONFIGURATION, - StringUtils.defaultString(enableSharedConfiguration)); - gemfireProperties.setProperty(LOAD_CLUSTER_CONFIGURATION_FROM_DIR, - StringUtils.defaultString(loadSharedConfigurationFromDirectory)); - gemfireProperties.setProperty(CLUSTER_CONFIGURATION_DIR, - StringUtils.defaultString(clusterConfigDir)); - gemfireProperties.setProperty(HTTP_SERVICE_PORT, StringUtils.defaultString(httpServicePort)); - gemfireProperties.setProperty(HTTP_SERVICE_BIND_ADDRESS, - StringUtils.defaultString(ht
[37/51] [abbrv] geode git commit: GEODE-2818: add alias to any command's options that involves "group", "member", "jar" and replace CliString variables with GROUP, MEMBER, JAR, etc.
http://git-wip-us.apache.org/repos/asf/geode/blob/db8e1df3/geode-core/src/main/java/org/apache/geode/management/internal/web/controllers/WanCommandsController.java -- diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/web/controllers/WanCommandsController.java b/geode-core/src/main/java/org/apache/geode/management/internal/web/controllers/WanCommandsController.java index 4fd4b96..6a01c3e 100644 --- a/geode-core/src/main/java/org/apache/geode/management/internal/web/controllers/WanCommandsController.java +++ b/geode-core/src/main/java/org/apache/geode/management/internal/web/controllers/WanCommandsController.java @@ -46,19 +46,16 @@ public class WanCommandsController extends AbstractCommandsController { @RequestMapping(method = RequestMethod.GET, value = "/gateways") @ResponseBody public String listGateways( - @RequestParam(value = CliStrings.LIST_GATEWAY__GROUP, required = false) final String[] groups, - @RequestParam(value = CliStrings.LIST_GATEWAY__MEMBER, - required = false) final String[] members) { + @RequestParam(value = CliStrings.GROUP, required = false) final String[] groups, + @RequestParam(value = CliStrings.MEMBER, required = false) final String[] members) { CommandStringBuilder command = new CommandStringBuilder(CliStrings.LIST_GATEWAY); if (hasValue(groups)) { - command.addOption(CliStrings.LIST_GATEWAY__GROUP, - StringUtils.join(groups, StringUtils.COMMA_DELIMITER)); + command.addOption(CliStrings.GROUP, StringUtils.join(groups, StringUtils.COMMA_DELIMITER)); } if (hasValue(members)) { - command.addOption(CliStrings.LIST_GATEWAY__MEMBER, - StringUtils.join(members, StringUtils.COMMA_DELIMITER)); + command.addOption(CliStrings.MEMBER, StringUtils.join(members, StringUtils.COMMA_DELIMITER)); } return processCommand(command.toString()); @@ -67,12 +64,10 @@ public class WanCommandsController extends AbstractCommandsController { @RequestMapping(method = RequestMethod.POST, value = "/gateways/receivers") @ResponseBody public String createGatewayReceiver( - @RequestParam(value = CliStrings.CREATE_GATEWAYRECEIVER__GROUP, - required = false) final String[] groups, + @RequestParam(value = CliStrings.GROUP, required = false) final String[] groups, @RequestParam(value = CliStrings.CREATE_GATEWAYRECEIVER__MANUALSTART, required = false) final Boolean manualStart, - @RequestParam(value = CliStrings.CREATE_GATEWAYRECEIVER__MEMBER, - required = false) final String[] members, + @RequestParam(value = CliStrings.MEMBER, required = false) final String[] members, @RequestParam(value = CliStrings.CREATE_GATEWAYRECEIVER__STARTPORT, required = false) final Integer startPort, @RequestParam(value = CliStrings.CREATE_GATEWAYRECEIVER__ENDPORT, @@ -88,8 +83,7 @@ public class WanCommandsController extends AbstractCommandsController { CommandStringBuilder command = new CommandStringBuilder(CliStrings.CREATE_GATEWAYRECEIVER); if (hasValue(groups)) { - command.addOption(CliStrings.CREATE_GATEWAYRECEIVER__GROUP, - StringUtils.join(groups, StringUtils.COMMA_DELIMITER)); + command.addOption(CliStrings.GROUP, StringUtils.join(groups, StringUtils.COMMA_DELIMITER)); } if (hasValue(manualStart)) { @@ -98,8 +92,7 @@ public class WanCommandsController extends AbstractCommandsController { } if (hasValue(members)) { - command.addOption(CliStrings.CREATE_GATEWAYRECEIVER__MEMBER, - StringUtils.join(members, StringUtils.COMMA_DELIMITER)); + command.addOption(CliStrings.MEMBER, StringUtils.join(members, StringUtils.COMMA_DELIMITER)); } if (hasValue(startPort)) { @@ -137,10 +130,8 @@ public class WanCommandsController extends AbstractCommandsController { public String createGatewaySender( @RequestParam(CliStrings.CREATE_GATEWAYSENDER__ID) final String gatewaySenderId, @RequestParam(CliStrings.CREATE_GATEWAYSENDER__REMOTEDISTRIBUTEDSYSTEMID) final Integer remoteDistributedSystemId, - @RequestParam(value = CliStrings.CREATE_GATEWAYSENDER__GROUP, - required = false) final String[] groups, - @RequestParam(value = CliStrings.CREATE_GATEWAYSENDER__MEMBER, - required = false) final String[] members, + @RequestParam(value = CliStrings.GROUP, required = false) final String[] groups, + @RequestParam(value = CliStrings.MEMBER, required = false) final String[] members, @RequestParam(value = CliStrings.CREATE_GATEWAYSENDER__PARALLEL, required = false) final Boolean parallel, @RequestParam(value = CliStrings.CREATE_GATEWAYSENDER__MANUALSTART, @@ -180,13 +171,11 @@ public class WanCommandsController extends AbstractCommandsController { String.valueOf(remoteDistributedS
[36/51] [abbrv] geode git commit: GEODE-2818: add alias to any command's options that involves "group", "member", "jar" and replace CliString variables with GROUP, MEMBER, JAR, etc.
http://git-wip-us.apache.org/repos/asf/geode/blob/db8e1df3/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/WanCommandCreateGatewayReceiverDUnitTest.java -- diff --git a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/WanCommandCreateGatewayReceiverDUnitTest.java b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/WanCommandCreateGatewayReceiverDUnitTest.java index 63cf594..bdccabe 100644 --- a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/WanCommandCreateGatewayReceiverDUnitTest.java +++ b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/WanCommandCreateGatewayReceiverDUnitTest.java @@ -51,14 +51,14 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends WANCommandTestBase public void testCreateGatewayReceiverWithDefault() { VM puneLocator = Host.getLocator(); -int punePort = (Integer) puneLocator.invoke(() -> getLocatorPort()); +int punePort = puneLocator.invoke(() -> getLocatorPort()); Properties props = getDistributedSystemProperties(); props.setProperty(MCAST_PORT, "0"); props.setProperty(LOCATORS, "localhost[" + punePort + "]"); setUpJmxManagerOnVm0ThenConnect(props); -Integer nyPort = (Integer) vm2.invoke(() -> createFirstRemoteLocator(2, punePort)); +Integer nyPort = vm2.invoke(() -> createFirstRemoteLocator(2, punePort)); vm3.invoke(() -> createCache(punePort)); vm4.invoke(() -> createCache(punePort)); @@ -104,14 +104,14 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends WANCommandTestBase public void testCreateGatewayReceiver() { VM puneLocator = Host.getLocator(); -int punePort = (Integer) puneLocator.invoke(() -> getLocatorPort()); +int punePort = puneLocator.invoke(() -> getLocatorPort()); Properties props = getDistributedSystemProperties(); props.setProperty(MCAST_PORT, "0"); props.setProperty(LOCATORS, "localhost[" + punePort + "]"); setUpJmxManagerOnVm0ThenConnect(props); -Integer nyPort = (Integer) vm2.invoke(() -> createFirstRemoteLocator(2, punePort)); +Integer nyPort = vm2.invoke(() -> createFirstRemoteLocator(2, punePort)); vm3.invoke(() -> createCache(punePort)); vm4.invoke(() -> createCache(punePort)); @@ -157,14 +157,14 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends WANCommandTestBase public void testCreateGatewayReceiverWithGatewayTransportFilter() { VM puneLocator = Host.getLocator(); -int punePort = (Integer) puneLocator.invoke(() -> getLocatorPort()); +int punePort = puneLocator.invoke(() -> getLocatorPort()); Properties props = getDistributedSystemProperties(); props.setProperty(MCAST_PORT, "0"); props.setProperty(LOCATORS, "localhost[" + punePort + "]"); setUpJmxManagerOnVm0ThenConnect(props); -Integer nyPort = (Integer) vm2.invoke(() -> createFirstRemoteLocator(2, punePort)); +Integer nyPort = vm2.invoke(() -> createFirstRemoteLocator(2, punePort)); vm3.invoke(() -> createCache(punePort)); vm4.invoke(() -> createCache(punePort)); @@ -215,14 +215,14 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends WANCommandTestBase public void testCreateGatewayReceiverWithMultipleGatewayTransportFilters() { VM puneLocator = Host.getLocator(); -int punePort = (Integer) puneLocator.invoke(() -> getLocatorPort()); +int punePort = puneLocator.invoke(() -> getLocatorPort()); Properties props = getDistributedSystemProperties(); props.setProperty(MCAST_PORT, "0"); props.setProperty(LOCATORS, "localhost[" + punePort + "]"); setUpJmxManagerOnVm0ThenConnect(props); -Integer nyPort = (Integer) vm2.invoke(() -> createFirstRemoteLocator(2, punePort)); +Integer nyPort = vm2.invoke(() -> createFirstRemoteLocator(2, punePort)); vm3.invoke(() -> createCache(punePort)); vm4.invoke(() -> createCache(punePort)); @@ -273,14 +273,14 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends WANCommandTestBase public void testCreateGatewayReceiver_Error() { VM puneLocator = Host.getLocator(); -int punePort = (Integer) puneLocator.invoke(() -> getLocatorPort()); +int punePort = puneLocator.invoke(() -> getLocatorPort()); Properties props = getDistributedSystemProperties(); props.setProperty(MCAST_PORT, "0"); props.setProperty(LOCATORS, "localhost[" + punePort + "]"); setUpJmxManagerOnVm0ThenConnect(props); -Integer nyPort = (Integer) vm2.invoke(() -> createFirstRemoteLocator(2, punePort)); +Integer nyPort = vm2.invoke(() -> createFirstRemoteLocator(2, punePort)); vm3.invoke(() -> createCache(punePort)); vm4.invoke(() -> createCache(punePort)); @@ -319,20 +319,20 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends WANCommandTestBase public vo
[08/51] [abbrv] geode git commit: GEODE-2632: use immutable SecurityService impls to improve performance
http://git-wip-us.apache.org/repos/asf/geode/blob/0211029b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/ExecuteRegionFunction66.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/ExecuteRegionFunction66.java b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/ExecuteRegionFunction66.java index 4fda244..26d5d3f 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/ExecuteRegionFunction66.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/ExecuteRegionFunction66.java @@ -49,6 +49,7 @@ import org.apache.geode.internal.cache.tier.sockets.ServerConnection; import org.apache.geode.internal.i18n.LocalizedStrings; import org.apache.geode.internal.logging.log4j.LocalizedMessage; import org.apache.geode.internal.security.AuthorizeRequest; +import org.apache.geode.internal.security.SecurityService; /** * @since GemFire 6.6 @@ -64,8 +65,8 @@ public class ExecuteRegionFunction66 extends BaseCommand { private ExecuteRegionFunction66() {} @Override - public void cmdExecute(Message clientMessage, ServerConnection servConn, long start) - throws IOException { + public void cmdExecute(final Message clientMessage, final ServerConnection serverConnection, + final SecurityService securityService, long start) throws IOException { String regionName = null; Object function = null; Object args = null; @@ -77,14 +78,14 @@ public class ExecuteRegionFunction66 extends BaseCommand { int removedNodesSize = 0; Set removedNodesSet = null; int filterSize = 0, partNumber = 0; -CachedRegionHelper crHelper = servConn.getCachedRegionHelper(); +CachedRegionHelper crHelper = serverConnection.getCachedRegionHelper(); byte functionState = 0; int functionTimeout = ConnectionImpl.DEFAULT_CLIENT_FUNCTION_TIMEOUT; try { byte[] bytes = clientMessage.getPart(0).getSerializedForm(); functionState = bytes[0]; if (bytes.length >= 5 - && servConn.getClientVersion().ordinal() >= Version.GFE_8009.ordinal()) { + && serverConnection.getClientVersion().ordinal() >= Version.GFE_8009.ordinal()) { functionTimeout = Part.decodeInt(bytes, 1); } if (functionState != 1) { @@ -93,8 +94,8 @@ public class ExecuteRegionFunction66 extends BaseCommand { hasResult = functionState; } if (hasResult == 1) { -servConn.setAsTrue(REQUIRES_RESPONSE); -servConn.setAsTrue(REQUIRES_CHUNKED_RESPONSE); +serverConnection.setAsTrue(REQUIRES_RESPONSE); +serverConnection.setAsTrue(REQUIRES_CHUNKED_RESPONSE); } regionName = clientMessage.getPart(1).getString(); function = clientMessage.getPart(2).getStringOrObject(); @@ -107,7 +108,7 @@ public class ExecuteRegionFunction66 extends BaseCommand { } } byte[] flags = clientMessage.getPart(5).getSerializedForm(); - if (servConn.getClientVersion().ordinal() > Version.GFE_81.ordinal()) { + if (serverConnection.getClientVersion().ordinal() > Version.GFE_81.ordinal()) { isBucketsAsFilter = (flags[0] & ExecuteFunctionHelper.BUCKETS_AS_FILTER_MASK) != 0; isReExecute = (flags[0] & ExecuteFunctionHelper.IS_REXECUTE_MASK) != 0 ? (byte) 1 : 0; } else { @@ -140,11 +141,11 @@ public class ExecuteRegionFunction66 extends BaseCommand { LocalizedStrings.ExecuteRegionFunction_EXCEPTION_ON_SERVER_WHILE_EXECUTIONG_FUNCTION_0, function), exception); if (hasResult == 1) { -writeChunkedException(clientMessage, exception, servConn); +writeChunkedException(clientMessage, exception, serverConnection); } else { -writeException(clientMessage, exception, false, servConn); +writeException(clientMessage, exception, false, serverConnection); } - servConn.setAsTrue(RESPONDED); + serverConnection.setAsTrue(RESPONDED); return; } if (function == null || regionName == null) { @@ -159,8 +160,8 @@ public class ExecuteRegionFunction66 extends BaseCommand { LocalizedStrings.ExecuteRegionFunction_THE_INPUT_0_FOR_THE_EXECUTE_FUNCTION_REQUEST_IS_NULL .toLocalizedString("region"); } - logger.warn("{}: {}", servConn.getName(), message); - sendError(hasResult, clientMessage, message, servConn); + logger.warn("{}: {}", serverConnection.getName(), message); + sendError(hasResult, clientMessage, message, serverConnection); return; } @@ -169,11 +170,11 @@ public class ExecuteRegionFunction66 extends BaseCommand { String message = LocalizedStrings.ExecuteRegionFunction_THE_REGION_NAMED_0_WAS_NOT_FOUND_DURING_EXECUTE_FUNCTION_REQUEST .toLocalizedString(regionNa
[41/51] [abbrv] geode git commit: GEODE-3062: create new SecurityService after receiving cluster config
GEODE-3062: create new SecurityService after receiving cluster config Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/cecad6c3 Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/cecad6c3 Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/cecad6c3 Branch: refs/heads/feature/GEM-1483 Commit: cecad6c37d59369a29237f7d940f297804633aa1 Parents: a643327 Author: Kirk Lund Authored: Fri Jun 9 15:23:53 2017 -0700 Committer: Kirk Lund Committed: Wed Jun 14 10:34:28 2017 -0700 -- .../internal/InternalDistributedSystem.java | 4 +++ .../cache/ClusterConfigurationLoader.java | 7 ++-- .../geode/internal/cache/GemFireCacheImpl.java | 35 +--- .../ClusterConfigWithSecurityDUnitTest.java | 31 + 4 files changed, 55 insertions(+), 22 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/cecad6c3/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java -- diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java index 22edb6f..f406393 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java @@ -516,6 +516,10 @@ public class InternalDistributedSystem extends DistributedSystem return this.securityService; } + public void setSecurityService(SecurityService securityService) { +this.securityService = securityService; + } + /** * Registers a listener to the system * http://git-wip-us.apache.org/repos/asf/geode/blob/cecad6c3/geode-core/src/main/java/org/apache/geode/internal/cache/ClusterConfigurationLoader.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/ClusterConfigurationLoader.java b/geode-core/src/main/java/org/apache/geode/internal/cache/ClusterConfigurationLoader.java index 4f4881f..92cfd96 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/ClusterConfigurationLoader.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/ClusterConfigurationLoader.java @@ -152,13 +152,12 @@ public class ClusterConfigurationLoader { /*** * Apply the gemfire properties cluster configuration on this member - * - * @param cache Cache created for this member + * * @param response {@link ConfigurationResponse} containing the requested {@link Configuration} * @param config this member's config */ - public static void applyClusterPropertiesConfiguration(Cache cache, - ConfigurationResponse response, DistributionConfig config) { + public static void applyClusterPropertiesConfiguration(ConfigurationResponse response, + DistributionConfig config) { if (response == null || response.getRequestedConfiguration().isEmpty()) { return; } http://git-wip-us.apache.org/repos/asf/geode/blob/cecad6c3/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java -- 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 40df0c7..c503c40 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 @@ -77,6 +77,7 @@ import javax.transaction.TransactionManager; import com.sun.jna.Native; import com.sun.jna.Platform; import org.apache.commons.lang.StringUtils; +import org.apache.geode.internal.security.SecurityServiceFactory; import org.apache.logging.log4j.Logger; import org.apache.geode.CancelCriterion; @@ -126,7 +127,6 @@ import org.apache.geode.cache.client.PoolFactory; import org.apache.geode.cache.client.PoolManager; import org.apache.geode.cache.client.internal.ClientMetadataService; import org.apache.geode.cache.client.internal.ClientRegionFactoryImpl; -import org.apache.geode.cache.client.internal.ConnectionImpl; import org.apache.geode.cache.client.internal.InternalClientCache; import org.apache.geode.cache.client.internal.PoolImpl; import org.apache.geode.cache.control.ResourceManager; @@ -213,7 +213,6 @@ import org.apache.geode.internal.net.SocketCreator; import org.apache.geode.internal.offheap.MemoryAllocator; import org.apache.geode.internal.process.ClusterConfigurationNotAvailableException; import org.apache.geode.
[22/51] [abbrv] geode git commit: GEODE-2788: This is now closing #474
GEODE-2788: This is now closing #474 Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/831ed21f Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/831ed21f Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/831ed21f Branch: refs/heads/feature/GEM-1483 Commit: 831ed21f5eb30b079a08ca95f624c3bea9465583 Parents: 61b1d0c Author: Udo Kohlmeyer Authored: Fri Jun 9 16:13:09 2017 -0700 Committer: Udo Kohlmeyer Committed: Fri Jun 9 16:13:09 2017 -0700 -- --
[43/51] [abbrv] geode git commit: GEODE-2622: Fix GMSMembershipManagerJUnitTest use of Mockito 2.7.11
GEODE-2622: Fix GMSMembershipManagerJUnitTest use of Mockito 2.7.11 - Fix 4 test failures in GMSMembershipManagerJUnitTest This closes #573 Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/740a4ef9 Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/740a4ef9 Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/740a4ef9 Branch: refs/heads/feature/GEM-1483 Commit: 740a4ef991229d6d9c27adf20740c27415b2fedc Parents: 90900ac Author: Srikanth Manvi Authored: Sun Jun 11 00:40:57 2017 -0400 Committer: Kirk Lund Committed: Wed Jun 14 11:06:32 2017 -0700 -- .../membership/gms/mgr/GMSMembershipManagerJUnitTest.java| 8 1 file changed, 4 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/740a4ef9/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/mgr/GMSMembershipManagerJUnitTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/mgr/GMSMembershipManagerJUnitTest.java b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/mgr/GMSMembershipManagerJUnitTest.java index 2692650..29f192f 100644 --- a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/mgr/GMSMembershipManagerJUnitTest.java +++ b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/mgr/GMSMembershipManagerJUnitTest.java @@ -303,7 +303,7 @@ public class GMSMembershipManagerJUnitTest { Set failures = manager.directChannelSend(recipients, m, null); assertTrue(failures == null); verify(dc).send(isA(GMSMembershipManager.class), isA(mockMembers.getClass()), -isA(DistributionMessage.class), anyInt(), anyInt()); +isA(DistributionMessage.class), anyLong(), anyLong()); } @Test @@ -318,7 +318,7 @@ public class GMSMembershipManagerJUnitTest { ConnectExceptions exception = new ConnectExceptions(); exception.addFailure(recipients[0], new Exception("testing")); when(dc.send(any(GMSMembershipManager.class), any(mockMembers.getClass()), -any(DistributionMessage.class), anyInt(), anyInt())).thenThrow(exception); +any(DistributionMessage.class), anyLong(), anyLong())).thenThrow(exception); failures = manager.directChannelSend(recipients, m, null); assertTrue(failures != null); assertEquals(1, failures.size()); @@ -352,7 +352,7 @@ public class GMSMembershipManagerJUnitTest { Set failures = manager.directChannelSend(null, m, null); assertTrue(failures == null); verify(dc).send(isA(GMSMembershipManager.class), isA(mockMembers.getClass()), -isA(DistributionMessage.class), anyInt(), anyInt()); +isA(DistributionMessage.class), anyLong(), anyLong()); } @Test @@ -367,7 +367,7 @@ public class GMSMembershipManagerJUnitTest { ConnectExceptions exception = new ConnectExceptions(); exception.addFailure(recipients[0], new Exception("testing")); when(dc.send(any(GMSMembershipManager.class), any(mockMembers.getClass()), -any(DistributionMessage.class), anyInt(), anyInt())).thenThrow(exception); +any(DistributionMessage.class), anyLong(), anyLong())).thenThrow(exception); Assertions.assertThatThrownBy(() -> { manager.directChannelSend(recipients, m, null); }).isInstanceOf(DistributedSystemDisconnectedException.class);
[34/51] [abbrv] geode git commit: Resolve Eclipse/IntelliJ import order disagreement in style files.
Resolve Eclipse/IntelliJ import order disagreement in style files. The style files contained in `etc/` are not consistent between IDEs. This commit modifies `etc/intellij-java-google-style.xml` to adhere to the import order specified in `etc/eclipseOrganizeImports.importorder`. This seems a significant enough deviation from the original Google style guide to warrant a name change in the XML. this closes #569 Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/a561bd12 Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/a561bd12 Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/a561bd12 Branch: refs/heads/feature/GEM-1483 Commit: a561bd1228d85c7053c51b2b3e680b66ba2626e3 Parents: 9faa978 Author: Patrick Rhomberg Authored: Thu Jun 8 11:48:47 2017 -0700 Committer: Jinmei Liao Committed: Tue Jun 13 15:11:46 2017 -0700 -- etc/intellij-java-google-style.xml | 365 --- etc/intellij-java-modified-google-style.xml | 255 gradle/rat.gradle | 2 +- 3 files changed, 256 insertions(+), 366 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/a561bd12/etc/intellij-java-google-style.xml -- diff --git a/etc/intellij-java-google-style.xml b/etc/intellij-java-google-style.xml deleted file mode 100644 index 22d9c23..000 --- a/etc/intellij-java-google-style.xml +++ /dev/null @@ -1,365 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/geode/blob/a561bd12/etc/intellij-java-modified-google-style.xml -- diff --git a/etc/intellij-java-modified-google-style.xml b/etc/intellij-java-modified-google-style.xml new file mode 100644 index 000..696500c --- /dev/null +++ b/etc/intellij-java-modified-google-style.xml @@ -0,0 +1,255 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
[02/51] [abbrv] geode git commit: GEODE-2632: use immutable SecurityService impls to improve performance
http://git-wip-us.apache.org/repos/asf/geode/blob/0211029b/geode-core/src/test/java/org/apache/geode/management/internal/security/CacheServerMBeanShiroJUnitTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/security/CacheServerMBeanShiroJUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/security/CacheServerMBeanShiroJUnitTest.java deleted file mode 100644 index d0ea209..000 --- a/geode-core/src/test/java/org/apache/geode/management/internal/security/CacheServerMBeanShiroJUnitTest.java +++ /dev/null @@ -1,109 +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.management.internal.security; - -import static org.apache.geode.distributed.ConfigurationProperties.SECURITY_SHIRO_INIT; -import static org.assertj.core.api.Assertions.assertThatThrownBy; - -import org.apache.geode.management.CacheServerMXBean; -import org.apache.geode.test.dunit.rules.ConnectionConfiguration; -import org.apache.geode.test.dunit.rules.MBeanServerConnectionRule; -import org.apache.geode.test.dunit.rules.ServerStarterRule; -import org.apache.geode.test.junit.categories.IntegrationTest; -import org.apache.geode.test.junit.categories.SecurityTest; -import org.junit.Before; -import org.junit.ClassRule; -import org.junit.Rule; -import org.junit.Test; -import org.junit.experimental.categories.Category; - -@Category({IntegrationTest.class, SecurityTest.class}) -public class CacheServerMBeanShiroJUnitTest { - private CacheServerMXBean bean; - - @ClassRule - public static ServerStarterRule server = new ServerStarterRule() - .withProperty(SECURITY_SHIRO_INIT, "shiro.ini").withJMXManager().withAutoStart(); - - @Rule - public MBeanServerConnectionRule connectionRule = - new MBeanServerConnectionRule(server::getJmxPort); - - @Before - public void setUp() throws Exception { -bean = connectionRule.getProxyMBean(CacheServerMXBean.class); - } - - @Test - @ConnectionConfiguration(user = "root", password = "secret") - public void testAllAccess() throws Exception { -bean.removeIndex("foo"); -bean.executeContinuousQuery("bar"); -bean.fetchLoadProbe(); -bean.getActiveCQCount(); -bean.stopContinuousQuery("bar"); -bean.closeAllContinuousQuery("bar"); -bean.isRunning(); -bean.showClientQueueDetails("foo"); - } - - @Test - @ConnectionConfiguration(user = "guest", password = "guest") - public void testNoAccess() throws Exception { -assertThatThrownBy(() -> bean.removeIndex("foo")) -.hasMessageContaining(TestCommand.dataManage.toString()); -assertThatThrownBy(() -> bean.executeContinuousQuery("bar")) -.hasMessageContaining(TestCommand.dataRead.toString()); -assertThatThrownBy(() -> bean.fetchLoadProbe()) -.hasMessageContaining(TestCommand.clusterRead.toString()); -assertThatThrownBy(() -> bean.getActiveCQCount()) -.hasMessageContaining(TestCommand.clusterRead.toString()); -assertThatThrownBy(() -> bean.stopContinuousQuery("bar")) -.hasMessageContaining(TestCommand.dataManage.toString()); -assertThatThrownBy(() -> bean.closeAllContinuousQuery("bar")) -.hasMessageContaining(TestCommand.dataManage.toString()); -assertThatThrownBy(() -> bean.isRunning()) -.hasMessageContaining(TestCommand.clusterRead.toString()); -assertThatThrownBy(() -> bean.showClientQueueDetails("bar")) -.hasMessageContaining(TestCommand.clusterRead.toString()); - } - - @Test - @ConnectionConfiguration(user = "regionAReader", password = "password") - public void testRegionAccess() throws Exception { -assertThatThrownBy(() -> bean.removeIndex("foo")) -.hasMessageContaining(TestCommand.dataManage.toString()); -assertThatThrownBy(() -> bean.fetchLoadProbe()) -.hasMessageContaining(TestCommand.clusterRead.toString()); -assertThatThrownBy(() -> bean.getActiveCQCount()) -.hasMessageContaining(TestCommand.clusterRead.toString()); - -assertThatThrownBy(() -> bean.executeContinuousQuery("bar")) -.hasMessageContaining(TestCommand.dataRead.toString()); - } - - @Test - @ConnectionCo
[51/51] [abbrv] geode git commit: GEODE-3055: waitUntilFlush should use data region's bucketid list. Some of the buckets maybe not initialized, then wait for tempQueue to be empty.
GEODE-3055: waitUntilFlush should use data region's bucketid list. Some of the buckets maybe not initialized, then wait for tempQueue to be empty. Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/32c74ece Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/32c74ece Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/32c74ece Branch: refs/heads/feature/GEM-1483 Commit: 32c74ecec4cd88ea42221d1f7234a07cb7134186 Parents: 7bc3111 Author: zhouxh Authored: Thu Jun 8 14:52:56 2017 -0700 Committer: zhouxh Committed: Wed Jun 14 15:01:32 2017 -0700 -- .../asyncqueue/internal/AsyncEventQueueImpl.java| 5 +++-- .../internal/cache/wan/AbstractGatewaySender.java | 6 -- ...ntilParallelGatewaySenderFlushedCoordinator.java | 16 +++- ...lelGatewaySenderFlushedCoordinatorJUnitTest.java | 15 ++- .../distributed/WaitUntilFlushedFunction.java | 12 +++- .../WaitUntilFlushedFunctionJUnitTest.java | 5 - 6 files changed, 47 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/32c74ece/geode-core/src/main/java/org/apache/geode/cache/asyncqueue/internal/AsyncEventQueueImpl.java -- diff --git a/geode-core/src/main/java/org/apache/geode/cache/asyncqueue/internal/AsyncEventQueueImpl.java b/geode-core/src/main/java/org/apache/geode/cache/asyncqueue/internal/AsyncEventQueueImpl.java index bf7e874..a420dab 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/asyncqueue/internal/AsyncEventQueueImpl.java +++ b/geode-core/src/main/java/org/apache/geode/cache/asyncqueue/internal/AsyncEventQueueImpl.java @@ -217,7 +217,8 @@ public class AsyncEventQueueImpl implements AsyncEventQueue { return ((AbstractGatewaySender) this.sender).isForwardExpirationDestroy(); } - public boolean waitUntilFlushed(long timeout, TimeUnit unit) throws InterruptedException { -return ((AbstractGatewaySender) this.sender).waitUntilFlushed(timeout, unit); + public boolean waitUntilFlushed(Set bucketIds, long timeout, TimeUnit unit) + throws InterruptedException { +return ((AbstractGatewaySender) this.sender).waitUntilFlushed(bucketIds, timeout, unit); } } http://git-wip-us.apache.org/repos/asf/geode/blob/32c74ece/geode-core/src/main/java/org/apache/geode/internal/cache/wan/AbstractGatewaySender.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/AbstractGatewaySender.java b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/AbstractGatewaySender.java index c38d547..b6a23d6 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/AbstractGatewaySender.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/AbstractGatewaySender.java @@ -1254,12 +1254,14 @@ public abstract class AbstractGatewaySender implements GatewaySender, Distributi return lifeCycleLock; } - public boolean waitUntilFlushed(long timeout, TimeUnit unit) throws InterruptedException { + public boolean waitUntilFlushed(Set bucketIds, long timeout, TimeUnit unit) + throws InterruptedException { boolean result = false; if (isParallel()) { try { WaitUntilParallelGatewaySenderFlushedCoordinator coordinator = -new WaitUntilParallelGatewaySenderFlushedCoordinator(this, timeout, unit, true); +new WaitUntilParallelGatewaySenderFlushedCoordinator(this, bucketIds, timeout, unit, +true); result = coordinator.waitUntilFlushed(); } catch (BucketMovedException | CancelException | RegionDestroyedException e) { logger.warn( http://git-wip-us.apache.org/repos/asf/geode/blob/32c74ece/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/WaitUntilParallelGatewaySenderFlushedCoordinator.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/WaitUntilParallelGatewaySenderFlushedCoordinator.java b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/WaitUntilParallelGatewaySenderFlushedCoordinator.java index 42ce68c..7856324 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/WaitUntilParallelGatewaySenderFlushedCoordinator.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/WaitUntilParallelGatewaySenderFlushedCoordinator.java @@ -19,6 +19,7 @@ import org.apache.geode.distributed.internal.*; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; import org.apache.geode.internal.cache.*; import org.apache.geode.i
[05/51] [abbrv] geode git commit: GEODE-2632: use immutable SecurityService impls to improve performance
http://git-wip-us.apache.org/repos/asf/geode/blob/0211029b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/IndexCommands.java -- diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/IndexCommands.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/IndexCommands.java index b3d9675..5a4a3d7 100644 --- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/IndexCommands.java +++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/IndexCommands.java @@ -26,8 +26,6 @@ import org.apache.geode.distributed.DistributedMember; import org.apache.geode.internal.cache.InternalCache; import org.apache.geode.internal.cache.execute.AbstractExecution; import org.apache.geode.internal.lang.StringUtils; -import org.apache.geode.internal.security.IntegratedSecurityService; -import org.apache.geode.internal.security.SecurityService; import org.apache.geode.management.cli.CliMetaData; import org.apache.geode.management.cli.ConverterHint; import org.apache.geode.management.cli.Result; @@ -41,7 +39,6 @@ import org.apache.geode.management.internal.cli.functions.CreateIndexFunction; import org.apache.geode.management.internal.cli.functions.DestroyIndexFunction; import org.apache.geode.management.internal.cli.functions.ListIndexFunction; import org.apache.geode.management.internal.cli.i18n.CliStrings; -import org.apache.geode.management.internal.cli.result.CommandResultException; import org.apache.geode.management.internal.cli.result.ErrorResultData; import org.apache.geode.management.internal.cli.result.InfoResultData; import org.apache.geode.management.internal.cli.result.ResultBuilder; @@ -67,8 +64,7 @@ import java.util.concurrent.atomic.AtomicReference; /** * The IndexCommands class encapsulates all GemFire shell (Gfsh) commands related to indexes defined * in GemFire. - * - * + * * @see GfshCommand * @see org.apache.geode.management.internal.cli.domain.IndexDetails * @see org.apache.geode.management.internal.cli.functions.ListIndexFunction @@ -84,8 +80,6 @@ public class IndexCommands implements GfshCommand { private static final Set indexDefinitions = Collections.synchronizedSet(new HashSet()); - private SecurityService securityService = IntegratedSecurityService.getSecurityService(); - @CliCommand(value = CliStrings.LIST_INDEX, help = CliStrings.LIST_INDEX__HELP) @CliMetaData(shellOnly = false, relatedTopic = {CliStrings.TOPIC_GEODE_REGION, CliStrings.TOPIC_GEODE_DATA}) @@ -196,7 +190,7 @@ public class IndexCommands implements GfshCommand { Result result = null; AtomicReference xmlEntity = new AtomicReference<>(); -this.securityService.authorizeRegionManage(regionPath); +getCache().getSecurityService().authorizeRegionManage(regionPath); try { final Cache cache = CacheFactory.getAnyInstance(); @@ -312,7 +306,6 @@ public class IndexCommands implements GfshCommand { result = ResultBuilder.createGemFireErrorResult(e.getMessage()); } - if (xmlEntity.get() != null) { persistClusterConfiguration(result, () -> getSharedConfiguration().addXmlEntity(xmlEntity.get(), group)); @@ -355,9 +348,9 @@ public class IndexCommands implements GfshCommand { // requires data manage permission on all regions if (StringUtils.isNotBlank(regionPath)) { regionName = regionPath.startsWith("/") ? regionPath.substring(1) : regionPath; - this.securityService.authorizeRegionManage(regionName); + getCache().getSecurityService().authorizeRegionManage(regionName); } else { - this.securityService.authorizeDataManage(); + getCache().getSecurityService().authorizeDataManage(); } IndexInfo indexInfo = new IndexInfo(indexName, regionName); @@ -479,7 +472,7 @@ public class IndexCommands implements GfshCommand { Result result = null; XmlEntity xmlEntity = null; -this.securityService.authorizeRegionManage(regionPath); +getCache().getSecurityService().authorizeRegionManage(regionPath); int idxType = IndexInfo.RANGE_INDEX; @@ -641,14 +634,13 @@ public class IndexCommands implements GfshCommand { final InfoResultData infoResult = ResultBuilder.createInfoResultData(); infoResult.addLine(CliStrings.CLEAR_DEFINED_INDEX__SUCCESS__MSG); return ResultBuilder.buildResult(infoResult); - } @CliAvailabilityIndicator({CliStrings.LIST_INDEX, CliStrings.CREATE_INDEX, CliStrings.DESTROY_INDEX, CliStrings.CREATE_DEFINED_INDEXES, CliStrings.CLEAR_DEFINED_INDEXES, CliStrings.DEFINE_INDEX}) public boolean indexCommandsAvailable() { -return (!CliUtil.isGfshVM() || (getGfsh() != null && getGfsh().isConnectedAndReady())); +return !CliUtil.isGfshVM() || getGfsh() != null && getGfsh().isConnectedAndReady(); } protected sta
[39/51] [abbrv] geode git commit: GEODE-2818: add alias to any command's options that involves "group", "member", "jar" and replace CliString variables with GROUP, MEMBER, JAR, etc.
GEODE-2818: add alias to any command's options that involves "group", "member", "jar" and replace CliString variables with GROUP, MEMBER, JAR, etc. * this closes #560 Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/db8e1df3 Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/db8e1df3 Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/db8e1df3 Branch: refs/heads/feature/GEM-1483 Commit: db8e1df392bcdbaabb44263e6c699756eda14850 Parents: a4d790c Author: YehEmily Authored: Mon Jun 5 13:03:39 2017 -0700 Committer: Jinmei Liao Committed: Wed Jun 14 08:59:51 2017 -0700 -- ...erConfigurationServiceEndToEndDUnitTest.java | 8 +- .../internal/cli/commands/ConfigCommands.java | 20 ++- .../CreateAlterDestroyRegionCommands.java | 24 ++-- .../internal/cli/commands/DataCommands.java | 4 +- .../internal/cli/commands/DeployCommands.java | 11 +- .../cli/commands/DiskStoreCommands.java | 12 +- .../cli/commands/DurableClientCommands.java | 22 +-- .../cli/commands/ExportLogsCommand.java | 4 +- .../internal/cli/commands/FunctionCommands.java | 20 +-- .../internal/cli/commands/IndexCommands.java| 14 +- .../cli/commands/LauncherLifecycleCommands.java | 4 +- .../internal/cli/commands/MemberCommands.java | 4 +- .../cli/commands/MiscellaneousCommands.java | 34 +++-- .../internal/cli/commands/QueueCommands.java| 2 +- .../internal/cli/commands/RegionCommands.java | 6 +- .../internal/cli/commands/WanCommands.java | 116 +++ .../internal/cli/i18n/CliStrings.java | 99 ++--- .../controllers/ConfigCommandsController.java | 24 ++-- .../web/controllers/DataCommandsController.java | 4 +- .../controllers/DeployCommandsController.java | 26 ++-- .../DiskStoreCommandsController.java| 22 ++- .../DurableClientCommandsController.java| 50 +++ .../web/controllers/ExportLogController.java| 10 +- .../controllers/FunctionCommandsController.java | 32 ++--- .../controllers/IndexCommandsController.java| 36 ++--- .../controllers/MemberCommandsController.java | 6 +- .../MiscellaneousCommandsController.java| 36 +++-- .../controllers/QueueCommandsController.java| 6 +- .../controllers/RegionCommandsController.java | 20 ++- .../web/controllers/WanCommandsController.java | 143 +++ .../cli/commands/ConfigCommandsDUnitTest.java | 4 +- ...eateAlterDestroyRegionCommandsDUnitTest.java | 26 ++-- .../commands/DiskStoreCommandsDUnitTest.java| 16 +-- .../commands/GemfireDataCommandsDUnitTest.java | 60 .../cli/commands/IndexCommandsDUnitTest.java| 16 +-- .../ListAndDescribeRegionDUnitTest.java | 8 +- .../cli/commands/MemberCommandsDUnitTest.java | 2 +- .../MiscellaneousCommandsDUnitTest.java | 17 ++- .../cli/commands/QueueCommandsDUnitTest.java| 6 +- .../cli/commands/ShowMetricsDUnitTest.java | 6 +- .../cli/commands/ShowStackTraceDUnitTest.java | 8 +- .../cli/shell/GfshMultilineCommandTest.java | 7 +- .../ClusterConfigDistributionDUnitTest.java | 2 +- .../WanCommandsControllerJUnitTest.java | 14 +- .../LuceneClusterConfigurationDUnitTest.java| 4 +- ...mandCreateDestroyGatewaySenderDUnitTest.java | 56 ...anCommandCreateGatewayReceiverDUnitTest.java | 57 ...WanCommandGatewayReceiverStartDUnitTest.java | 39 +++-- .../WanCommandGatewayReceiverStopDUnitTest.java | 39 +++-- .../WanCommandGatewaySenderStartDUnitTest.java | 40 +++--- .../WanCommandGatewaySenderStopDUnitTest.java | 34 ++--- .../wan/wancommand/WanCommandListDUnitTest.java | 32 ++--- .../WanCommandPauseResumeDUnitTest.java | 68 - .../wancommand/WanCommandStatusDUnitTest.java | 56 .../ClusterConfigurationDUnitTest.java | 10 +- ...nfigurationIndexWithFromClauseDUnitTest.java | 4 +- 56 files changed, 630 insertions(+), 820 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/db8e1df3/geode-assembly/src/test/java/org/apache/geode/management/internal/configuration/ClusterConfigurationServiceEndToEndDUnitTest.java -- diff --git a/geode-assembly/src/test/java/org/apache/geode/management/internal/configuration/ClusterConfigurationServiceEndToEndDUnitTest.java b/geode-assembly/src/test/java/org/apache/geode/management/internal/configuration/ClusterConfigurationServiceEndToEndDUnitTest.java index 791f2ce..415ac3e 100644 --- a/geode-assembly/src/test/java/org/apache/geode/management/internal/configuration/ClusterConfigurationServiceEndToEndDUnitTest.java +++ b/geode-assembly/src/test/java/org/apache/geode/management/inter
[23/51] [abbrv] geode git commit: GEODE-3023: removing incorrect assertion
GEODE-3023: removing incorrect assertion Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/70483db0 Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/70483db0 Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/70483db0 Branch: refs/heads/feature/GEM-1483 Commit: 70483db0ef3b8045565bc48d83d2daea3cb5d8eb Parents: 831ed21 Author: Udo Kohlmeyer Authored: Sat Jun 10 09:10:34 2017 -0700 Committer: Udo Kohlmeyer Committed: Sat Jun 10 09:10:34 2017 -0700 -- .../distributed/internal/tcpserver/TCPServerSSLJUnitTest.java | 3 --- 1 file changed, 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/70483db0/geode-core/src/test/java/org/apache/geode/distributed/internal/tcpserver/TCPServerSSLJUnitTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/distributed/internal/tcpserver/TCPServerSSLJUnitTest.java b/geode-core/src/test/java/org/apache/geode/distributed/internal/tcpserver/TCPServerSSLJUnitTest.java index ee70018..8a25aaf 100644 --- a/geode-core/src/test/java/org/apache/geode/distributed/internal/tcpserver/TCPServerSSLJUnitTest.java +++ b/geode-core/src/test/java/org/apache/geode/distributed/internal/tcpserver/TCPServerSSLJUnitTest.java @@ -84,7 +84,6 @@ public class TCPServerSSLJUnitTest { @Test public void testSSLSocketTimeOut() throws IOException { -boolean caughtLocatorException = false; try { System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "TcpServer.READ_TIMEOUT", @@ -96,10 +95,8 @@ public class TCPServerSSLJUnitTest { } catch (LocatorCancelException e) { // we catching the LocatorCancelException. Expected to have the exception thrown - caughtLocatorException = true; } -Assert.assertTrue(caughtLocatorException); List recordedSocketsForSocketCreator = server.getRecordedSocketTimeouts(); Assert.assertEquals(1, recordedSocketsForSocketCreator.size());
[04/51] [abbrv] geode git commit: GEODE-2632: use immutable SecurityService impls to improve performance
http://git-wip-us.apache.org/repos/asf/geode/blob/0211029b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/CreateRegionTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/CreateRegionTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/CreateRegionTest.java index c946e8a..6d346f7 100644 --- a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/CreateRegionTest.java +++ b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/CreateRegionTest.java @@ -98,7 +98,7 @@ public class CreateRegionTest { public void noSecurityShouldSucceed() throws Exception { when(this.securityService.isClientSecurityRequired()).thenReturn(false); -this.createRegion.cmdExecute(this.message, this.serverConnection, 0); +this.createRegion.cmdExecute(this.message, this.serverConnection, this.securityService, 0); verify(this.responseMessage).send(this.serverConnection); } @@ -110,7 +110,7 @@ public class CreateRegionTest { when(this.securityService.isIntegratedSecurity()).thenReturn(true); // act -this.createRegion.cmdExecute(this.message, this.serverConnection, 0); +this.createRegion.cmdExecute(this.message, this.serverConnection, this.securityService, 0); // assert verify(this.securityService).authorizeDataManage(); @@ -123,7 +123,7 @@ public class CreateRegionTest { when(this.securityService.isIntegratedSecurity()).thenReturn(true); doThrow(new NotAuthorizedException("")).when(this.securityService).authorizeDataManage(); -this.createRegion.cmdExecute(this.message, this.serverConnection, 0); +this.createRegion.cmdExecute(this.message, this.serverConnection, this.securityService, 0); verify(this.securityService).authorizeDataManage(); verify(this.errorResponseMessage).send(eq(this.serverConnection)); @@ -134,7 +134,7 @@ public class CreateRegionTest { when(this.securityService.isClientSecurityRequired()).thenReturn(true); when(this.securityService.isIntegratedSecurity()).thenReturn(false); -this.createRegion.cmdExecute(this.message, this.serverConnection, 0); +this.createRegion.cmdExecute(this.message, this.serverConnection, this.securityService, 0); verify(this.authzRequest).createRegionAuthorize(eq(PARENT_REGION_NAME + '/' + REGION_NAME)); verify(this.responseMessage).send(this.serverConnection); @@ -147,7 +147,7 @@ public class CreateRegionTest { doThrow(new NotAuthorizedException("")).when(this.authzRequest) .createRegionAuthorize(eq(PARENT_REGION_NAME + '/' + REGION_NAME)); -this.createRegion.cmdExecute(this.message, this.serverConnection, 0); +this.createRegion.cmdExecute(this.message, this.serverConnection, this.securityService, 0); verify(this.authzRequest).createRegionAuthorize(eq(PARENT_REGION_NAME + '/' + REGION_NAME)); verify(this.errorResponseMessage).send(eq(this.serverConnection)); http://git-wip-us.apache.org/repos/asf/geode/blob/0211029b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Destroy65Test.java -- diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Destroy65Test.java b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Destroy65Test.java index d3f68f2..a482a8c 100644 --- a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Destroy65Test.java +++ b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Destroy65Test.java @@ -118,7 +118,7 @@ public class Destroy65Test { public void noSecurityShouldSucceed() throws Exception { when(this.securityService.isClientSecurityRequired()).thenReturn(false); -this.destroy65.cmdExecute(this.message, this.serverConnection, 0); +this.destroy65.cmdExecute(this.message, this.serverConnection, this.securityService, 0); verify(this.responseMessage).send(this.serverConnection); } @@ -128,7 +128,7 @@ public class Destroy65Test { when(this.securityService.isClientSecurityRequired()).thenReturn(true); when(this.securityService.isIntegratedSecurity()).thenReturn(true); -this.destroy65.cmdExecute(this.message, this.serverConnection, 0); +this.destroy65.cmdExecute(this.message, this.serverConnection, this.securityService, 0); verify(this.securityService).authorizeRegionWrite(eq(REGION_NAME), eq(KEY)); verify(this.responseMessage).send(this.serverConnection); @@ -141,7 +141,7 @@ public class Destroy65Test { doThrow(new NotAuthorizedException("")).when(this.securityService) .authorizeRegionWrite(eq(REGION_NAME), eq(KEY)); -this.destroy65.cmdExecute(this.message, this.serverConnection, 0);
[10/51] [abbrv] geode git commit: GEODE-2632: use immutable SecurityService impls to improve performance
http://git-wip-us.apache.org/repos/asf/geode/blob/0211029b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/Services.java -- diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/Services.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/Services.java index 1404b3b..2d6af1a 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/Services.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/Services.java @@ -26,7 +26,12 @@ import org.apache.geode.distributed.internal.membership.MembershipManager; import org.apache.geode.distributed.internal.membership.NetView; import org.apache.geode.distributed.internal.membership.gms.auth.GMSAuthenticator; import org.apache.geode.distributed.internal.membership.gms.fd.GMSHealthMonitor; -import org.apache.geode.distributed.internal.membership.gms.interfaces.*; +import org.apache.geode.distributed.internal.membership.gms.interfaces.Authenticator; +import org.apache.geode.distributed.internal.membership.gms.interfaces.HealthMonitor; +import org.apache.geode.distributed.internal.membership.gms.interfaces.JoinLeave; +import org.apache.geode.distributed.internal.membership.gms.interfaces.Locator; +import org.apache.geode.distributed.internal.membership.gms.interfaces.Manager; +import org.apache.geode.distributed.internal.membership.gms.interfaces.Messenger; import org.apache.geode.distributed.internal.membership.gms.locator.GMSLocator; import org.apache.geode.distributed.internal.membership.gms.membership.GMSJoinLeave; import org.apache.geode.distributed.internal.membership.gms.messenger.JGroupsMessenger; @@ -35,6 +40,8 @@ import org.apache.geode.internal.admin.remote.RemoteTransportConfig; import org.apache.geode.internal.logging.InternalLogWriter; import org.apache.geode.internal.logging.LogService; import org.apache.geode.internal.logging.LoggingThreadGroup; +import org.apache.geode.internal.security.SecurityService; +import org.apache.geode.internal.security.SecurityServiceFactory; import org.apache.geode.security.AuthenticationFailedException; import org.apache.logging.log4j.Logger; @@ -51,26 +58,27 @@ public class Services { private static InternalLogWriter staticLogWriter; private static InternalLogWriter staticSecurityLogWriter; - final private Manager manager; - final private JoinLeave joinLeave; - private Locator locator; - final private HealthMonitor healthMon; - final private Messenger messenger; - final private Authenticator auth; - final private ServiceConfig config; - final private DMStats stats; - final private Stopper cancelCriterion; + private final Manager manager; + private final JoinLeave joinLeave; + private final HealthMonitor healthMon; + private final Messenger messenger; + private final Authenticator auth; + private final ServiceConfig config; + private final DMStats stats; + private final Stopper cancelCriterion; + private final SecurityService securityService; + private volatile boolean stopping; private volatile boolean stopped; private volatile Exception shutdownCause; + private Locator locator; + private InternalLogWriter logWriter; private InternalLogWriter securityLogWriter; private final Timer timer = new Timer("Geode Membership Timer", true); - - /** * A common logger for membership classes */ @@ -96,7 +104,6 @@ public class Services { return this.stopped; } - /** * for testing only - create a non-functional Services object with a Stopper */ @@ -108,11 +115,12 @@ public class Services { this.joinLeave = null; this.healthMon = null; this.messenger = null; +this.securityService = SecurityServiceFactory.create(); this.auth = null; } public Services(DistributedMembershipListener listener, DistributionConfig config, - RemoteTransportConfig transport, DMStats stats) { + RemoteTransportConfig transport, DMStats stats, SecurityService securityService) { this.cancelCriterion = new Stopper(); this.stats = stats; this.config = new ServiceConfig(transport, config); @@ -120,15 +128,16 @@ public class Services { this.joinLeave = new GMSJoinLeave(); this.healthMon = new GMSHealthMonitor(); this.messenger = new JGroupsMessenger(); +this.securityService = securityService; this.auth = new GMSAuthenticator(); } protected void init() { // InternalDistributedSystem establishes this log writer at boot time // TODO fix this so that IDS doesn't know about Services -securityLogWriter = staticSecurityLogWriter; +this.securityLogWriter = staticSecurityLogWriter; staticSecurityLogWriter = null; -logWriter = staticLogWriter; +this.logWriter = staticLogWriter; staticLogWriter = null; this.auth.init(
[11/51] [abbrv] geode git commit: GEODE-2632: use immutable SecurityService impls to improve performance
GEODE-2632: use immutable SecurityService impls to improve performance * misc code clean up in classes touched by changes * new unit tests for SecurityService Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/0211029b Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/0211029b Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/0211029b Branch: refs/heads/feature/GEM-1483 Commit: 0211029baf497bbcca2670dbabe610d84bc626a5 Parents: 3f12fd4 Author: Kirk Lund Authored: Wed May 31 16:13:20 2017 -0700 Committer: Kirk Lund Committed: Fri Jun 9 10:17:12 2017 -0700 -- .../RestAPIsAndInterOpsDUnitTest.java | 846 --- .../org/apache/geode/cache/CacheFactory.java| 46 +- .../geode/cache/client/ClientCacheFactory.java | 4 +- .../geode/distributed/LocatorLauncher.java | 1 - .../geode/distributed/ServerLauncher.java | 1 - .../internal/DistributionManager.java | 4 +- .../internal/InternalDistributedSystem.java | 53 +- .../distributed/internal/SecurityConfig.java| 51 ++ .../internal/membership/MemberFactory.java | 16 +- .../internal/membership/MemberServices.java | 4 +- .../membership/gms/GMSMemberFactory.java| 11 +- .../internal/membership/gms/Services.java | 127 +-- .../membership/gms/auth/GMSAuthenticator.java | 41 +- .../apache/geode/internal/ClassLoadUtil.java| 75 +- .../internal/cache/AbstractLRURegionMap.java| 1 - .../geode/internal/cache/CacheServerImpl.java | 4 + .../geode/internal/cache/DiskStoreImpl.java | 1 - .../geode/internal/cache/GemFireCacheImpl.java | 36 +- .../geode/internal/cache/InternalCache.java | 3 + .../cache/PartitionedRegionDataStore.java | 2 - .../cache/partitioned/FetchEntriesMessage.java | 45 +- .../geode/internal/cache/tier/Command.java | 4 +- .../cache/tier/sockets/AcceptorImpl.java| 80 +- .../cache/tier/sockets/BaseCommand.java | 52 +- .../cache/tier/sockets/BaseCommandQuery.java| 64 +- .../cache/tier/sockets/CacheClientNotifier.java | 47 +- .../cache/tier/sockets/CacheClientProxy.java| 7 +- .../internal/cache/tier/sockets/HandShake.java | 43 +- .../cache/tier/sockets/ServerConnection.java| 44 +- .../tier/sockets/ServerHandShakeProcessor.java | 11 +- .../cache/tier/sockets/command/AddPdxEnum.java | 4 +- .../cache/tier/sockets/command/AddPdxType.java | 4 +- .../cache/tier/sockets/command/ClearRegion.java | 7 +- .../cache/tier/sockets/command/ClientReady.java | 5 +- .../tier/sockets/command/CloseConnection.java | 5 +- .../tier/sockets/command/CommitCommand.java | 8 +- .../cache/tier/sockets/command/ContainsKey.java | 9 +- .../tier/sockets/command/ContainsKey66.java | 10 +- .../tier/sockets/command/CreateRegion.java | 10 +- .../cache/tier/sockets/command/Default.java | 5 +- .../cache/tier/sockets/command/Destroy.java | 6 +- .../cache/tier/sockets/command/Destroy65.java | 9 +- .../tier/sockets/command/DestroyRegion.java | 9 +- .../tier/sockets/command/ExecuteFunction.java | 62 +- .../tier/sockets/command/ExecuteFunction65.java | 67 +- .../tier/sockets/command/ExecuteFunction66.java | 83 +- .../tier/sockets/command/ExecuteFunction70.java | 7 +- .../sockets/command/ExecuteRegionFunction.java | 66 +- .../command/ExecuteRegionFunction61.java| 64 +- .../command/ExecuteRegionFunction65.java| 89 +- .../command/ExecuteRegionFunction66.java| 102 +-- .../command/ExecuteRegionFunctionSingleHop.java | 90 +- .../sockets/command/GatewayReceiverCommand.java | 6 +- .../cache/tier/sockets/command/Get70.java | 9 +- .../cache/tier/sockets/command/GetAll.java | 15 +- .../cache/tier/sockets/command/GetAll651.java | 17 +- .../cache/tier/sockets/command/GetAll70.java| 16 +- .../sockets/command/GetAllWithCallback.java | 19 +- .../command/GetClientPRMetadataCommand.java | 4 +- .../command/GetClientPRMetadataCommand66.java | 4 +- .../GetClientPartitionAttributesCommand.java| 4 +- .../GetClientPartitionAttributesCommand66.java | 4 +- .../sockets/command/GetFunctionAttribute.java | 5 +- .../tier/sockets/command/GetPDXEnumById.java| 4 +- .../tier/sockets/command/GetPDXIdForEnum.java | 4 +- .../tier/sockets/command/GetPDXIdForType.java | 4 +- .../tier/sockets/command/GetPDXTypeById.java| 4 +- .../tier/sockets/command/GetPdxEnums70.java | 4 +- .../tier/sockets/command/GetPdxTypes70.java | 4 +- .../cache/tier/sockets/command/Invalid.java | 5 +- .../cache/tier/sockets/command/Invalidate.java | 9 +- .../cache/tier/sockets/command/KeySet.java | 7 +- .../cache/tier/sockets/command/MakePrimary.java | 5 +- .../tier/sockets/command/Managemen
[29/51] [abbrv] geode git commit: GEODE-2928: get rid of the isGfshVM static variable - fix merge issues
GEODE-2928: get rid of the isGfshVM static variable - fix merge issues Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/8cd03e87 Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/8cd03e87 Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/8cd03e87 Branch: refs/heads/feature/GEM-1483 Commit: 8cd03e87f9682cb71c31c0a73c2716f09e6a4664 Parents: f85d216 Author: Jinmei Liao Authored: Mon Jun 12 14:06:04 2017 -0700 Committer: Jinmei Liao Committed: Mon Jun 12 14:06:04 2017 -0700 -- .../geode/management/internal/cli/commands/DataCommands.java | 3 ++- .../management/internal/cli/functions/DataCommandFunction.java| 1 + 2 files changed, 3 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/8cd03e87/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DataCommands.java -- diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DataCommands.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DataCommands.java index d004b38..9dee89d 100644 --- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DataCommands.java +++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DataCommands.java @@ -19,6 +19,7 @@ import org.apache.commons.lang.ArrayUtils; import org.apache.commons.lang.StringUtils; import org.apache.geode.LogWriter; import org.apache.geode.cache.CacheClosedException; +import org.apache.geode.cache.CacheFactory; import org.apache.geode.cache.DataPolicy; import org.apache.geode.cache.Region; import org.apache.geode.cache.control.RebalanceFactory; @@ -55,11 +56,11 @@ import org.apache.geode.management.internal.cli.result.CompositeResultData; import org.apache.geode.management.internal.cli.result.ErrorResultData; import org.apache.geode.management.internal.cli.result.ResultBuilder; import org.apache.geode.management.internal.cli.result.TabularResultData; +import org.apache.geode.management.internal.cli.shell.Gfsh; import org.apache.geode.management.internal.security.ResourceOperation; import org.apache.geode.security.ResourcePermission.Operation; import org.apache.geode.security.ResourcePermission.Resource; import org.apache.shiro.subject.Subject; -import org.springframework.shell.core.annotation.CliAvailabilityIndicator; import org.springframework.shell.core.annotation.CliCommand; import org.springframework.shell.core.annotation.CliOption; http://git-wip-us.apache.org/repos/asf/geode/blob/8cd03e87/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/DataCommandFunction.java -- diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/DataCommandFunction.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/DataCommandFunction.java index 0efe074..41cc171 100644 --- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/DataCommandFunction.java +++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/DataCommandFunction.java @@ -124,6 +124,7 @@ public class DataCommandFunction extends FunctionAdapter implements InternalEnti @Override public void execute(FunctionContext functionContext) { try { + InternalCache cache = getCache(); DataCommandRequest request = (DataCommandRequest) functionContext.getArguments(); if (logger.isDebugEnabled()) { logger.debug("Executing function : \n{}\n on member {}", request,
geode git commit: GEODE-3055: real root cause is: The old primary's the shadow bucket is not initialized when rebalance remove it. Thus the new primary candidate can never initialize from it. The fix
Repository: geode Updated Branches: refs/heads/feature/GEM-1483 e07b513f3 -> 84baa3718 GEODE-3055: real root cause is: The old primary's the shadow bucket is not initialized when rebalance remove it. Thus the new primary candidate can never initialize from it. The fix is to wait until new primary exists before remove the old primary's bucket in rebalance. Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/84baa371 Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/84baa371 Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/84baa371 Branch: refs/heads/feature/GEM-1483 Commit: 84baa37185ac210bde492e67362ea101565ecdb3 Parents: e07b513 Author: zhouxh Authored: Wed Jun 14 14:31:30 2017 -0700 Committer: zhouxh Committed: Wed Jun 14 14:36:31 2017 -0700 -- .../asyncqueue/internal/AsyncEventQueueImpl.java | 5 ++--- .../internal/cache/PartitionedRegionDataStore.java | 17 ++--- .../internal/cache/wan/AbstractGatewaySender.java | 6 ++ ...tilParallelGatewaySenderFlushedCoordinator.java | 16 +--- ...elGatewaySenderFlushedCoordinatorJUnitTest.java | 15 +-- .../distributed/WaitUntilFlushedFunction.java | 12 +--- .../WaitUntilFlushedFunctionJUnitTest.java | 5 + 7 files changed, 26 insertions(+), 50 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/84baa371/geode-core/src/main/java/org/apache/geode/cache/asyncqueue/internal/AsyncEventQueueImpl.java -- diff --git a/geode-core/src/main/java/org/apache/geode/cache/asyncqueue/internal/AsyncEventQueueImpl.java b/geode-core/src/main/java/org/apache/geode/cache/asyncqueue/internal/AsyncEventQueueImpl.java index a420dab..bf7e874 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/asyncqueue/internal/AsyncEventQueueImpl.java +++ b/geode-core/src/main/java/org/apache/geode/cache/asyncqueue/internal/AsyncEventQueueImpl.java @@ -217,8 +217,7 @@ public class AsyncEventQueueImpl implements AsyncEventQueue { return ((AbstractGatewaySender) this.sender).isForwardExpirationDestroy(); } - public boolean waitUntilFlushed(Set bucketIds, long timeout, TimeUnit unit) - throws InterruptedException { -return ((AbstractGatewaySender) this.sender).waitUntilFlushed(bucketIds, timeout, unit); + public boolean waitUntilFlushed(long timeout, TimeUnit unit) throws InterruptedException { +return ((AbstractGatewaySender) this.sender).waitUntilFlushed(timeout, unit); } } http://git-wip-us.apache.org/repos/asf/geode/blob/84baa371/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionDataStore.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionDataStore.java b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionDataStore.java index 037bff6..e529e4e 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionDataStore.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionDataStore.java @@ -1472,6 +1472,19 @@ public class PartitionedRegionDataStore implements HasCachePerfStats { } BucketAdvisor bucketAdvisor = bucketRegion.getBucketAdvisor(); + InternalDistributedMember primary = bucketAdvisor.getPrimary(); + InternalDistributedMember myId = + this.partitionedRegion.getDistributionManager().getDistributionManagerId(); + if (primary == null || myId.equals(primary)) { +if (logger.isDebugEnabled()) { + logger.debug("Bucket region " + bucketRegion + + " does not have a remote primary yet. Not to remove."); +} +return false; + } + if (logger.isDebugEnabled()) { +logger.debug("Bucket region " + bucketRegion + " has primary at " + primary); + } Lock writeLock = bucketAdvisor.getActiveWriteLock(); // Fix for 43613 - don't remove the bucket @@ -1512,9 +1525,7 @@ public class PartitionedRegionDataStore implements HasCachePerfStats { // wait for in progress writes. I choose to use the StateFlushOperation // because it won't block write operations while we're trying to acquire // the activePrimaryMoveLock - InternalDistributedMember primary = bucketAdvisor.getPrimary(); - InternalDistributedMember myId = - this.partitionedRegion.getDistributionManager().getDistributionManagerId(); + primary = bucketAdvisor.getPrimary(); if (!myId.equals(primary)) { StateFlushOperation flush = new StateFlushOperation(bucketRegion); int executor = DistributionManager.WAITING_POOL_EXECUTOR; http://git-w
geode git commit: GEODE-3070: Fix gemfire.jar to be geode-dependencies.jar
Repository: geode Updated Branches: refs/heads/develop d9869ffd5 -> 7bc31116b GEODE-3070: Fix gemfire.jar to be geode-dependencies.jar Updated a few other errors found along the way, including the name of the RAR file for JTA transactions, and outdated output of sample gfsh commands in the gfsh tutorial. Also added a final step that shuts down the cluster in the tutorial. This closes #579 Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/7bc31116 Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/7bc31116 Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/7bc31116 Branch: refs/heads/develop Commit: 7bc31116bdefcab96f68bdb37699b32d8c2dc10c Parents: d9869ff Author: Karen Miller Authored: Tue Jun 13 15:55:56 2017 -0700 Committer: Karen Miller Committed: Wed Jun 14 13:38:27 2017 -0700 -- .../transactions/JTA_transactions.html.md.erb | 21 +++-- .../tools_modules/gfsh/tour_of_gfsh.html.md.erb | 86 +--- 2 files changed, 68 insertions(+), 39 deletions(-) -- http://git-wip-us.apache.org/repos/asf/geode/blob/7bc31116/geode-docs/developing/transactions/JTA_transactions.html.md.erb -- diff --git a/geode-docs/developing/transactions/JTA_transactions.html.md.erb b/geode-docs/developing/transactions/JTA_transactions.html.md.erb index e218684..3164dce 100644 --- a/geode-docs/developing/transactions/JTA_transactions.html.md.erb +++ b/geode-docs/developing/transactions/JTA_transactions.html.md.erb @@ -122,8 +122,9 @@ To accomplish this, the application server container must use a JCA Resource Ada # How to Run JTA Transactions with Geode as a "Last Resource" -1. Locate the `$GEMFIRE/lib/gemfire-jca.rar` file in your Geode installation. -2. Add your container-specific XML file to the `gemfire-jca.rar` file. +1. Locate the version-specific `geode-jca` RAR file within +the `lib` directory of your Geode installation. +2. Add your container-specific XML file to the `geode-jca` RAR file. Create a container-specific resource adapter XML file named-ra.xml. For example, an XML file for a WebLogic resource adapter XML file might look something like this: @@ -144,17 +145,21 @@ To accomplish this, the application server container must use a JCA Resource Ada META-INF/weblogic-ra.xml ``` -Navigate to the directory above the `META-INF` folder and execute the following command: +Navigate to the directory above the `META-INF` folder and execute the following command, with appropriate substitutions for +path and file names: ``` pre -$ jar -uf /lib/gemfire-jca.rar META-INF/weblogic-ra.xml +$ jar -uf /path/to/lib/geode-jca-X-X-X.rar META-INF/weblogic-ra.xml ``` -3. Make sure that `$GEMFIRE/lib/gemfire.jar` is accessible in the CLASSPATH of the JTA transaction coordinator container. -4. Deploy `gemfire-jca.rar` file on the JTA transaction coordinator container . When deploying the file, you specify the JNDI name and so on. +3. Make sure that the `geode-dependencies.jar` is accessible in +the CLASSPATH of the JTA transaction coordinator container. +4. Deploy the version-specific `geode-jca` RAR file on +the JTA transaction coordinator container. +When deploying the file, you specify the JNDI name and so on. 5. Configure Geode for any necessary transactional behavior. Enable `copy-on-read` and specify a transaction listener, if you need one. See [Setting Global Copy on Read](working_with_transactions.html#concept_vx2_gs4_5k) and [Configuring Transaction Plug-In Event Handlers](working_with_transactions.html#concept_ocw_vf1_wk) for details. -6. Get an initial context through `com.gemstone.cache.Cache.getJNDIContext`. For example: +6. Get an initial context through `org.apache.geode.cache.GemFireCache.getJNDIContext`. For example: ``` pre Context ctx = cache.getJNDIContext(); @@ -215,7 +220,7 @@ To run a global transaction, perform the following steps: 3. Configure Geode for any necessary transactional behavior. Enable `copy-on-read` for your cache and specify a transaction listener, if you need one. See [Setting Global Copy on Read](working_with_transactions.html#concept_vx2_gs4_5k) and [Configuring Transaction Plug-In Event Handlers](working_with_transactions.html#concept_ocw_vf1_wk) for details. 4. Make sure that JTA transactions are not disabled in the `cache.xml` file or the application code. 5. Initialize the Geode cache. -6. Get an initial context through `org.apache.geode.cache.Cache.getJNDIContext`. For example: +6. Get an initial context through `org.apache.geode.cache.GemFireCache.getJNDIContext`. For example: ``` pre Context ctx = cache.getJNDIContext(); http://git-wip-us.apache.org/r
[geode] Git Push Summary
Repository: geode Updated Branches: refs/heads/feature/GEODE-2654 [created] a561bd122
[01/18] geode git commit: GEODE-2980: remove unnecessary explicit keywords from interfaces [Forced Update!]
Repository: geode Updated Branches: refs/heads/feature/GEODE-2980 7c7b577eb -> f7396e4c7 (forced update) http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/redis/internal/Executor.java -- diff --git a/geode-core/src/main/java/org/apache/geode/redis/internal/Executor.java b/geode-core/src/main/java/org/apache/geode/redis/internal/Executor.java index 7698535..55bc132 100755 --- a/geode-core/src/main/java/org/apache/geode/redis/internal/Executor.java +++ b/geode-core/src/main/java/org/apache/geode/redis/internal/Executor.java @@ -29,6 +29,6 @@ public interface Executor { * @param command The command to be executed * @param context The execution context by which this command is to be executed */ - public void executeCommand(Command command, ExecutionHandlerContext context); + void executeCommand(Command command, ExecutionHandlerContext context); } http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/redis/internal/Extendable.java -- diff --git a/geode-core/src/main/java/org/apache/geode/redis/internal/Extendable.java b/geode-core/src/main/java/org/apache/geode/redis/internal/Extendable.java index ed36030..8da78e5 100644 --- a/geode-core/src/main/java/org/apache/geode/redis/internal/Extendable.java +++ b/geode-core/src/main/java/org/apache/geode/redis/internal/Extendable.java @@ -26,6 +26,6 @@ public interface Extendable { * * @return Error string */ - public String getArgsError(); + String getArgsError(); } http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/security/AuthInitialize.java -- diff --git a/geode-core/src/main/java/org/apache/geode/security/AuthInitialize.java b/geode-core/src/main/java/org/apache/geode/security/AuthInitialize.java index 6b0675a..6e05600 100644 --- a/geode-core/src/main/java/org/apache/geode/security/AuthInitialize.java +++ b/geode-core/src/main/java/org/apache/geode/security/AuthInitialize.java @@ -48,14 +48,13 @@ public interface AuthInitialize extends CacheCallback { * @deprecated since Geode 1.0, use init() */ @Deprecated - public void init(LogWriter systemLogger, LogWriter securityLogger) - throws AuthenticationFailedException; + void init(LogWriter systemLogger, LogWriter securityLogger) throws AuthenticationFailedException; /** * @since Geode 1.0. implement this method instead of init with logwriters. Implementation should *use log4j instead of these loggers. */ - public default void init() { + default void init() { InternalCache cache = GemFireCacheImpl.getInstance(); init(cache.getLogger(), cache.getSecurityLogger()); } @@ -86,8 +85,8 @@ public interface AuthInitialize extends CacheCallback { * all members, peer/client will use the same credentials. */ @Deprecated - public Properties getCredentials(Properties securityProps, DistributedMember server, - boolean isPeer) throws AuthenticationFailedException; + Properties getCredentials(Properties securityProps, DistributedMember server, boolean isPeer) + throws AuthenticationFailedException; /** * Implement this since Geode1.0 http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/test/java/org/apache/geode/cache/management/ResourceManagerDUnitTest.java -- diff --git a/geode-core/src/test/java/org/apache/geode/cache/management/ResourceManagerDUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache/management/ResourceManagerDUnitTest.java index 13643ec..6aec6d6 100644 --- a/geode-core/src/test/java/org/apache/geode/cache/management/ResourceManagerDUnitTest.java +++ b/geode-core/src/test/java/org/apache/geode/cache/management/ResourceManagerDUnitTest.java @@ -754,8 +754,8 @@ public class ResourceManagerDUnitTest extends JUnit4CacheTestCase { } } - private static interface OpDuringBucketRemove extends java.io.Serializable { -public void runit(PartitionedRegion pr, Object key, Object value); + private interface OpDuringBucketRemove extends java.io.Serializable { +void runit(PartitionedRegion pr, Object key, Object value); } private void doOpDuringBucketRemove(final OpDuringBucketRemove op) { http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/test/java/org/apache/geode/cache/query/functional/GroupByTestInterface.java -- diff --git a/geode-core/src/test/java/org/apache/geode/cache/query/functional/GroupByTestInterface.java b/geode-core/src/test/java/org/apache/geode/cache/query/functional/GroupByTestInterface.java in
[08/18] geode git commit: GEODE-2980: remove unnecessary explicit keywords from interfaces
http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/internal/SerializationVersions.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/SerializationVersions.java b/geode-core/src/main/java/org/apache/geode/internal/SerializationVersions.java index f906108..3fe3e69 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/SerializationVersions.java +++ b/geode-core/src/main/java/org/apache/geode/internal/SerializationVersions.java @@ -32,6 +32,6 @@ public interface SerializationVersions { * The method name is formed with the version's product name and its major, minor, release and * patch numbers. */ - public Version[] getSerializationVersions(); + Version[] getSerializationVersions(); } http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/internal/VersionedDataStream.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/VersionedDataStream.java b/geode-core/src/main/java/org/apache/geode/internal/VersionedDataStream.java index 7b0ab43..470a9f3 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/VersionedDataStream.java +++ b/geode-core/src/main/java/org/apache/geode/internal/VersionedDataStream.java @@ -39,5 +39,5 @@ public interface VersionedDataStream { * {@link Version}, then this member cannot do any adjustment to serialization and its the remote * peer's responsibility to adjust the serialization/deserialization according to this peer. */ - public Version getVersion(); + Version getVersion(); } http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/internal/admin/AdminBridgeServer.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/AdminBridgeServer.java b/geode-core/src/main/java/org/apache/geode/internal/admin/AdminBridgeServer.java index 17ebe44..a0f6f45 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/admin/AdminBridgeServer.java +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/AdminBridgeServer.java @@ -25,5 +25,5 @@ public interface AdminBridgeServer extends CacheServer { /** * Returns the VM-unique id of this cache server */ - public int getId(); + int getId(); } http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/internal/admin/Alert.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/Alert.java b/geode-core/src/main/java/org/apache/geode/internal/admin/Alert.java index e628c4a..b07783f 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/admin/Alert.java +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/Alert.java @@ -25,24 +25,24 @@ import org.apache.geode.internal.logging.InternalLogWriter; */ public interface Alert { /** The level at which this alert is issued */ - public int getLevel(); + int getLevel(); /** The member of the distributed system that issued the alert */ - public GemFireVM getGemFireVM(); + GemFireVM getGemFireVM(); /** * The name of the GemFireConnection through which the alert was issued. */ - public String getConnectionName(); + String getConnectionName(); /** The id of the source of the alert (such as a thread in a VM) */ - public String getSourceId(); + String getSourceId(); /** The alert's message */ - public String getMessage(); + String getMessage(); /** The time at which the alert was issued */ - public java.util.Date getDate(); + java.util.Date getDate(); /** * Returns a InternalDistributedMember instance representing a member that is sending (or has @@ -53,16 +53,16 @@ public interface Alert { * * @since GemFire 6.5 */ - public InternalDistributedMember getSender(); + InternalDistributedMember getSender(); - public final static int ALL = InternalLogWriter.ALL_LEVEL; - public final static int OFF = InternalLogWriter.NONE_LEVEL; - public final static int FINEST = InternalLogWriter.FINEST_LEVEL; - public final static int FINER = InternalLogWriter.FINER_LEVEL; - public final static int FINE = InternalLogWriter.FINE_LEVEL; - public final static int CONFIG = InternalLogWriter.CONFIG_LEVEL; - public final static int INFO = InternalLogWriter.INFO_LEVEL; - public final static int WARNING = InternalLogWriter.WARNING_LEVEL; - public final static int ERROR = InternalLogWriter.ERROR_LEVEL; - public final static int SEVERE = InternalLogWriter.SEVERE_LEVEL; + int ALL = InternalLogWriter.ALL_LEVEL; + int OFF = InternalLogWriter.NONE_LEVEL; + int FINEST = InternalLogWriter.FINEST_LEVEL; + int FINER = InternalLo
[02/18] geode git commit: GEODE-2980: remove unnecessary explicit keywords from interfaces
http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/management/cli/ConverterHint.java -- diff --git a/geode-core/src/main/java/org/apache/geode/management/cli/ConverterHint.java b/geode-core/src/main/java/org/apache/geode/management/cli/ConverterHint.java index 9c32559..4e1a1b2 100644 --- a/geode-core/src/main/java/org/apache/geode/management/cli/ConverterHint.java +++ b/geode-core/src/main/java/org/apache/geode/management/cli/ConverterHint.java @@ -23,26 +23,25 @@ import org.springframework.shell.core.annotation.CliOption; * @since GemFire 8.0 */ public interface ConverterHint { - public static final String DISABLE_STRING_CONVERTER = ":disable-string-converter"; - public static final String DISKSTORE = - "geode.converter.cluster.diskstore" + DISABLE_STRING_CONVERTER; - public static final String FILE = "geode.converter.file"; - public static final String FILE_PATH = "geode.converter.file.path" + DISABLE_STRING_CONVERTER; - public static final String HINT = "geode.converter.hint" + DISABLE_STRING_CONVERTER; - public static final String HELP = "geode.converter.help" + DISABLE_STRING_CONVERTER; - public static final String MEMBERGROUP = "geode.converter.member.groups"; + String DISABLE_STRING_CONVERTER = ":disable-string-converter"; + String DISKSTORE = "geode.converter.cluster.diskstore" + DISABLE_STRING_CONVERTER; + String FILE = "geode.converter.file"; + String FILE_PATH = "geode.converter.file.path" + DISABLE_STRING_CONVERTER; + String HINT = "geode.converter.hint" + DISABLE_STRING_CONVERTER; + String HELP = "geode.converter.help" + DISABLE_STRING_CONVERTER; + String MEMBERGROUP = "geode.converter.member.groups"; /** Hint to be used for all types of GemFire cluster members */ - public static final String ALL_MEMBER_IDNAME = "geode.converter.all.member.idOrName"; + String ALL_MEMBER_IDNAME = "geode.converter.all.member.idOrName"; /** Hint to be used for all non locator GemFire cluster members */ - public static final String MEMBERIDNAME = "geode.converter.member.idOrName"; + String MEMBERIDNAME = "geode.converter.member.idOrName"; /** Hint to be used for GemFire stand-alone locator members */ - public static final String LOCATOR_MEMBER_IDNAME = "geode.converter.locatormember.idOrName"; + String LOCATOR_MEMBER_IDNAME = "geode.converter.locatormember.idOrName"; /** Hint to be used for configured locators for discovery */ - public static final String LOCATOR_DISCOVERY_CONFIG = "geode.converter.locators.discovery.config"; - public static final String REGION_PATH = "geode.converter.region.path" + DISABLE_STRING_CONVERTER; - public static final String INDEX_TYPE = "geode.converter.index.type"; - public static final String GATEWAY_SENDER_ID = "geode.converter.gateway.senderid"; - public static final String GATEWAY_RECEIVER_ID = "geode.converter.gateway.receiverid"; - public static final String LOG_LEVEL = "geode.converter.log.levels" + DISABLE_STRING_CONVERTER; + String LOCATOR_DISCOVERY_CONFIG = "geode.converter.locators.discovery.config"; + String REGION_PATH = "geode.converter.region.path" + DISABLE_STRING_CONVERTER; + String INDEX_TYPE = "geode.converter.index.type"; + String GATEWAY_SENDER_ID = "geode.converter.gateway.senderid"; + String GATEWAY_RECEIVER_ID = "geode.converter.gateway.receiverid"; + String LOG_LEVEL = "geode.converter.log.levels" + DISABLE_STRING_CONVERTER; } http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/management/cli/Result.java -- diff --git a/geode-core/src/main/java/org/apache/geode/management/cli/Result.java b/geode-core/src/main/java/org/apache/geode/management/cli/Result.java index 57f7c43..62b8c49 100755 --- a/geode-core/src/main/java/org/apache/geode/management/cli/Result.java +++ b/geode-core/src/main/java/org/apache/geode/management/cli/Result.java @@ -36,7 +36,7 @@ public interface Result { * * @since GemFire 7.0 */ - public enum Status { + enum Status { /** * Indicates that the command completed successfully. */ @@ -64,19 +64,19 @@ public interface Result { /** * Returns the status of a processed command. */ - public Status getStatus(); + Status getStatus(); /** * Resets the pointer to the first line in the Result. */ - public void resetToFirstLine(); + void resetToFirstLine(); /** * Returns whether the result has any more lines of information. * * @return True if there are more lines, false otherwise. */ - public boolean hasNextLine(); + boolean hasNextLine(); /** * Returns the next line of information from the Result. @@ -84,14 +84,14 @@ public interface Result { * @throws IndexOutOfBoundsException if this method is called more times than there are lines of *
[16/18] geode git commit: GEODE-2980: remove unnecessary explicit keywords from interfaces
http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/admin/SystemMemberCache.java -- diff --git a/geode-core/src/main/java/org/apache/geode/admin/SystemMemberCache.java b/geode-core/src/main/java/org/apache/geode/admin/SystemMemberCache.java index 8517fd0..5d16624 100644 --- a/geode-core/src/main/java/org/apache/geode/admin/SystemMemberCache.java +++ b/geode-core/src/main/java/org/apache/geode/admin/SystemMemberCache.java @@ -30,24 +30,24 @@ public interface SystemMemberCache { /** * The name of the cache. */ - public String getName(); + String getName(); /** * Value that uniquely identifies an instance of a cache for a given member. */ - public int getId(); + int getId(); /** * Indicates if this cache has been closed. * * @return true, if this cache is closed; false, otherwise */ - public boolean isClosed(); + boolean isClosed(); /** * Gets the number of seconds a cache operation will wait to obtain a distributed lock lease. */ - public int getLockTimeout(); + int getLockTimeout(); /** * Sets the number of seconds a cache operation may wait to obtain a distributed lock lease before @@ -57,12 +57,12 @@ public interface SystemMemberCache { * * @see org.apache.geode.cache.Cache#setLockTimeout */ - public void setLockTimeout(int seconds) throws AdminException; + void setLockTimeout(int seconds) throws AdminException; /** * Gets the length, in seconds, of distributed lock leases obtained by this cache. */ - public int getLockLease(); + int getLockLease(); /** * Sets the length, in seconds, of distributed lock leases obtained by this cache. @@ -71,7 +71,7 @@ public interface SystemMemberCache { * * @see org.apache.geode.cache.Cache#setLockLease */ - public void setLockLease(int seconds) throws AdminException; + void setLockLease(int seconds) throws AdminException; /** * Gets the number of seconds a cache {@link org.apache.geode.cache.Region#get(Object) get} @@ -79,7 +79,7 @@ public interface SystemMemberCache { * spent loading the object. When the search times out it causes the get to fail by throwing an * exception. */ - public int getSearchTimeout(); + int getSearchTimeout(); /** * Sets the number of seconds a cache get operation can spend searching for a value. @@ -88,25 +88,25 @@ public interface SystemMemberCache { * * @see org.apache.geode.cache.Cache#setSearchTimeout */ - public void setSearchTimeout(int seconds) throws AdminException; + void setSearchTimeout(int seconds) throws AdminException; /** * Returns number of seconds since this member's cache has been created. Returns -1 * if this member does not have a cache or its cache has been closed. */ - public int getUpTime(); + int getUpTime(); /** * Returns the names of all the root regions currently in this cache. */ - public java.util.Set getRootRegionNames(); + java.util.Set getRootRegionNames(); // operations /** * Returns statistics related to this cache's performance. */ - public Statistic[] getStatistics(); + Statistic[] getStatistics(); /** * Return the existing region (or subregion) with the specified path that already exists in the @@ -117,7 +117,7 @@ public interface SystemMemberCache { * @return the Region or null if not found * @throws IllegalArgumentException if path is null, the empty string, or "/" */ - public SystemMemberRegion getRegion(String path) throws AdminException; + SystemMemberRegion getRegion(String path) throws AdminException; /** * Creates a VM root Region in this cache. @@ -131,8 +131,7 @@ public interface SystemMemberCache { * @deprecated as of GemFire 5.0, use {@link #createRegion} instead */ @Deprecated - public SystemMemberRegion createVMRegion(String name, RegionAttributes attrs) - throws AdminException; + SystemMemberRegion createVMRegion(String name, RegionAttributes attrs) throws AdminException; /** * Creates a root Region in this cache. @@ -144,13 +143,13 @@ public interface SystemMemberCache { * * @since GemFire 5.0 */ - public SystemMemberRegion createRegion(String name, RegionAttributes attrs) throws AdminException; + SystemMemberRegion createRegion(String name, RegionAttributes attrs) throws AdminException; /** * Updates the state of this cache instance. Note that once a cache instance is closed refresh * will never change the state of that instance. */ - public void refresh(); + void refresh(); /** * Adds a new, unstarted cache server that will serve the contents of this cache to clients. @@ -159,7 +158,7 @@ public interface SystemMemberCache { * * @since GemFire 5.7 */ - public SystemMemberCacheServer addCacheServer() throws AdminException; +
[15/18] geode git commit: GEODE-2980: remove unnecessary explicit keywords from interfaces
http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/cache/AttributesMutator.java -- diff --git a/geode-core/src/main/java/org/apache/geode/cache/AttributesMutator.java b/geode-core/src/main/java/org/apache/geode/cache/AttributesMutator.java index 51301bc..b62262b 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/AttributesMutator.java +++ b/geode-core/src/main/java/org/apache/geode/cache/AttributesMutator.java @@ -38,7 +38,7 @@ public interface AttributesMutator { * * @return the Region this mutator affects */ - public Region getRegion(); + Region getRegion(); /** * Changes the timeToLive expiration attributes for the region as a whole @@ -49,7 +49,7 @@ public interface AttributesMutator { * LOCAL_INVALIDATE and the region is {@link DataPolicy#withReplication replicated} * @throws IllegalStateException if statistics are disabled for this region. */ - public ExpirationAttributes setRegionTimeToLive(ExpirationAttributes timeToLive); + ExpirationAttributes setRegionTimeToLive(ExpirationAttributes timeToLive); /** * Changes the idleTimeout expiration attributes for the region as a whole. Resets the @@ -61,7 +61,7 @@ public interface AttributesMutator { * LOCAL_INVALIDATE and the region is {@link DataPolicy#withReplication replicated} * @throws IllegalStateException if statistics are disabled for this region. */ - public ExpirationAttributes setRegionIdleTimeout(ExpirationAttributes idleTimeout); + ExpirationAttributes setRegionIdleTimeout(ExpirationAttributes idleTimeout); /** * Changes the timeToLive expiration attributes for values in this region. @@ -74,7 +74,7 @@ public interface AttributesMutator { * {@link DataPolicy#withReplication replicated} * @throws IllegalStateException if statistics are disabled for this region. */ - public ExpirationAttributes setEntryTimeToLive(ExpirationAttributes timeToLive); + ExpirationAttributes setEntryTimeToLive(ExpirationAttributes timeToLive); /** * Changes the custom timeToLive for values in this region @@ -82,7 +82,7 @@ public interface AttributesMutator { * @param custom the new CustomExpiry * @return the old CustomExpiry */ - public CustomExpiry setCustomEntryTimeToLive(CustomExpiry custom); + CustomExpiry setCustomEntryTimeToLive(CustomExpiry custom); /** * Changes the idleTimeout expiration attributes for values in the region. @@ -96,7 +96,7 @@ public interface AttributesMutator { * @see AttributesFactory#setStatisticsEnabled * @throws IllegalStateException if statistics are disabled for this region. */ - public ExpirationAttributes setEntryIdleTimeout(ExpirationAttributes idleTimeout); + ExpirationAttributes setEntryIdleTimeout(ExpirationAttributes idleTimeout); /** * Changes the CustomExpiry for idleTimeout for values in the region @@ -104,7 +104,7 @@ public interface AttributesMutator { * @param custom the new CustomExpiry * @return the old CustomExpiry */ - public CustomExpiry setCustomEntryIdleTimeout(CustomExpiry custom); + CustomExpiry setCustomEntryIdleTimeout(CustomExpiry custom); /** * Changes the CacheListener for the region. Removes listeners already added and calls @@ -117,7 +117,7 @@ public interface AttributesMutator { * instead. */ @Deprecated - public CacheListener setCacheListener(CacheListener aListener); + CacheListener setCacheListener(CacheListener aListener); /** * Adds a cache listener to the end of the list of cache listeners on this region. @@ -126,7 +126,7 @@ public interface AttributesMutator { * @throws IllegalArgumentException if aListener is null * @since GemFire 5.0 */ - public void addCacheListener(CacheListener aListener); + void addCacheListener(CacheListener aListener); /** * Removes a cache listener from the list of cache listeners on this region. Does nothing if the @@ -137,7 +137,7 @@ public interface AttributesMutator { * @throws IllegalArgumentException if aListener is null * @since GemFire 5.0 */ - public void removeCacheListener(CacheListener aListener); + void removeCacheListener(CacheListener aListener); /** * Removes all cache listeners, calling {@link CacheCallback#close} on each of them, and then adds @@ -147,7 +147,7 @@ public interface AttributesMutator { * @throws IllegalArgumentException if the newListeners array has a null element * @since GemFire 5.0 */ - public void initCacheListeners(CacheListener[] newListeners); + void initCacheListeners(CacheListener[] newListeners); /** * Changes the cache writer for the region. @@ -155,7 +155,7 @@ public interface AttributesMutator { * @param cacheWriter the cache writer * @return the previous CacheWriter */ - public CacheWriter setC
[05/18] geode git commit: GEODE-2980: remove unnecessary explicit keywords from interfaces
http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/internal/datasource/ConnectionPoolCache.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/datasource/ConnectionPoolCache.java b/geode-core/src/main/java/org/apache/geode/internal/datasource/ConnectionPoolCache.java index 823db71..dceaea7 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/datasource/ConnectionPoolCache.java +++ b/geode-core/src/main/java/org/apache/geode/internal/datasource/ConnectionPoolCache.java @@ -27,23 +27,23 @@ public interface ConnectionPoolCache { * @return Object - connection from the pool. * @throws PoolException */ - public Object getPooledConnectionFromPool() throws PoolException; + Object getPooledConnectionFromPool() throws PoolException; /** * This method will return the Pooled connection object back to the pool. * * @param connectionObject - Connection object returned to the pool. */ - public void returnPooledConnectionToPool(Object connectionObject); + void returnPooledConnectionToPool(Object connectionObject); /** * This method is used to set the time out for active connection so that it can be collected by * the cleaner thread Modified by Asif */ - public void expirePooledConnection(Object connectionObject); + void expirePooledConnection(Object connectionObject); /** * Clean up the resources before restart of Cache */ - public void clearUp(); + void clearUp(); } http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/internal/datasource/ConnectionProvider.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/datasource/ConnectionProvider.java b/geode-core/src/main/java/org/apache/geode/internal/datasource/ConnectionProvider.java index 8ec0d70..f5f5624 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/datasource/ConnectionProvider.java +++ b/geode-core/src/main/java/org/apache/geode/internal/datasource/ConnectionProvider.java @@ -25,22 +25,22 @@ public interface ConnectionProvider { * * @return a PooledConnection object to the user. */ - public Object borrowConnection() throws PoolException; + Object borrowConnection() throws PoolException; /** * Returns a PooledConnection object to the pool. * * @param connectionObject to be returned to the pool */ - public void returnConnection(Object connectionObject); + void returnConnection(Object connectionObject); /** * Closes a PooledConnection object . */ - public void returnAndExpireConnection(Object connectionObject); + void returnAndExpireConnection(Object connectionObject); /** * Clean up the resources before restart of Cache */ - public void clearUp(); + void clearUp(); } http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/internal/datasource/DataSourceResources.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/datasource/DataSourceResources.java b/geode-core/src/main/java/org/apache/geode/internal/datasource/DataSourceResources.java index 513ab31..0a8d934 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/datasource/DataSourceResources.java +++ b/geode-core/src/main/java/org/apache/geode/internal/datasource/DataSourceResources.java @@ -24,21 +24,21 @@ package org.apache.geode.internal.datasource; public interface DataSourceResources { /** Creates a new instance of DataSourceResources */ - public static final String JNDI_CONNECTION_POOL_DATA_SOURCE = "jdbc/ConnectionPoolDataSource"; + String JNDI_CONNECTION_POOL_DATA_SOURCE = "jdbc/ConnectionPoolDataSource"; /* Default limit of maximum number of connection in the connection pool */ - public static final int CONNECTION_POOL_DEFAULT_MAX_LIMIT = 30; + int CONNECTION_POOL_DEFAULT_MAX_LIMIT = 30; /* Default initial connection pool size */ - public static final int CONNECTION_POOL_DEFAULT_INIT_LIMIT = 10; + int CONNECTION_POOL_DEFAULT_INIT_LIMIT = 10; /* * Default time in seconds after which the connections in the available pool will expire */ - public static final int CONNECTION_POOL_DEFAULT_EXPIRATION_TIME = 600; + int CONNECTION_POOL_DEFAULT_EXPIRATION_TIME = 600; // Default time in seconds after which the connections in the active cache // will be destroyed */ - public static final int CONNECTION_POOL_DEFAULT_ACTIVE_TIME_OUT = 120; + int CONNECTION_POOL_DEFAULT_ACTIVE_TIME_OUT = 120; // Default time in seconds after which the client thread for // retrieving connection will experience timeout - public static final int CONNECTION_POOL_DEFAULT_CLIENT_TIME_OUT = 30; + int CONNECTION_
[09/18] geode git commit: GEODE-2980: remove unnecessary explicit keywords from interfaces
http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/JoinLeave.java -- diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/JoinLeave.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/JoinLeave.java index 636fb6e..250b000 100755 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/JoinLeave.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/JoinLeave.java @@ -41,7 +41,7 @@ public interface JoinLeave extends Service { * Invoked by the Manager, this notifies the HealthMonitor that a ShutdownMessage has been * received from the given member */ - public void memberShutdown(DistributedMember mbr, String reason); + void memberShutdown(DistributedMember mbr, String reason); /** * returns the local address http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/MessageHandler.java -- diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/MessageHandler.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/MessageHandler.java index 9fe39a5..f00aeaf 100755 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/MessageHandler.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/MessageHandler.java @@ -22,6 +22,6 @@ import org.apache.geode.distributed.internal.DistributionMessage; */ public interface MessageHandler { - public void processMessage(DistributionMessage m); + void processMessage(DistributionMessage m); } http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/HasMemberID.java -- diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/HasMemberID.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/HasMemberID.java index 0dccd6c..291ccc8 100755 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/HasMemberID.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/HasMemberID.java @@ -18,6 +18,6 @@ import org.apache.geode.distributed.internal.membership.InternalDistributedMembe public interface HasMemberID { - public InternalDistributedMember getMemberID(); + InternalDistributedMember getMemberID(); } http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/i18n/LogWriterI18n.java -- diff --git a/geode-core/src/main/java/org/apache/geode/i18n/LogWriterI18n.java b/geode-core/src/main/java/org/apache/geode/i18n/LogWriterI18n.java index fd7d331..b0bc9ef 100644 --- a/geode-core/src/main/java/org/apache/geode/i18n/LogWriterI18n.java +++ b/geode-core/src/main/java/org/apache/geode/i18n/LogWriterI18n.java @@ -79,302 +79,302 @@ public interface LogWriterI18n { /** * @return true if "severe" log messages are enabled. */ - public boolean severeEnabled(); + boolean severeEnabled(); /** * Writes an exception to this writer. The exception level is "severe". */ - public void severe(Throwable ex); + void severe(Throwable ex); /** * Writes both a message and exception to this writer. The message level is "severe". * * @since GemFire 6.0 */ - public void severe(StringId msgID, Object[] params, Throwable ex); + void severe(StringId msgID, Object[] params, Throwable ex); /** * Writes both a message and exception to this writer. The message level is "severe". * * @since GemFire 6.0 */ - public void severe(StringId msgID, Object param, Throwable ex); + void severe(StringId msgID, Object param, Throwable ex); /** * Writes both a message and exception to this writer. The message level is "severe". * * @since GemFire 6.0 */ - public void severe(StringId msgID, Throwable ex); + void severe(StringId msgID, Throwable ex); /** * Writes a message to this writer. The message level is "severe". * * @since GemFire 6.0 */ - public void severe(StringId msgID, Object[] params); + void severe(StringId msgID, Object[] params); /** * Writes a message to this writer. The message level is "severe". * * @since GemFire 6.0 */ - public voi
[17/18] geode git commit: GEODE-2980: remove unnecessary explicit keywords from interfaces
http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/StatisticsTypeFactory.java -- diff --git a/geode-core/src/main/java/org/apache/geode/StatisticsTypeFactory.java b/geode-core/src/main/java/org/apache/geode/StatisticsTypeFactory.java index d37e2c2..ee9a2ff 100644 --- a/geode-core/src/main/java/org/apache/geode/StatisticsTypeFactory.java +++ b/geode-core/src/main/java/org/apache/geode/StatisticsTypeFactory.java @@ -95,83 +95,83 @@ public interface StatisticsTypeFactory { * name, description, units, and with larger values * indicating better performance. */ - public StatisticDescriptor createIntCounter(String name, String description, String units); + StatisticDescriptor createIntCounter(String name, String description, String units); /** * Creates and returns a long counter {@link StatisticDescriptor} with the given * name, description, units, and with larger values * indicating better performance. */ - public StatisticDescriptor createLongCounter(String name, String description, String units); + StatisticDescriptor createLongCounter(String name, String description, String units); /** * Creates and returns a double counter {@link StatisticDescriptor} with the given * name, description, units, and with larger values * indicating better performance. */ - public StatisticDescriptor createDoubleCounter(String name, String description, String units); + StatisticDescriptor createDoubleCounter(String name, String description, String units); /** * Creates and returns an int gauge {@link StatisticDescriptor} with the given name, * description, units, and with smaller values indicating better * performance. */ - public StatisticDescriptor createIntGauge(String name, String description, String units); + StatisticDescriptor createIntGauge(String name, String description, String units); /** * Creates and returns a long gauge {@link StatisticDescriptor} with the given name, * description, units, and with smaller values indicating better * performance. */ - public StatisticDescriptor createLongGauge(String name, String description, String units); + StatisticDescriptor createLongGauge(String name, String description, String units); /** * Creates and returns a double gauge {@link StatisticDescriptor} with the given * name, description, units, and with smaller values * indicating better performance. */ - public StatisticDescriptor createDoubleGauge(String name, String description, String units); + StatisticDescriptor createDoubleGauge(String name, String description, String units); /** * Creates and returns an int counter {@link StatisticDescriptor} with the given * name, description, largerBetter, and units. */ - public StatisticDescriptor createIntCounter(String name, String description, String units, + StatisticDescriptor createIntCounter(String name, String description, String units, boolean largerBetter); /** * Creates and returns a long counter {@link StatisticDescriptor} with the given * name, description, largerBetter, and units. */ - public StatisticDescriptor createLongCounter(String name, String description, String units, + StatisticDescriptor createLongCounter(String name, String description, String units, boolean largerBetter); /** * Creates and returns a double counter {@link StatisticDescriptor} with the given * name, description, largerBetter, and units. */ - public StatisticDescriptor createDoubleCounter(String name, String description, String units, + StatisticDescriptor createDoubleCounter(String name, String description, String units, boolean largerBetter); /** * Creates and returns an int gauge {@link StatisticDescriptor} with the given name, * description, largerBetter, and units. */ - public StatisticDescriptor createIntGauge(String name, String description, String units, + StatisticDescriptor createIntGauge(String name, String description, String units, boolean largerBetter); /** * Creates and returns a long gauge {@link StatisticDescriptor} with the given name, * description, largerBetter, and units. */ - public StatisticDescriptor createLongGauge(String name, String description, String units, + StatisticDescriptor createLongGauge(String name, String description, String units, boolean largerBetter); /** * Creates and returns a double gauge {@link StatisticDescriptor} with the given * name, description, largerBetter, and units. */ - public StatisticDescriptor createDoubleGauge(String name, String description, String units, + StatisticDescriptor createDoubleGauge(String name, String description, String units, boolean largerBetter); @@ -180,7 +180,7 @@ pub
[18/18] geode git commit: GEODE-2980: remove unnecessary explicit keywords from interfaces
GEODE-2980: remove unnecessary explicit keywords from interfaces All the methods in an interface are implicitly public and abstract. All fields in the interface are implicitly public, static and final. Removing this from all the interface. This closes #529 Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/f7396e4c Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/f7396e4c Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/f7396e4c Branch: refs/heads/feature/GEODE-2980 Commit: f7396e4c72068b89549f92eee778e8e607b872e3 Parents: 65471c1 Author: Avinash Authored: Tue May 23 09:25:02 2017 +0530 Committer: Kirk Lund Committed: Wed Jun 14 11:38:43 2017 -0700 -- .../session/internal/common/SessionCache.java | 12 +- .../session/internal/filter/SessionManager.java | 20 +- .../filter/attributes/SessionAttributes.java| 24 +- .../internal/jmx/SessionStatisticsMXBean.java |6 +- .../modules/gatewaydelta/GatewayDelta.java |6 +- .../modules/gatewaydelta/GatewayDeltaEvent.java |2 +- .../modules/session/catalina/SessionCache.java | 36 +- .../session/catalina/SessionManager.java| 26 +- .../internal/DeltaSessionAttributeEvent.java|2 +- .../apache/geode/modules/session/Callback.java |2 +- .../annotations/ExperimentalJUnitTest.java |4 +- .../java/org/apache/geode/DataSerializable.java |8 +- .../main/java/org/apache/geode/LogWriter.java | 74 +- .../org/apache/geode/StatisticDescriptor.java | 14 +- .../main/java/org/apache/geode/Statistics.java | 98 +- .../org/apache/geode/StatisticsFactory.java | 18 +- .../java/org/apache/geode/StatisticsType.java | 10 +- .../org/apache/geode/StatisticsTypeFactory.java | 32 +- .../geode/admin/AdminDistributedSystem.java | 94 +- .../main/java/org/apache/geode/admin/Alert.java | 12 +- .../org/apache/geode/admin/AlertListener.java |2 +- .../apache/geode/admin/CacheHealthConfig.java | 24 +- .../org/apache/geode/admin/CacheServer.java |4 +- .../apache/geode/admin/CacheServerConfig.java |8 +- .../java/org/apache/geode/admin/CacheVm.java|2 +- .../org/apache/geode/admin/CacheVmConfig.java |8 +- .../geode/admin/ConfigurationParameter.java | 24 +- .../geode/admin/DistributedSystemConfig.java| 142 +-- .../admin/DistributedSystemHealthConfig.java|6 +- .../apache/geode/admin/DistributionLocator.java |4 +- .../geode/admin/DistributionLocatorConfig.java | 12 +- .../org/apache/geode/admin/GemFireHealth.java | 30 +- .../apache/geode/admin/GemFireHealthConfig.java |8 +- .../org/apache/geode/admin/ManagedEntity.java | 12 +- .../apache/geode/admin/ManagedEntityConfig.java | 20 +- .../apache/geode/admin/MemberHealthConfig.java | 24 +- .../java/org/apache/geode/admin/Statistic.java | 10 +- .../apache/geode/admin/StatisticResource.java | 14 +- .../org/apache/geode/admin/SystemMember.java| 36 +- .../geode/admin/SystemMemberBridgeServer.java | 60 +- .../apache/geode/admin/SystemMemberCache.java | 39 +- .../geode/admin/SystemMemberCacheEvent.java |2 +- .../geode/admin/SystemMemberCacheListener.java |8 +- .../geode/admin/SystemMemberCacheServer.java| 60 +- .../apache/geode/admin/SystemMemberRegion.java | 93 +- .../geode/admin/SystemMemberRegionEvent.java|2 +- .../geode/admin/SystemMembershipEvent.java |4 +- .../geode/admin/SystemMembershipListener.java |6 +- .../ConfigurationParameterListener.java |2 +- .../admin/internal/InternalManagedEntity.java | 26 +- .../admin/internal/ManagedEntityController.java | 12 +- .../java/org/apache/geode/admin/jmx/Agent.java | 26 +- .../org/apache/geode/admin/jmx/AgentConfig.java | 216 ++-- .../admin/jmx/internal/ManagedResource.java | 14 +- .../jmx/internal/RMIRegistryServiceMBean.java | 14 +- .../jmx/internal/StatAlertsAggregator.java | 20 +- .../admin/jmx/internal/SystemMemberJmx.java | 43 +- .../apache/geode/cache/AttributesMutator.java | 40 +- .../org/apache/geode/cache/CacheCallback.java |2 +- .../java/org/apache/geode/cache/CacheEvent.java | 12 +- .../org/apache/geode/cache/CacheListener.java | 18 +- .../org/apache/geode/cache/CacheLoader.java |2 +- .../org/apache/geode/cache/CacheStatistics.java | 12 +- .../geode/cache/CacheTransactionManager.java| 42 +- .../org/apache/geode/cache/CacheWriter.java | 10 +- .../org/apache/geode/cache/ClientSession.java | 18 +- .../org/apache/geode/cache/CustomExpiry.java|2 +- .../java/org/apache/geode/cache/Declarable.java |2 +- .../java/org/apache/geode/cache/DiskStore.java | 38 +- .../apache/geode/cache/DiskStoreFactory.java| 50 +- .../apache/geode/cache/DiskWriteAttributes.java
[14/18] geode git commit: GEODE-2980: remove unnecessary explicit keywords from interfaces
http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/cache/Region.java -- diff --git a/geode-core/src/main/java/org/apache/geode/cache/Region.java b/geode-core/src/main/java/org/apache/geode/cache/Region.java index 61f2c81..2968afd 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/Region.java +++ b/geode-core/src/main/java/org/apache/geode/cache/Region.java @@ -142,10 +142,10 @@ import org.apache.geode.cache.snapshot.RegionSnapshotService; public interface Region extends ConcurrentMap { /** The region name separator character. */ - public static final char SEPARATOR_CHAR = '/'; + char SEPARATOR_CHAR = '/'; /** The region name separator character, represented as a string for convenience. */ - public static final String SEPARATOR = "/"; + String SEPARATOR = "/"; /** * Returns the name of this region. A region's name can be any non-empty String providing it does @@ -156,7 +156,7 @@ public interface Region extends ConcurrentMap { * * @return the name of this region */ - public String getName(); + String getName(); /** * Returns the full path of this region starting with a forward slash, followed by the root, @@ -166,7 +166,7 @@ public interface Region extends ConcurrentMap { * * @return the full path of this region */ - public String getFullPath(); + String getFullPath(); /** * Gets the parent region of this region. If this region is a root region, returns null. @@ -176,7 +176,7 @@ public interface Region extends ConcurrentMap { * @return the parent region which contains this region; null, if this region is the root region * @see Region#createSubregion(String, RegionAttributes) createSubregion */ - public Region getParentRegion(); + Region getParentRegion(); /** * Returns the RegionAttributes for this region. This object is backed by this @@ -191,7 +191,7 @@ public interface Region extends ConcurrentMap { * @see AttributesFactory * @see #getAttributesMutator */ - public RegionAttributes getAttributes(); + RegionAttributes getAttributes(); /** @@ -201,7 +201,7 @@ public interface Region extends ConcurrentMap { * @return the AttributesMutator object * @see #getAttributes */ - public AttributesMutator getAttributesMutator(); + AttributesMutator getAttributesMutator(); /** * Returns the CacheStatistics for this region. @@ -210,7 +210,7 @@ public interface Region extends ConcurrentMap { * @throws StatisticsDisabledException if statistics have been disabled for this region * @throws UnsupportedOperationException If the region is a partitioned region */ - public CacheStatistics getStatistics() throws StatisticsDisabledException; + CacheStatistics getStatistics() throws StatisticsDisabledException; /** * Invalidates this region. Invalidation cascades to all entries and subregions. After the @@ -225,7 +225,7 @@ public interface Region extends ConcurrentMap { * @throws TimeoutException if timed out getting distributed lock for Scope.GLOBAL * @see CacheListener#afterRegionInvalidate */ - public void invalidateRegion() throws TimeoutException; + void invalidateRegion() throws TimeoutException; /** * Invalidates this region. The invalidation will cascade to all the subregions and cached @@ -244,7 +244,7 @@ public interface Region extends ConcurrentMap { * @throws IllegalArgumentException if aCallbackArgument is not serializable * @see CacheListener#afterRegionInvalidate */ - public void invalidateRegion(Object aCallbackArgument) throws TimeoutException; + void invalidateRegion(Object aCallbackArgument) throws TimeoutException; @@ -260,7 +260,7 @@ public interface Region extends ConcurrentMap { * @throws UnsupportedOperationException If the region is a partitioned region * @see CacheListener#afterRegionInvalidate */ - public void localInvalidateRegion(); + void localInvalidateRegion(); /** * Invalidates this region in the local cache only, and provides a user-defined argument to the @@ -278,7 +278,7 @@ public interface Region extends ConcurrentMap { * @see CacheListener#afterRegionInvalidate */ - public void localInvalidateRegion(Object aCallbackArgument); + void localInvalidateRegion(Object aCallbackArgument); /** @@ -297,7 +297,7 @@ public interface Region extends ConcurrentMap { * @see CacheListener#afterRegionDestroy * @see CacheWriter#beforeRegionDestroy */ - public void destroyRegion() throws CacheWriterException, TimeoutException; + void destroyRegion() throws CacheWriterException, TimeoutException; /** * Destroys the whole region and provides a user-defined parameter object to any @@ -319,7 +319,7 @@ public interface Region extends ConcurrentMap { * @see CacheListener#afterRegionDestroy * @see CacheWri
[04/18] geode git commit: GEODE-2980: remove unnecessary explicit keywords from interfaces
http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/internal/sequencelog/SequenceLogger.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/sequencelog/SequenceLogger.java b/geode-core/src/main/java/org/apache/geode/internal/sequencelog/SequenceLogger.java index 530737f..c4a8b3b 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/sequencelog/SequenceLogger.java +++ b/geode-core/src/main/java/org/apache/geode/internal/sequencelog/SequenceLogger.java @@ -46,10 +46,10 @@ public interface SequenceLogger { * @param source the source, for example ("member 1, region 1"); * @param dest the destination, for example ("member 2, region 1"); */ - public void logTransition(GraphType type, Object graphName, Object edgeName, Object state, - Object source, Object dest); + void logTransition(GraphType type, Object graphName, Object edgeName, Object state, Object source, + Object dest); - public boolean isEnabled(GraphType type); + boolean isEnabled(GraphType type); - public void flush() throws InterruptedException; + void flush() throws InterruptedException; } http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/internal/sequencelog/io/Filter.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/sequencelog/io/Filter.java b/geode-core/src/main/java/org/apache/geode/internal/sequencelog/io/Filter.java index e4d630c..0bbda18 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/sequencelog/io/Filter.java +++ b/geode-core/src/main/java/org/apache/geode/internal/sequencelog/io/Filter.java @@ -23,10 +23,9 @@ import org.apache.geode.internal.sequencelog.GraphType; */ public interface Filter { - public boolean accept(GraphType graphType, String name, String edgeName, String source, - String dest); + boolean accept(GraphType graphType, String name, String edgeName, String source, String dest); - public boolean acceptPattern(GraphType graphType, Pattern pattern, String edgeName, String source, + boolean acceptPattern(GraphType graphType, Pattern pattern, String edgeName, String source, String dest); } http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/internal/sequencelog/model/GraphReaderCallback.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/sequencelog/model/GraphReaderCallback.java b/geode-core/src/main/java/org/apache/geode/internal/sequencelog/model/GraphReaderCallback.java index a1abd96..b644677 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/sequencelog/model/GraphReaderCallback.java +++ b/geode-core/src/main/java/org/apache/geode/internal/sequencelog/model/GraphReaderCallback.java @@ -23,10 +23,10 @@ import org.apache.geode.internal.sequencelog.GraphType; */ public interface GraphReaderCallback { - public abstract void addEdge(long timestamp, GraphType graphType, String graphName, - String edgeName, String state, String source, String dest); + void addEdge(long timestamp, GraphType graphType, String graphName, String edgeName, String state, + String source, String dest); - public abstract void addEdgePattern(long timestamp, GraphType graphType, Pattern graphNamePattern, + void addEdgePattern(long timestamp, GraphType graphType, Pattern graphNamePattern, String edgeName, String state, String source, String dest); } http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/internal/shared/NativeCalls.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/shared/NativeCalls.java b/geode-core/src/main/java/org/apache/geode/internal/shared/NativeCalls.java index 238abcf..c20a5ef 100755 --- a/geode-core/src/main/java/org/apache/geode/internal/shared/NativeCalls.java +++ b/geode-core/src/main/java/org/apache/geode/internal/shared/NativeCalls.java @@ -431,12 +431,12 @@ public abstract class NativeCalls { * * @since GemFire 8.0 */ - public static interface RehashServerOnSIGHUP { + public interface RehashServerOnSIGHUP { /** * Perform the actions required to "rehash" the server. */ -public void rehash(); +void rehash(); } /** http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/internal/shared/NativeCallsJNAImpl.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/shared/NativeCallsJNAImpl.java b/geode-core/src/main/java/org/apache/geode/internal/shared/NativeCa
[06/18] geode git commit: GEODE-2980: remove unnecessary explicit keywords from interfaces
http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/internal/cache/lru/LRUEntry.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/lru/LRUEntry.java b/geode-core/src/main/java/org/apache/geode/internal/cache/lru/LRUEntry.java index 53be97d..944bd66 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/lru/LRUEntry.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/lru/LRUEntry.java @@ -25,7 +25,7 @@ public interface LRUEntry extends LRUClockNode, RegionEntry { * If the key is stored as an Object then returns that object; but if the key is stored as * primitives then returns null. */ - public Object getKeyForSizing(); + Object getKeyForSizing(); - public void setDelayedDiskId(LocalRegion r); + void setDelayedDiskId(LocalRegion r); } http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/internal/cache/lru/LRUMapCallbacks.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/lru/LRUMapCallbacks.java b/geode-core/src/main/java/org/apache/geode/internal/cache/lru/LRUMapCallbacks.java index 0b1cc6f..7d8a24b 100755 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/lru/LRUMapCallbacks.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/lru/LRUMapCallbacks.java @@ -30,27 +30,27 @@ public interface LRUMapCallbacks { * is made. This will then perform the lru removals, or region.localDestroy() calls to make up for * the recent addition. */ - public void lruUpdateCallback(); + void lruUpdateCallback(); - public void lruUpdateCallback(int n); + void lruUpdateCallback(int n); /** * Disables lruUpdateCallback in calling thread * * @return false if it's already disabled */ - public boolean disableLruUpdateCallback(); + boolean disableLruUpdateCallback(); /** * Enables lruUpdateCallback in calling thread */ - public void enableLruUpdateCallback(); + void enableLruUpdateCallback(); /** * if an exception occurs between an LRUEntriesMap put and the call to lruUpdateCallback, then * this must be called to allow the thread to continue to work with other regions. */ - public void resetThreadLocals(); + void resetThreadLocals(); /** * Return true if the lru has exceeded its limit and needs to evict. Note that this method is @@ -58,12 +58,12 @@ public interface LRUMapCallbacks { * * @param drv the disk region whose limit is checked */ - public boolean lruLimitExceeded(DiskRegionView drv); + boolean lruLimitExceeded(DiskRegionView drv); - public void lruCloseStats(); + void lruCloseStats(); /** * Called when an entry is faulted in from disk. */ - public void lruEntryFaultIn(LRUEntry entry); + void lruEntryFaultIn(LRUEntry entry); } http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/internal/cache/lru/Sizeable.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/lru/Sizeable.java b/geode-core/src/main/java/org/apache/geode/internal/cache/lru/Sizeable.java index 27a3c50..b2672cf 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/lru/Sizeable.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/lru/Sizeable.java @@ -49,12 +49,12 @@ package org.apache.geode.internal.cache.lru; public interface Sizeable { /** The overhead of an object in the VM in bytes */ - public static final int PER_OBJECT_OVERHEAD = 8; // TODO for a 64bit jvm with small oops this is - // 12; for other 64bit jvms it is 16 + int PER_OBJECT_OVERHEAD = 8; // TODO for a 64bit jvm with small oops this is + // 12; for other 64bit jvms it is 16 /** * Returns the size (in bytes) of this object including the {@link #PER_OBJECT_OVERHEAD}. */ - public int getSizeInBytes(); + int getSizeInBytes(); } http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/Bucket.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/Bucket.java b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/Bucket.java index 9c31697..2a087fe 100755 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/Bucket.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/Bucket.java @@ -30,31 +30,31 @@ public interface Bucket extends CacheDistributionAdvisee { /** * Returns the distribution and meta
[03/18] geode git commit: GEODE-2980: remove unnecessary explicit keywords from interfaces
http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/management/DistributedSystemMXBean.java -- diff --git a/geode-core/src/main/java/org/apache/geode/management/DistributedSystemMXBean.java b/geode-core/src/main/java/org/apache/geode/management/DistributedSystemMXBean.java index f6f701e..3e116fb 100644 --- a/geode-core/src/main/java/org/apache/geode/management/DistributedSystemMXBean.java +++ b/geode-core/src/main/java/org/apache/geode/management/DistributedSystemMXBean.java @@ -81,17 +81,17 @@ public interface DistributedSystemMXBean { * @return The DistributedSystem ID or -1 if not set. */ @ResourceOperation() - public int getDistributedSystemId(); + int getDistributedSystemId(); /** * Returns the number of members in the distributed system. */ - public int getMemberCount(); + int getMemberCount(); /** * Returns a list of names for all members. */ - public String[] listMembers(); + String[] listMembers(); /** * Returns a list of names for locator members. @@ -101,49 +101,49 @@ public interface DistributedSystemMXBean { * @return a list of names for locator members. */ - public String[] listLocatorMembers(boolean onlyStandAloneLocators); + String[] listLocatorMembers(boolean onlyStandAloneLocators); /** * Returns a list of names for all groups. */ - public String[] listGroups(); + String[] listGroups(); /** * Returns the number of locators in the distributed system. */ - public int getLocatorCount(); + int getLocatorCount(); /** * Returns a list of IDs for all locators. */ - public String[] listLocators(); // TODO - Abhishek Should be renamed to - // listLocatorDiscoveryConfigurations? Do we need something for - // mcast too? + String[] listLocators(); // TODO - Abhishek Should be renamed to + // listLocatorDiscoveryConfigurations? Do we need something for + // mcast too? /** * Returns the number of disks stores in the distributed system. */ - public int getSystemDiskStoreCount(); + int getSystemDiskStoreCount(); /** * Returns a map of all {@link DistributedMember}s and their {@link DiskStore}s. */ - public Map listMemberDiskstore(); + Map listMemberDiskstore(); /** * Returns a list of IDs for all gateway senders. */ - public String[] listGatewaySenders(); + String[] listGatewaySenders(); /** * Returns a list of IDs for all gateway receivers. */ - public String[] listGatewayReceivers(); + String[] listGatewayReceivers(); /** * Returns the minimum level set for alerts to be delivered to listeners. */ - public String getAlertLevel(); + String getAlertLevel(); /** * Sets the minimum level for alerts to be delivered to listeners. @@ -152,74 +152,74 @@ public interface DistributedSystemMXBean { *SEVERE or NONE. */ @ResourceOperation(resource = Resource.CLUSTER, operation = Operation.WRITE) - public void changeAlertLevel(String alertLevel) throws Exception; + void changeAlertLevel(String alertLevel) throws Exception; /** * Returns the total available heap (in megabytes) across all distributed members. */ - public long getTotalHeapSize(); + long getTotalHeapSize(); /** * Returns the total number of entries in all regions. */ - public long getTotalRegionEntryCount(); + long getTotalRegionEntryCount(); /** * Returns the number of {@link Region}s. */ - public int getTotalRegionCount(); + int getTotalRegionCount(); /** * Returns the number of times that a cache miss occurred for all regions. */ - public int getTotalMissCount(); + int getTotalMissCount(); /** * Returns the number of times that a hit occurred for all regions. */ - public int getTotalHitCount(); + int getTotalHitCount(); /** * Returns the number of connected clients. */ - public int getNumClients(); + int getNumClients(); /** * Returns the average number of disk reads per second across all distributed members. */ - public float getDiskReadsRate(); + float getDiskReadsRate(); /** * Returns the average number of disk writes per second across all distributed members. */ - public float getDiskWritesRate(); + float getDiskWritesRate(); /** * Returns the average disk flush latency time. */ - public long getDiskFlushAvgLatency(); + long getDiskFlushAvgLatency(); /** * Returns the number of backups currently in progress for all disk stores. */ - public int getTotalBackupInProgress(); + int getTotalBackupInProgress(); /** * Returns the number of initial images in progress. */ - public int getNumInitialImagesInProgress(); + int getNumInitialImag
[13/18] geode git commit: GEODE-2980: remove unnecessary explicit keywords from interfaces
http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/cache/client/ClientRegionFactory.java -- diff --git a/geode-core/src/main/java/org/apache/geode/cache/client/ClientRegionFactory.java b/geode-core/src/main/java/org/apache/geode/cache/client/ClientRegionFactory.java index dab476a..1b327cb 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/client/ClientRegionFactory.java +++ b/geode-core/src/main/java/org/apache/geode/cache/client/ClientRegionFactory.java @@ -65,7 +65,7 @@ public interface ClientRegionFactory { * @throws IllegalArgumentException if aListener is null * @see AttributesFactory#addCacheListener */ - public ClientRegionFactory addCacheListener(CacheListener aListener); + ClientRegionFactory addCacheListener(CacheListener aListener); /** * Removes all cache listeners and then adds each listener in the specified array. for the next @@ -76,7 +76,7 @@ public interface ClientRegionFactory { * @throws IllegalArgumentException if the newListeners array has a null element * @see AttributesFactory#initCacheListeners */ - public ClientRegionFactory initCacheListeners(CacheListener[] newListeners); + ClientRegionFactory initCacheListeners(CacheListener[] newListeners); /** * Sets the eviction attributes that controls growth of the Region to be created. @@ -84,7 +84,7 @@ public interface ClientRegionFactory { * @param evictionAttributes for the Region to create * @return a reference to this ClientRegionFactory object */ - public ClientRegionFactory setEvictionAttributes(EvictionAttributes evictionAttributes); + ClientRegionFactory setEvictionAttributes(EvictionAttributes evictionAttributes); /** * Sets the idleTimeout expiration attributes for region entries for the next @@ -95,7 +95,7 @@ public interface ClientRegionFactory { * @throws IllegalArgumentException if idleTimeout is null * @see AttributesFactory#setEntryIdleTimeout */ - public ClientRegionFactory setEntryIdleTimeout(ExpirationAttributes idleTimeout); + ClientRegionFactory setEntryIdleTimeout(ExpirationAttributes idleTimeout); /** * Sets the custom idleTimeout for the next RegionAttributes created. @@ -104,7 +104,7 @@ public interface ClientRegionFactory { * @return the receiver * @see AttributesFactory#setCustomEntryIdleTimeout(CustomExpiry) */ - public ClientRegionFactory setCustomEntryIdleTimeout(CustomExpiry custom); + ClientRegionFactory setCustomEntryIdleTimeout(CustomExpiry custom); /** * Sets the timeToLive expiration attributes for region entries for the next @@ -115,7 +115,7 @@ public interface ClientRegionFactory { * @throws IllegalArgumentException if timeToLive is null * @see AttributesFactory#setEntryTimeToLive */ - public ClientRegionFactory setEntryTimeToLive(ExpirationAttributes timeToLive); + ClientRegionFactory setEntryTimeToLive(ExpirationAttributes timeToLive); /** * Sets the custom timeToLive expiration method for the next RegionAttributes @@ -125,7 +125,7 @@ public interface ClientRegionFactory { * @return the receiver * @see AttributesFactory#setCustomEntryTimeToLive(CustomExpiry) */ - public ClientRegionFactory setCustomEntryTimeToLive(CustomExpiry custom); + ClientRegionFactory setCustomEntryTimeToLive(CustomExpiry custom); /** * Sets the idleTimeout expiration attributes for the region itself for the next @@ -136,7 +136,7 @@ public interface ClientRegionFactory { * @throws IllegalArgumentException if idleTimeout is null * @see AttributesFactory#setRegionIdleTimeout */ - public ClientRegionFactory setRegionIdleTimeout(ExpirationAttributes idleTimeout); + ClientRegionFactory setRegionIdleTimeout(ExpirationAttributes idleTimeout); /** * Sets the timeToLive expiration attributes for the region itself for the next @@ -147,7 +147,7 @@ public interface ClientRegionFactory { * @throws IllegalArgumentException if timeToLive is null * @see AttributesFactory#setRegionTimeToLive */ - public ClientRegionFactory setRegionTimeToLive(ExpirationAttributes timeToLive); + ClientRegionFactory setRegionTimeToLive(ExpirationAttributes timeToLive); /** * Sets the key constraint for the next RegionAttributes created. Keys in the region @@ -160,7 +160,7 @@ public interface ClientRegionFactory { * type * @see AttributesFactory#setKeyConstraint */ - public ClientRegionFactory setKeyConstraint(Class keyConstraint); + ClientRegionFactory setKeyConstraint(Class keyConstraint); /** * Sets the value constraint for the next RegionAttributes created. Values in the @@ -173,7 +173,7 @@ public interface ClientRegionFactory { * primitive type * @see AttributesFactory#setValueConstraint */ - public ClientRegionFactory setValueConstraint(Class valu
[10/18] geode git commit: GEODE-2980: remove unnecessary explicit keywords from interfaces
http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/distributed/internal/DMStats.java -- diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/DMStats.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/DMStats.java index 6397c06..b2a7134 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/DMStats.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/DMStats.java @@ -24,539 +24,539 @@ public interface DMStats { /** * Returns the total number of messages sent by the distribution manager */ - public long getSentMessages(); + long getSentMessages(); /** * Increments the total number of messages sent by the distribution manager */ - public void incSentMessages(long messages); + void incSentMessages(long messages); - public void incTOSentMsg(); + void incTOSentMsg(); /** * Returns the total number of transaction commit messages sent by the distribution manager */ - public long getSentCommitMessages(); + long getSentCommitMessages(); /** * Increments the total number of transaction commit messages sent by the distribution manager */ - public void incSentCommitMessages(long messages); + void incSentCommitMessages(long messages); /** * Returns the total number commits that had to wait for an ack before completion. */ - public long getCommitWaits(); + long getCommitWaits(); /** * Increments the number of commit waits by one. */ - public void incCommitWaits(); + void incCommitWaits(); /** * Returns the total number of nanoseconds spent sending messages. */ - public long getSentMessagesTime(); + long getSentMessagesTime(); /** * Increments the total number of nanoseconds spent sending messages. */ - public void incSentMessagesTime(long nanos); + void incSentMessagesTime(long nanos); /** * Returns the total number of messages broadcast by the distribution manager */ - public long getBroadcastMessages(); + long getBroadcastMessages(); /** * Increments the total number of messages broadcast by the distribution manager */ - public void incBroadcastMessages(long messages); + void incBroadcastMessages(long messages); /** * Returns the total number of nanoseconds spent sending messages. */ - public long getBroadcastMessagesTime(); + long getBroadcastMessagesTime(); /** * Increments the total number of nanoseconds spend sending messages. */ - public void incBroadcastMessagesTime(long nanos); + void incBroadcastMessagesTime(long nanos); /** * Returns the total number of messages received by the distribution manager */ - public long getReceivedMessages(); + long getReceivedMessages(); /** * Increments the total number of messages received by the distribution manager */ - public void incReceivedMessages(long messages); + void incReceivedMessages(long messages); /** * Returns the total number of message bytes received by the distribution manager */ - public long getReceivedBytes(); + long getReceivedBytes(); /** * Increments the total number of message bytes received by the distribution manager */ - public void incReceivedBytes(long bytes); + void incReceivedBytes(long bytes); /** * Increments the total number of message bytes sent by the distribution manager */ - public void incSentBytes(long bytes); + void incSentBytes(long bytes); /** * Returns the total number of messages processed by the distribution manager */ - public long getProcessedMessages(); + long getProcessedMessages(); /** * Increments the total number of messages processed by the distribution manager */ - public void incProcessedMessages(long messages); + void incProcessedMessages(long messages); /** * Returns the total number of nanoseconds spent processing messages. */ - public long getProcessedMessagesTime(); + long getProcessedMessagesTime(); /** * Increments the total number of nanoseconds spent processing messages. */ - public void incProcessedMessagesTime(long nanos); + void incProcessedMessagesTime(long nanos); /** * Returns the total number of nanoseconds spent scheduling messages to be processed. */ - public long getMessageProcessingScheduleTime(); + long getMessageProcessingScheduleTime(); - public void incBatchSendTime(long start); + void incBatchSendTime(long start); - public void incBatchCopyTime(long start); + void incBatchCopyTime(long start); - public void incBatchWaitTime(long start); + void incBatchWaitTime(long start); - public void incBatchFlushTime(long start); + void incBatchFlushTime(long start); /** * Increments the total number of nanoseconds spent scheduling messages to be p
[11/18] geode git commit: GEODE-2980: remove unnecessary explicit keywords from interfaces
http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/cache/server/CacheServer.java -- diff --git a/geode-core/src/main/java/org/apache/geode/cache/server/CacheServer.java b/geode-core/src/main/java/org/apache/geode/cache/server/CacheServer.java index bd00170..ed9db5d 100755 --- a/geode-core/src/main/java/org/apache/geode/cache/server/CacheServer.java +++ b/geode-core/src/main/java/org/apache/geode/cache/server/CacheServer.java @@ -37,7 +37,7 @@ public interface CacheServer { /** * The default port on which a CacheServer is configured to serve. */ - public static final int DEFAULT_PORT = 40404; + int DEFAULT_PORT = 40404; /** * The default number of sockets accepted by a CacheServer. When the maximum is reached the cache @@ -45,7 +45,7 @@ public interface CacheServer { * * @since GemFire 5.7 */ - public static final int DEFAULT_MAX_CONNECTIONS = 800; + int DEFAULT_MAX_CONNECTIONS = 800; // Value derived from common file descriptor limits for Unix sytems (1024)... /** @@ -58,35 +58,35 @@ public interface CacheServer { * * @since GemFire 5.7 */ - public static final int DEFAULT_MAX_THREADS = 0; + int DEFAULT_MAX_THREADS = 0; /** * The default notify-by-subscription value which tells the CacheServer whether or * not to notify clients based on key subscription. */ - public static final boolean DEFAULT_NOTIFY_BY_SUBSCRIPTION = true; + boolean DEFAULT_NOTIFY_BY_SUBSCRIPTION = true; /** * The default socket buffer size for socket buffers from the cache server to the client. */ - public static final int DEFAULT_SOCKET_BUFFER_SIZE = 32768; + int DEFAULT_SOCKET_BUFFER_SIZE = 32768; /** * The default maximum amount of time between client pings. This value is used by the * ClientHealthMonitor to determine the health of this CacheServer's * clients. */ - public static final int DEFAULT_MAXIMUM_TIME_BETWEEN_PINGS = 6; + int DEFAULT_MAXIMUM_TIME_BETWEEN_PINGS = 6; /** * The default maximum number of messages that can be enqueued in a client-queue. */ - public static final int DEFAULT_MAXIMUM_MESSAGE_COUNT = 23; + int DEFAULT_MAXIMUM_MESSAGE_COUNT = 23; /** * The default time (in seconds ) after which a message in the client queue will expire. */ - public static final int DEFAULT_MESSAGE_TIME_TO_LIVE = 180; + int DEFAULT_MESSAGE_TIME_TO_LIVE = 180; /** * The default list of server groups a cache server belongs to. The current default is an empty @@ -95,7 +95,7 @@ public interface CacheServer { * @since GemFire 5.7 * @deprecated as of 7.0 use the groups gemfire property */ - public static final String[] DEFAULT_GROUPS = new String[0]; + String[] DEFAULT_GROUPS = new String[0]; /** * The default load balancing probe. The default load balancing probe reports the connections @@ -104,7 +104,7 @@ public interface CacheServer { * @since GemFire 5.7 * */ - public static final ServerLoadProbe DEFAULT_LOAD_PROBE = new ConnectionCountProbe(); + ServerLoadProbe DEFAULT_LOAD_PROBE = new ConnectionCountProbe(); /** * The default frequency at which to poll the load probe for the load on this cache server. @@ -112,7 +112,7 @@ public interface CacheServer { * * @since GemFire 5.7 */ - public static final long DEFAULT_LOAD_POLL_INTERVAL = 5000; + long DEFAULT_LOAD_POLL_INTERVAL = 5000; /** * The default ip address or host name that the cache server's socket will listen on for client @@ -120,7 +120,7 @@ public interface CacheServer { * * @since GemFire 5.7 */ - public static final String DEFAULT_BIND_ADDRESS = ""; + String DEFAULT_BIND_ADDRESS = ""; /** * The default ip address or host name that will be given to clients as the host this cache server @@ -128,24 +128,24 @@ public interface CacheServer { * * @since GemFire 5.7 */ - public static final String DEFAULT_HOSTNAME_FOR_CLIENTS = ""; + String DEFAULT_HOSTNAME_FOR_CLIENTS = ""; /** * The default setting for outgoing tcp/ip connections. By default the product enables tcpNoDelay. */ - public static final boolean DEFAULT_TCP_NO_DELAY = true; + boolean DEFAULT_TCP_NO_DELAY = true; /** * Returns the port on which this cache server listens for clients. */ - public int getPort(); + int getPort(); /** * Sets the port on which this cache server listens for clients. * * @throws IllegalStateException If this cache server is running */ - public void setPort(int port); + void setPort(int port); /** * Returns a string representing the ip address or host name that this cache server will listen @@ -155,7 +155,7 @@ public interface CacheServer { * @see #DEFAULT_BIND_ADDRESS * @since GemFire 5.7 */ - public String getBindA
[12/18] geode git commit: GEODE-2980: remove unnecessary explicit keywords from interfaces
http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/cache/partition/PartitionRegionInfo.java -- diff --git a/geode-core/src/main/java/org/apache/geode/cache/partition/PartitionRegionInfo.java b/geode-core/src/main/java/org/apache/geode/cache/partition/PartitionRegionInfo.java index bd189cf..03dc2fe 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/partition/PartitionRegionInfo.java +++ b/geode-core/src/main/java/org/apache/geode/cache/partition/PartitionRegionInfo.java @@ -36,7 +36,7 @@ public interface PartitionRegionInfo { * * @return the full path of the partitioned region that this info describes */ - public String getRegionPath(); + String getRegionPath(); /** * Returns an immutable set of PartitionMemberInfo representing every member that is @@ -44,7 +44,7 @@ public interface PartitionRegionInfo { * * @return set of member info configured for storage space */ - public Set getPartitionMemberInfo(); + Set getPartitionMemberInfo(); /** * Returns the {@link org.apache.geode.cache.PartitionAttributes#getTotalNumBuckets() configured @@ -52,7 +52,7 @@ public interface PartitionRegionInfo { * * @return the configured number of buckets */ - public int getConfiguredBucketCount(); + int getConfiguredBucketCount(); /** * Returns the number of actual buckets that have been created to hold data for the partitioned @@ -60,7 +60,7 @@ public interface PartitionRegionInfo { * * @return the current number of actual buckets that have been created */ - public int getCreatedBucketCount(); + int getCreatedBucketCount(); /** * Returns the number of created buckets that have fewer than the @@ -70,7 +70,7 @@ public interface PartitionRegionInfo { * @return the number of created buckets that have fewer than the configured redundant copies * @see #getActualRedundantCopies() */ - public int getLowRedundancyBucketCount(); + int getLowRedundancyBucketCount(); /** * Returns the number of {@link org.apache.geode.cache.PartitionAttributes#getRedundantCopies() @@ -78,7 +78,7 @@ public interface PartitionRegionInfo { * * @return the number of redundant copies the partitioned region was configured for */ - public int getConfiguredRedundantCopies(); + int getConfiguredRedundantCopies(); /** * Returns the lowest number of redundant copies for any bucket holding data for the partitioned @@ -87,7 +87,7 @@ public interface PartitionRegionInfo { * * @return the lowest number of redundant copies for any bucket of the partitioned region. */ - public int getActualRedundantCopies(); + int getActualRedundantCopies(); /** * Returns the {@link org.apache.geode.cache.Region#getFullPath() full path} of the partitioned @@ -98,5 +98,5 @@ public interface PartitionRegionInfo { * @return the full path of the partitioned region that the region is colocated with or null if * there is none. */ - public String getColocatedWith(); + String getColocatedWith(); } http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/cache/persistence/PersistentID.java -- diff --git a/geode-core/src/main/java/org/apache/geode/cache/persistence/PersistentID.java b/geode-core/src/main/java/org/apache/geode/cache/persistence/PersistentID.java index 7cfbc82..5db8155 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/persistence/PersistentID.java +++ b/geode-core/src/main/java/org/apache/geode/cache/persistence/PersistentID.java @@ -39,17 +39,17 @@ public interface PersistentID extends DataSerializable { /** * The host on which the persistent data was last residing */ - public abstract InetAddress getHost(); + InetAddress getHost(); /** * The directory which the persistent data was last residing in. */ - public abstract String getDirectory(); + String getDirectory(); /** * The unique identifier for the persistent data. * * @since GemFire 7.0 */ - public abstract UUID getUUID(); + UUID getUUID(); } http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/cache/query/Aggregator.java -- diff --git a/geode-core/src/main/java/org/apache/geode/cache/query/Aggregator.java b/geode-core/src/main/java/org/apache/geode/cache/query/Aggregator.java index 38de60d..140193d 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/query/Aggregator.java +++ b/geode-core/src/main/java/org/apache/geode/cache/query/Aggregator.java @@ -27,16 +27,16 @@ public interface Aggregator { * * @param value */ - public void accumulate(Object value); + void accumulate(Object valu
[07/18] geode git commit: GEODE-2980: remove unnecessary explicit keywords from interfaces
http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/internal/cache/Oplog.java -- 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 7bf1a9d..6338eef 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 @@ -7334,40 +7334,40 @@ public class Oplog implements CompactableOplog, Flushable { * Used as the value in the regionMap. Tracks information about what the region has in this oplog. */ public interface DiskRegionInfo { -public DiskRegionView getDiskRegion(); +DiskRegionView getDiskRegion(); -public int addLiveEntriesToList(KRFEntry[] liveEntries, int idx); +int addLiveEntriesToList(KRFEntry[] liveEntries, int idx); -public void addLive(DiskEntry de); +void addLive(DiskEntry de); -public void update(DiskEntry entry); +void update(DiskEntry entry); -public void replaceLive(DiskEntry old, DiskEntry de); +void replaceLive(DiskEntry old, DiskEntry de); -public boolean rmLive(DiskEntry de, Oplog oplog); +boolean rmLive(DiskEntry de, Oplog oplog); -public DiskEntry getNextLiveEntry(); +DiskEntry getNextLiveEntry(); -public void setDiskRegion(DiskRegionView dr); +void setDiskRegion(DiskRegionView dr); -public long clear(RegionVersionVector rvv); +long clear(RegionVersionVector rvv); /** * Return true if we are the first guy to set it to true */ -public boolean testAndSetUnrecovered(); +boolean testAndSetUnrecovered(); -public boolean getUnrecovered(); +boolean getUnrecovered(); /** * Return true if we are the first guy to set it to false */ -public boolean testAndSetRecovered(DiskRegionView dr); +boolean testAndSetRecovered(DiskRegionView dr); /** * Callback to indicate that this oplog has created a krf. */ -public void afterKrfCreated(); +void afterKrfCreated(); } public abstract static class AbstractDiskRegionInfo implements DiskRegionInfo { http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/internal/cache/OplogSet.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/OplogSet.java b/geode-core/src/main/java/org/apache/geode/internal/cache/OplogSet.java index 73c2677..24d9194 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/OplogSet.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/OplogSet.java @@ -19,11 +19,11 @@ import org.apache.geode.internal.cache.DiskEntry.Helper.ValueWrapper; public interface OplogSet { - public void create(LocalRegion region, DiskEntry entry, ValueWrapper value, boolean async); + void create(LocalRegion region, DiskEntry entry, ValueWrapper value, boolean async); - public void modify(LocalRegion region, DiskEntry entry, ValueWrapper value, boolean async); + void modify(LocalRegion region, DiskEntry entry, ValueWrapper value, boolean async); - public CompactableOplog getChild(long oplogId); + CompactableOplog getChild(long oplogId); - public void remove(LocalRegion region, DiskEntry entry, boolean async, boolean isClear); + void remove(LocalRegion region, DiskEntry entry, boolean async, boolean isClear); } http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/internal/cache/PRHARedundancyProvider.java -- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/PRHARedundancyProvider.java b/geode-core/src/main/java/org/apache/geode/internal/cache/PRHARedundancyProvider.java index f8e2108..946e16c 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/PRHARedundancyProvider.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/PRHARedundancyProvider.java @@ -809,11 +809,11 @@ public class PRHARedundancyProvider { /** * Test observer to help reproduce #42429. */ - public static interface EndBucketCreationObserver { + public interface EndBucketCreationObserver { -public void afterEndBucketCreationMessageSend(PartitionedRegion pr, int bucketId); +void afterEndBucketCreationMessageSend(PartitionedRegion pr, int bucketId); -public void afterEndBucketCreation(PartitionedRegion pr, int bucketId); +void afterEndBucketCreation(PartitionedRegion pr, int bucketId); } public void endBucketCreationLocally(int bucketId, InternalDistributedMember newPrimary) { http://git-wip-us.apache.org/repos/asf/geode/blob/f7396e4c/geode-core/src/main/java/org/apache/geode/internal/cache/Part
[geode] Git Push Summary
Repository: geode Updated Branches: refs/heads/feature/GEODE-2858 [deleted] 25d02710a
[geode] Git Push Summary
Repository: geode Updated Branches: refs/heads/feature/GEODE-2765 [deleted] 333d26c1d
[geode] Git Push Summary
Repository: geode Updated Branches: refs/heads/feature/GEODE-3050 [deleted] b0718f5da
[geode] Git Push Summary
Repository: geode Updated Branches: refs/heads/feature/GEODE-2648 [deleted] d01db82c2
[geode] Git Push Summary
Repository: geode Updated Branches: refs/heads/feature/GEODE-2420 [deleted] 925e37078
geode git commit: GEODE-3060: Introduce JUnit rule for testing the fully-assembled GFSH
Repository: geode Updated Branches: refs/heads/develop b616e80d1 -> d9869ffd5 GEODE-3060: Introduce JUnit rule for testing the fully-assembled GFSH Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/d9869ffd Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/d9869ffd Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/d9869ffd Branch: refs/heads/develop Commit: d9869ffd5b317c9e577f3ee2107a8d4bf46a166d Parents: b616e80 Author: Jared Stewart Authored: Wed Jun 7 20:44:56 2017 -0700 Committer: Jared Stewart Committed: Wed Jun 14 11:18:36 2017 -0700 -- .../cli/commands/StatusLocatorRealGfshTest.java | 50 .../geode/test/dunit/rules/gfsh/GfshRule.java | 116 + .../geode/test/dunit/rules/gfsh/GfshScript.java | 124 +++ 3 files changed, 290 insertions(+) -- http://git-wip-us.apache.org/repos/asf/geode/blob/d9869ffd/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/commands/StatusLocatorRealGfshTest.java -- diff --git a/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/commands/StatusLocatorRealGfshTest.java b/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/commands/StatusLocatorRealGfshTest.java new file mode 100644 index 000..82ee240 --- /dev/null +++ b/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/commands/StatusLocatorRealGfshTest.java @@ -0,0 +1,50 @@ +/* + * 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.management.internal.cli.commands; + +import org.apache.geode.test.dunit.rules.gfsh.GfshRule; +import org.apache.geode.test.dunit.rules.gfsh.GfshScript; +import org.apache.geode.test.junit.categories.DistributedTest; +import org.apache.geode.test.junit.categories.IntegrationTest; +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import java.io.File; +import java.util.concurrent.TimeUnit; + +@Category(DistributedTest.class) +public class StatusLocatorRealGfshTest { + @Rule + public GfshRule gfshRule = new GfshRule(); + + @Test + public void statusLocatorSucceedsWhenConnected() throws Exception { +gfshRule.execute(GfshScript.of("start locator --name=locator1").awaitAtMost(1, TimeUnit.MINUTES) +.expectExitCode(0)); + +gfshRule.execute(GfshScript.of("connect", "status locator --name=locator1") +.awaitAtMost(1, TimeUnit.MINUTES).expectExitCode(0)); + } + + @Test + public void statusLocatorFailsWhenNotConnected() throws Exception { +gfshRule.execute(GfshScript.of("start locator --name=locator1").awaitAtMost(1, TimeUnit.MINUTES) +.expectExitCode(0)); + +gfshRule.execute(GfshScript.of("status locator --name=locator1") +.awaitAtMost(1, TimeUnit.MINUTES).expectExitCode(1)); + } +} http://git-wip-us.apache.org/repos/asf/geode/blob/d9869ffd/geode-assembly/src/test/java/org/apache/geode/test/dunit/rules/gfsh/GfshRule.java -- diff --git a/geode-assembly/src/test/java/org/apache/geode/test/dunit/rules/gfsh/GfshRule.java b/geode-assembly/src/test/java/org/apache/geode/test/dunit/rules/gfsh/GfshRule.java new file mode 100644 index 000..8109377 --- /dev/null +++ b/geode-assembly/src/test/java/org/apache/geode/test/dunit/rules/gfsh/GfshRule.java @@ -0,0 +1,116 @@ +/* + * 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
[geode] Git Push Summary
Repository: geode Updated Branches: refs/heads/feature/GEODE-3062 [deleted] 443ff8aeb
[geode] Git Push Summary
Repository: geode Updated Branches: refs/heads/feature/GEODE-2632 [deleted] 407afd93f
[geode] Git Push Summary
Repository: geode Updated Branches: refs/heads/feature/GEODE-290 [deleted] 3877313ca
[geode] Git Push Summary
Repository: geode Updated Branches: refs/heads/feature/GEODE-2558 [deleted] c3859b986
[geode] Git Push Summary
Repository: geode Updated Branches: refs/heads/feature/GEODE-2632-8 [deleted] 6cf3badf1
[geode] Git Push Summary
Repository: geode Updated Branches: refs/heads/feature/GEODE-2632-7 [deleted] b403bdc73
[geode] Git Push Summary
Repository: geode Updated Branches: refs/heads/feature/GEODE-2632-6 [deleted] 9abb33737
[geode] Git Push Summary
Repository: geode Updated Branches: refs/heads/feature/GEODE-2632-6-1 [deleted] b605f5d3d
[geode] Git Push Summary
Repository: geode Updated Branches: refs/heads/feature/GEODE-2632-5 [deleted] 222ebf722
[geode] Git Push Summary
Repository: geode Updated Branches: refs/heads/feature/GEODE-2632-21 [deleted] 7efe37d0e
[geode] Git Push Summary
Repository: geode Updated Branches: refs/heads/feature/GEODE-2632-17 [deleted] 283215f9f
[geode] Git Push Summary
Repository: geode Updated Branches: refs/heads/feature/GEODE-2632-3 [deleted] c03218b7d
[geode] Git Push Summary
Repository: geode Updated Branches: refs/heads/feature/GEODE-2632-19 [deleted] b8d211f44
[geode] Git Push Summary
Repository: geode Updated Branches: refs/heads/feature/GEODE-2632-4 [deleted] 08106d330
[geode] Git Push Summary
Repository: geode Updated Branches: refs/heads/feature/GEODE-2632-20 [deleted] f051e803e
[geode] Git Push Summary
Repository: geode Updated Branches: refs/heads/feature/GEODE-2632-18 [deleted] e10c182bc
[geode] Git Push Summary
Repository: geode Updated Branches: refs/heads/feature/GEODE-2632-15 [deleted] 654d65b54
[geode] Git Push Summary
Repository: geode Updated Branches: refs/heads/feature/GEODE-2632-16 [deleted] 2a6959573