Skip to content

Commit

Permalink
GEODE-7630: Resolve depencency on OSProcess. (apache#4548)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ernie Burghardt authored Dec 31, 2019
1 parent 36cb801 commit af5a044
Show file tree
Hide file tree
Showing 311 changed files with 913 additions and 870 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import org.apache.geode.cache.CacheFactory;
import org.apache.geode.cache.EntryNotFoundException;
import org.apache.geode.cache.control.ResourceManager;
import org.apache.geode.distributed.internal.DistributionConfig;
import org.apache.geode.internal.cache.GemFireCacheImpl;
import org.apache.geode.modules.session.bootstrap.AbstractCache;
import org.apache.geode.modules.session.bootstrap.ClientServerCache;
Expand All @@ -48,6 +47,7 @@
import org.apache.geode.modules.session.internal.filter.util.TypeAwareMap;
import org.apache.geode.modules.session.internal.jmx.SessionStatistics;
import org.apache.geode.modules.util.RegionHelper;
import org.apache.geode.util.internal.GeodeGlossary;

/**
* This class implements the session management using a Gemfire distributedCache as a persistent
Expand All @@ -60,12 +60,12 @@ public class GemfireSessionManager implements SessionManager {
/**
* Prefix of init param string used to set gemfire properties
*/
private static final String GEMFIRE_PROPERTY = DistributionConfig.GEMFIRE_PREFIX + "property.";
private static final String GEMFIRE_PROPERTY = GeodeGlossary.GEMFIRE_PREFIX + "property.";

/**
* Prefix of init param string used to set gemfire distributedCache setting
*/
private static final String GEMFIRE_CACHE = DistributionConfig.GEMFIRE_PREFIX + "cache.";
private static final String GEMFIRE_CACHE = GeodeGlossary.GEMFIRE_PREFIX + "cache.";

private static final String INIT_PARAM_CACHE_TYPE = "cache-type";
private static final String CACHE_TYPE_CLIENT_SERVER = "client-server";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@
import org.junit.runner.RunWith;

import org.apache.geode.cache.Region;
import org.apache.geode.distributed.internal.DistributionConfig;
import org.apache.geode.modules.session.filter.SessionCachingFilter;
import org.apache.geode.modules.session.junit.PerTestClassLoaderRunner;
import org.apache.geode.test.junit.categories.SessionTest;
import org.apache.geode.util.internal.GeodeGlossary;

/**
* In-container testing using Jetty. This allows us to test context listener events as well as
Expand Down Expand Up @@ -92,8 +92,8 @@ public void setUp() throws Exception {

filterHolder =
tester.addFilter(SessionCachingFilter.class, "/*", EnumSet.of(DispatcherType.REQUEST));
filterHolder.setInitParameter(DistributionConfig.GEMFIRE_PREFIX + "property.mcast-port", "0");
filterHolder.setInitParameter(DistributionConfig.GEMFIRE_PREFIX + "property.log-file",
filterHolder.setInitParameter(GeodeGlossary.GEMFIRE_PREFIX + "property.mcast-port", "0");
filterHolder.setInitParameter(GeodeGlossary.GEMFIRE_PREFIX + "property.log-file",
gemfireLogFile.getAbsolutePath());
filterHolder.setInitParameter("cache-type", "peer-to-peer");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
import org.junit.Before;
import org.junit.experimental.categories.Category;

import org.apache.geode.distributed.internal.DistributionConfig;
import org.apache.geode.modules.session.filter.SessionCachingFilter;
import org.apache.geode.test.junit.categories.SessionTest;
import org.apache.geode.util.internal.GeodeGlossary;

/**
* This runs all tests with a local cache disabled
Expand All @@ -38,7 +38,7 @@ public void setUp() throws Exception {
WebMockObjectFactory factory = getWebMockObjectFactory();
MockFilterConfig config = factory.getMockFilterConfig();

config.setInitParameter(DistributionConfig.GEMFIRE_PREFIX + "property.mcast-port", "0");
config.setInitParameter(GeodeGlossary.GEMFIRE_PREFIX + "property.mcast-port", "0");
config.setInitParameter("cache-type", "peer-to-peer");

factory.getMockServletContext().setContextPath(CONTEXT_PATH);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
import org.junit.Before;
import org.junit.experimental.categories.Category;

import org.apache.geode.distributed.internal.DistributionConfig;
import org.apache.geode.modules.session.filter.SessionCachingFilter;
import org.apache.geode.test.junit.categories.SessionTest;
import org.apache.geode.util.internal.GeodeGlossary;

/**
* This runs all tests with a local cache enabled
Expand All @@ -38,9 +38,9 @@ public void setUp() throws Exception {
WebMockObjectFactory factory = getWebMockObjectFactory();
MockFilterConfig config = factory.getMockFilterConfig();

config.setInitParameter(DistributionConfig.GEMFIRE_PREFIX + "property.mcast-port", "0");
config.setInitParameter(GeodeGlossary.GEMFIRE_PREFIX + "property.mcast-port", "0");
config.setInitParameter("cache-type", "peer-to-peer");
config.setInitParameter(DistributionConfig.GEMFIRE_PREFIX + "cache.enable_local_cache", "true");
config.setInitParameter(GeodeGlossary.GEMFIRE_PREFIX + "cache.enable_local_cache", "true");

factory.getMockServletContext().setContextPath(CONTEXT_PATH);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.apache.geode.distributed.internal.DistributionConfig;
import org.apache.geode.modules.session.internal.filter.GemfireHttpSession;
import org.apache.geode.modules.session.internal.filter.GemfireSessionManager;
import org.apache.geode.modules.session.internal.filter.SessionManager;
import org.apache.geode.modules.session.internal.filter.attributes.DeltaQueuedSessionAttributes;
import org.apache.geode.modules.session.internal.filter.attributes.DeltaSessionAttributes;
import org.apache.geode.util.internal.GeodeGlossary;

/**
* Primary class which orchestrates everything. This is the class which gets configured in the
Expand Down Expand Up @@ -76,7 +76,7 @@ public class SessionCachingFilter implements Filter {
* Can be overridden during testing.
*/
private static final AtomicInteger started = new AtomicInteger(
Integer.getInteger(DistributionConfig.GEMFIRE_PREFIX + "override.session.manager.count", 1));
Integer.getInteger(GeodeGlossary.GEMFIRE_PREFIX + "override.session.manager.count", 1));

/**
* This latch ensures that at least one thread/instance has fired up the session manager before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import org.apache.geode.modules.util.Banner;
import org.apache.geode.modules.util.RegionHelper;
import org.apache.geode.modules.util.ResourceManagerValidator;
import org.apache.geode.util.internal.GeodeGlossary;

public abstract class AbstractCache {

Expand All @@ -57,7 +58,7 @@ public abstract class AbstractCache {
private static final float DEFAULT_CRITICAL_HEAP_PERCENTAGE =
ResourceManager.DEFAULT_CRITICAL_PERCENTAGE;

private static final String GEMFIRE_PREFIX = DistributionConfig.GEMFIRE_PREFIX;
private static final String GEMFIRE_PREFIX = GeodeGlossary.GEMFIRE_PREFIX;
private static final String DEFAULT_CACHE_XML_FILE =
DistributionConfig.DEFAULT_CACHE_XML_FILE.getName();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
*/
package org.apache.geode.management.internal.cli.commands;

import static org.apache.geode.distributed.internal.DistributionConfig.GEMFIRE_PREFIX;
import static org.apache.geode.management.cli.Result.Status.ERROR;
import static org.apache.geode.management.cli.Result.Status.OK;
import static org.apache.geode.management.internal.i18n.CliStrings.GROUP;
Expand All @@ -28,6 +27,7 @@
import static org.apache.geode.management.internal.i18n.CliStrings.STOP_LOCATOR__DIR;
import static org.apache.geode.management.internal.i18n.CliStrings.STOP_LOCATOR__MEMBER;
import static org.apache.geode.management.internal.i18n.CliStrings.STOP_SERVICE__GFSH_NOT_CONNECTED_ERROR_MESSAGE;
import static org.apache.geode.util.internal.GeodeGlossary.GEMFIRE_PREFIX;
import static org.assertj.core.api.Assertions.assertThat;

import java.io.File;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

import org.apache.geode.distributed.ConfigurationProperties;
import org.apache.geode.distributed.LocatorLauncher;
import org.apache.geode.distributed.internal.DistributionConfig;
import org.apache.geode.util.internal.GeodeGlossary;

public class StartLocatorCommandTest {

Expand Down Expand Up @@ -87,8 +87,8 @@ public void testLocatorCommandLineWithRestAPI() throws Exception {
expectedCommandLineElements.add(locatorLauncher.getMemberName().toLowerCase());
expectedCommandLineElements.add(String.format("--port=%1$d", locatorLauncher.getPort()));
expectedCommandLineElements
.add("-d" + DistributionConfig.GEMFIRE_PREFIX + "" + HTTP_SERVICE_PORT + "=" + "8089");
expectedCommandLineElements.add("-d" + DistributionConfig.GEMFIRE_PREFIX + ""
.add("-d" + GeodeGlossary.GEMFIRE_PREFIX + "" + HTTP_SERVICE_PORT + "=" + "8089");
expectedCommandLineElements.add("-d" + GeodeGlossary.GEMFIRE_PREFIX + ""
+ HTTP_SERVICE_BIND_ADDRESS + "=" + "localhost");

for (String commandLineElement : commandLineElements) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@

import org.apache.geode.distributed.ConfigurationProperties;
import org.apache.geode.distributed.ServerLauncher;
import org.apache.geode.distributed.internal.DistributionConfig;
import org.apache.geode.internal.lang.SystemUtils;
import org.apache.geode.pdx.PdxSerializer;
import org.apache.geode.util.internal.GeodeGlossary;

public class StartServerCommandTest {
private StartServerCommand serverCommands;
Expand Down Expand Up @@ -160,10 +160,10 @@ public void testCreateServerCommandLineWithRestAPI() throws Exception {
serverLauncher.getEvictionHeapPercentage()));

expectedCommandLineElements
.add("-d" + DistributionConfig.GEMFIRE_PREFIX + "" + START_DEV_REST_API + "=" + "true");
.add("-d" + GeodeGlossary.GEMFIRE_PREFIX + "" + START_DEV_REST_API + "=" + "true");
expectedCommandLineElements
.add("-d" + DistributionConfig.GEMFIRE_PREFIX + "" + HTTP_SERVICE_PORT + "=" + "8080");
expectedCommandLineElements.add("-d" + DistributionConfig.GEMFIRE_PREFIX + ""
.add("-d" + GeodeGlossary.GEMFIRE_PREFIX + "" + HTTP_SERVICE_PORT + "=" + "8080");
expectedCommandLineElements.add("-d" + GeodeGlossary.GEMFIRE_PREFIX + ""
+ HTTP_SERVICE_BIND_ADDRESS + "=" + "localhost");

for (String commandLineElement : commandLineElements) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* 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.util.internal;

public class GeodeGlossary {
/**
* The prefix used for Gemfire properties set through java system properties
*/
public static final String GEMFIRE_PREFIX = "gemfire.";
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package org.apache.geode.internal.io;
package org.apache.geode.util.internal;

import java.io.FilterOutputStream;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package org.apache.geode.internal.io;
package org.apache.geode.util.internal;

import java.io.PrintStream;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
import org.apache.geode.cache.server.CacheServer;
import org.apache.geode.cache30.CacheSerializableRunnable;
import org.apache.geode.cache30.ClientServerTestCase;
import org.apache.geode.distributed.internal.DistributionConfig;
import org.apache.geode.internal.AvailablePortHelper;
import org.apache.geode.internal.cache.DistributedRegion;
import org.apache.geode.internal.cache.GemFireCacheImpl;
Expand All @@ -83,6 +82,7 @@
import org.apache.geode.test.dunit.ThreadUtils;
import org.apache.geode.test.dunit.VM;
import org.apache.geode.test.junit.categories.OQLQueryTest;
import org.apache.geode.util.internal.GeodeGlossary;

@Category({OQLQueryTest.class})
public class ResourceManagerWithQueryMonitorDUnitTest extends ClientServerTestCase {
Expand Down Expand Up @@ -1159,11 +1159,11 @@ public Object call() throws Exception {
getSystem(getServerProperties(disableQueryMonitorForLowMemory, queryTimeout));
if (disableQueryMonitorForLowMemory == true) {
System.setProperty(
DistributionConfig.GEMFIRE_PREFIX + "Cache.DISABLE_QUERY_MONITOR_FOR_LOW_MEMORY",
GeodeGlossary.GEMFIRE_PREFIX + "Cache.DISABLE_QUERY_MONITOR_FOR_LOW_MEMORY",
"true");
} else {
System.clearProperty(
DistributionConfig.GEMFIRE_PREFIX + "Cache.DISABLE_QUERY_MONITOR_FOR_LOW_MEMORY");
GeodeGlossary.GEMFIRE_PREFIX + "Cache.DISABLE_QUERY_MONITOR_FOR_LOW_MEMORY");
}

GemFireCacheImpl cache = (GemFireCacheImpl) getCache();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import org.apache.geode.cache.query.partitioned.PRQueryDUnitHelper;
import org.apache.geode.cache30.CacheSerializableRunnable;
import org.apache.geode.cache30.CacheTestCase;
import org.apache.geode.distributed.internal.DistributionConfig;
import org.apache.geode.internal.cache.CachedDeserializable;
import org.apache.geode.internal.cache.GemFireCacheImpl;
import org.apache.geode.internal.cache.LocalRegion;
Expand All @@ -55,6 +54,7 @@
import org.apache.geode.test.dunit.VM;
import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
import org.apache.geode.test.junit.categories.OQLIndexTest;
import org.apache.geode.util.internal.GeodeGlossary;

/**
* This test is similar to {@link ConcurrentIndexUpdateWithoutWLDUnitTest} except that it sets
Expand Down Expand Up @@ -98,7 +98,7 @@ private void getAvailableCacheElseCreateCache() {
Cache newCache = GemFireCacheImpl.getInstance();
if (null == newCache) {
System.setProperty(
DistributionConfig.GEMFIRE_PREFIX + "DISABLE_DISCONNECT_DS_ON_CACHE_CLOSE", "true");
GeodeGlossary.GEMFIRE_PREFIX + "DISABLE_DISCONNECT_DS_ON_CACHE_CLOSE", "true");
newCache = CacheFactory.create(getSystem());
}
PRQueryDUnitHelper.setCache(newCache);
Expand All @@ -110,7 +110,7 @@ private void getAvailableCacheElseCreateCache() {
Assert.fail("Checked exception while initializing cache??", ex);
} finally {
System.clearProperty(
DistributionConfig.GEMFIRE_PREFIX + "DISABLE_DISCONNECT_DS_ON_CACHE_CLOSE");
GeodeGlossary.GEMFIRE_PREFIX + "DISABLE_DISCONNECT_DS_ON_CACHE_CLOSE");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import org.apache.geode.cache.query.partitioned.PRQueryDUnitHelper;
import org.apache.geode.cache30.CacheSerializableRunnable;
import org.apache.geode.cache30.CacheTestCase;
import org.apache.geode.distributed.internal.DistributionConfig;
import org.apache.geode.internal.cache.CachedDeserializable;
import org.apache.geode.internal.cache.GemFireCacheImpl;
import org.apache.geode.internal.cache.LocalRegion;
Expand All @@ -56,6 +55,7 @@
import org.apache.geode.test.dunit.VM;
import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
import org.apache.geode.test.junit.categories.OQLIndexTest;
import org.apache.geode.util.internal.GeodeGlossary;

/**
* During validation all region operations are paused for a while. Validation happens multiple time
Expand Down Expand Up @@ -94,7 +94,7 @@ private final void getAvailableCacheElseCreateCache() {
Cache newCache = GemFireCacheImpl.getInstance();
if (null == newCache) {
System.setProperty(
DistributionConfig.GEMFIRE_PREFIX + "DISABLE_DISCONNECT_DS_ON_CACHE_CLOSE", "true");
GeodeGlossary.GEMFIRE_PREFIX + "DISABLE_DISCONNECT_DS_ON_CACHE_CLOSE", "true");
newCache = CacheFactory.create(getSystem());
}
PRQueryDUnitHelper.setCache(newCache);
Expand All @@ -106,7 +106,7 @@ private final void getAvailableCacheElseCreateCache() {
Assert.fail("Checked exception while initializing cache??", ex);
} finally {
System.clearProperty(
DistributionConfig.GEMFIRE_PREFIX + "DISABLE_DISCONNECT_DS_ON_CACHE_CLOSE");
GeodeGlossary.GEMFIRE_PREFIX + "DISABLE_DISCONNECT_DS_ON_CACHE_CLOSE");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
import org.apache.geode.cache.asyncqueue.AsyncEventListener;
import org.apache.geode.cache.asyncqueue.AsyncEventQueue;
import org.apache.geode.cache.asyncqueue.AsyncEventQueueFactory;
import org.apache.geode.distributed.internal.DistributionConfig;
import org.apache.geode.internal.cache.RegionEntryContext;
import org.apache.geode.internal.cache.xmlcache.CacheCreation;
import org.apache.geode.internal.cache.xmlcache.CacheXml;
import org.apache.geode.internal.cache.xmlcache.RegionAttributesCreation;
import org.apache.geode.internal.cache.xmlcache.ResourceManagerCreation;
import org.apache.geode.test.dunit.IgnoredException;
import org.apache.geode.util.internal.GeodeGlossary;


public class CacheXmlGeode10DUnitTest extends CacheXml81DUnitTest {
Expand All @@ -52,7 +52,7 @@ protected String getGemFireVersion() {
@SuppressWarnings("rawtypes")
@Test
public void testEnableOffHeapMemory() throws Exception {
System.setProperty(DistributionConfig.GEMFIRE_PREFIX + OFF_HEAP_MEMORY_SIZE, "1m");
System.setProperty(GeodeGlossary.GEMFIRE_PREFIX + OFF_HEAP_MEMORY_SIZE, "1m");

final String regionName = "testEnableOffHeapMemory";

Expand Down Expand Up @@ -162,7 +162,7 @@ public void testResourceManagerThresholds() throws Exception {
final float low = 90.0f;
final float high = 95.0f;

System.setProperty(DistributionConfig.GEMFIRE_PREFIX + OFF_HEAP_MEMORY_SIZE, "1m");
System.setProperty(GeodeGlossary.GEMFIRE_PREFIX + OFF_HEAP_MEMORY_SIZE, "1m");

Cache c;
ResourceManagerCreation rmc = new ResourceManagerCreation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import org.apache.geode.cache.DataPolicy;
import org.apache.geode.cache.RegionAttributes;
import org.apache.geode.cache.Scope;
import org.apache.geode.internal.OSProcess;
import org.apache.geode.logging.internal.OSProcess;


public class DiskDistributedNoAckAsyncRegionDUnitTest extends DiskDistributedNoAckRegionTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
import org.apache.geode.distributed.Locator;
import org.apache.geode.distributed.internal.InternalLocator;
import org.apache.geode.internal.AvailablePortHelper;
import org.apache.geode.internal.OSProcess;
import org.apache.geode.internal.cache.CachedDeserializableFactory;
import org.apache.geode.internal.cache.InternalCache;
import org.apache.geode.logging.internal.OSProcess;
import org.apache.geode.pdx.PdxReader;
import org.apache.geode.pdx.PdxSerializable;
import org.apache.geode.pdx.PdxSerializationException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
import org.apache.geode.cache.EvictionAttributes;
import org.apache.geode.cache.Region;
import org.apache.geode.cache.Scope;
import org.apache.geode.internal.OSProcess;
import org.apache.geode.internal.cache.xmlcache.CacheCreation;
import org.apache.geode.logging.internal.OSProcess;
import org.apache.geode.test.dunit.Host;
import org.apache.geode.test.dunit.LogWriterUtils;
import org.apache.geode.test.dunit.VM;
Expand Down
Loading

0 comments on commit af5a044

Please sign in to comment.