Skip to content

Commit

Permalink
Merge branch 'develop' into add-extensions-to-classpath-155484283
Browse files Browse the repository at this point in the history
  • Loading branch information
jchen21 authored Mar 23, 2018
2 parents 828c8a0 + 6367925 commit f79c8d9
Show file tree
Hide file tree
Showing 183 changed files with 2,743 additions and 1,866 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ out/
*.orig
geode-pulse/screenshots/
/jpf.properties

.git-together
51 changes: 24 additions & 27 deletions geode-assembly/src/main/dist/bin/gfsh.bat
Original file line number Diff line number Diff line change
Expand Up @@ -25,54 +25,51 @@ REM GEODE_HOME - Geode product Directory
REM
REM

@setlocal enableextensions
@set scriptdir=%~dp0
@set gf=%scriptdir:\bin\=%
setlocal enableextensions
set scriptdir=%~dp0
set gf=%scriptdir:\bin\=%
REM echo %gf%
REM echo %scriptdir%
@if exist "%gf%\lib\geode-dependencies.jar" @goto gfok
@echo Could not determine GEODE_HOME location
@verify other 2>nul
@goto done
if exist "%gf%\lib\geode-dependencies.jar" goto gfok
echo Could not determine GEODE_HOME location
verify other 2>nul
goto done
:gfok
@set GEODE_HOME=%gf%
set GEODE_HOME=%gf%

@set GFSH_JARS=%GEODE_HOME%\lib\gfsh-dependencies.jar
set GFSH_JARS=%GEODE_HOME%\lib\gfsh-dependencies.jar
REM if a system level classpath is set, append it to the classes gfsh will need
@if defined CLASSPATH (
@set DEPENDENCIES=%GFSH_JARS%;%CLASSPATH%;%GEODE_HOME%\extensions\*
if defined CLASSPATH (
set DEPENDENCIES=%GFSH_JARS%;%CLASSPATH%;%GEODE_HOME%\extensions\*
) else (
@set DEPENDENCIES=%GFSH_JARS%;%GEODE_HOME%\extensions\*
set DEPENDENCIES=%GFSH_JARS%;%GEODE_HOME%\extensions\*
)

@if not defined GF_JAVA (
if not defined GF_JAVA (
REM %GF_JAVA% is not defined, assume it is on the PATH
@if defined JAVA_HOME (
@set GF_JAVA=%JAVA_HOME%\bin\java.exe
) else (
@set GF_JAVA=java
)
if defined JAVA_HOME (
set GF_JAVA=%JAVA_HOME%\bin\java.exe
) else (
set GF_JAVA=java
)
)

REM
REM Copy default .gfshrc to the home directory. Uncomment if needed.
REM
REM @if not exist "%USERPROFILE%\.gemfire\.gfsh2rc" (
REM @xcopy /q "%GEODE_HOME%\defaultConfigs\.gfsh2rc" "%USERPROFILE%\.gemfire"
REM if not exist "%USERPROFILE%\.gemfire\.gfsh2rc" (
REM xcopy /q "%GEODE_HOME%\defaultConfigs\.gfsh2rc" "%USERPROFILE%\.gemfire"
REM )

REM
REM Make dir if .gemfire does not exist. Uncomment if needed.
REM
REM @if not exist "%USERPROFILE%\.gemfire" (
REM @mkdir "%USERPROFILE%\.gemfire"
REM if not exist "%USERPROFILE%\.gemfire" (
REM mkdir "%USERPROFILE%\.gemfire"
REM )

@set LAUNCHER=org.apache.geode.management.internal.cli.Launcher
@if defined JAVA_ARGS (
@set JAVA_ARGS="%JAVA_ARGS%"
)
set LAUNCHER=org.apache.geode.management.internal.cli.Launcher

REM Call java with our classpath
@"%GF_JAVA%" -Dgfsh=true -Dlog4j.configurationFile=classpath:log4j2-cli.xml -classpath "%DEPENDENCIES%" %JAVA_ARGS% %LAUNCHER% %*
"%GF_JAVA%" -Dgfsh=true -Dlog4j.configurationFile=classpath:log4j2-cli.xml -classpath "%DEPENDENCIES%" %JAVA_ARGS% %LAUNCHER% %*
:done
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
import org.apache.geode.connectors.jdbc.internal.ConnectionConfigBuilder;
import org.apache.geode.connectors.jdbc.internal.ConnectionConfiguration;
import org.apache.geode.distributed.DistributedMember;
import org.apache.geode.distributed.internal.InternalClusterConfigurationService;
import org.apache.geode.management.cli.CliMetaData;
import org.apache.geode.management.cli.Result;
import org.apache.geode.management.internal.cli.commands.GfshCommand;
import org.apache.geode.management.internal.cli.commands.InternalGfshCommand;
import org.apache.geode.management.internal.cli.functions.CliFunctionResult;
import org.apache.geode.management.internal.cli.i18n.CliStrings;
import org.apache.geode.management.internal.cli.result.ResultBuilder;
Expand All @@ -37,7 +38,7 @@
import org.apache.geode.security.ResourcePermission;

@Experimental
public class AlterConnectionCommand extends GfshCommand {
public class AlterConnectionCommand extends InternalGfshCommand {
static final String ALTER_JDBC_CONNECTION = "alter jdbc-connection";
static final String ALTER_JDBC_CONNECTION__HELP =
EXPERIMENTAL + "Alter properties for an existing jdbc connection.";
Expand Down Expand Up @@ -136,7 +137,8 @@ private void addErrorToResults(TabularResultData tabularResultData, CliFunctionR
private void updateClusterConfiguration(final Result result, final XmlEntity xmlEntity) {
if (xmlEntity != null) {
persistClusterConfiguration(result,
() -> getSharedConfiguration().addXmlEntity(xmlEntity, null));
() -> ((InternalClusterConfigurationService) getConfigurationService())
.addXmlEntity(xmlEntity, null));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
import org.apache.geode.connectors.jdbc.internal.RegionMapping;
import org.apache.geode.connectors.jdbc.internal.RegionMappingBuilder;
import org.apache.geode.distributed.DistributedMember;
import org.apache.geode.distributed.internal.InternalClusterConfigurationService;
import org.apache.geode.management.cli.CliMetaData;
import org.apache.geode.management.cli.Result;
import org.apache.geode.management.internal.cli.commands.GfshCommand;
import org.apache.geode.management.internal.cli.commands.InternalGfshCommand;
import org.apache.geode.management.internal.cli.functions.CliFunctionResult;
import org.apache.geode.management.internal.cli.i18n.CliStrings;
import org.apache.geode.management.internal.cli.result.ResultBuilder;
Expand All @@ -37,7 +38,7 @@
import org.apache.geode.security.ResourcePermission;

@Experimental
public class AlterMappingCommand extends GfshCommand {
public class AlterMappingCommand extends InternalGfshCommand {
static final String ALTER_MAPPING = "alter jdbc-mapping";
static final String ALTER_MAPPING__HELP =
EXPERIMENTAL + "Alter properties for an existing jdbc mapping.";
Expand Down Expand Up @@ -145,7 +146,8 @@ private void addErrorToResults(TabularResultData tabularResultData, CliFunctionR
private void updateClusterConfiguration(final Result result, final XmlEntity xmlEntity) {
if (xmlEntity != null) {
persistClusterConfiguration(result,
() -> getSharedConfiguration().addXmlEntity(xmlEntity, null));
() -> ((InternalClusterConfigurationService) getConfigurationService())
.addXmlEntity(xmlEntity, null));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@
import org.apache.geode.connectors.jdbc.internal.ConnectionConfigBuilder;
import org.apache.geode.connectors.jdbc.internal.ConnectionConfiguration;
import org.apache.geode.distributed.DistributedMember;
import org.apache.geode.distributed.internal.InternalClusterConfigurationService;
import org.apache.geode.internal.logging.LogService;
import org.apache.geode.management.cli.CliMetaData;
import org.apache.geode.management.cli.Result;
import org.apache.geode.management.internal.cli.AbstractCliAroundInterceptor;
import org.apache.geode.management.internal.cli.GfshParseResult;
import org.apache.geode.management.internal.cli.commands.GfshCommand;
import org.apache.geode.management.internal.cli.commands.InternalGfshCommand;
import org.apache.geode.management.internal.cli.functions.CliFunctionResult;
import org.apache.geode.management.internal.cli.i18n.CliStrings;
import org.apache.geode.management.internal.cli.result.ResultBuilder;
Expand All @@ -42,7 +43,7 @@
import org.apache.geode.security.ResourcePermission;

@Experimental
public class CreateConnectionCommand extends GfshCommand {
public class CreateConnectionCommand extends InternalGfshCommand {
private static final Logger logger = LogService.getLogger();

static final String CREATE_CONNECTION = "create jdbc-connection";
Expand Down Expand Up @@ -143,7 +144,8 @@ private void addErrorToResults(TabularResultData tabularResultData, CliFunctionR
private void updateClusterConfiguration(final Result result, final XmlEntity xmlEntity) {
if (xmlEntity != null) {
persistClusterConfiguration(result,
() -> getSharedConfiguration().addXmlEntity(xmlEntity, null));
() -> ((InternalClusterConfigurationService) getConfigurationService())
.addXmlEntity(xmlEntity, null));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
import org.apache.geode.connectors.jdbc.internal.RegionMapping;
import org.apache.geode.connectors.jdbc.internal.RegionMappingBuilder;
import org.apache.geode.distributed.DistributedMember;
import org.apache.geode.distributed.internal.InternalClusterConfigurationService;
import org.apache.geode.management.cli.CliMetaData;
import org.apache.geode.management.cli.Result;
import org.apache.geode.management.internal.cli.commands.GfshCommand;
import org.apache.geode.management.internal.cli.commands.InternalGfshCommand;
import org.apache.geode.management.internal.cli.functions.CliFunctionResult;
import org.apache.geode.management.internal.cli.i18n.CliStrings;
import org.apache.geode.management.internal.cli.result.ResultBuilder;
Expand All @@ -37,7 +38,7 @@
import org.apache.geode.security.ResourcePermission;

@Experimental
public class CreateMappingCommand extends GfshCommand {
public class CreateMappingCommand extends InternalGfshCommand {
static final String CREATE_MAPPING = "create jdbc-mapping";
static final String CREATE_MAPPING__HELP =
EXPERIMENTAL + "Create a mapping for a region for use with a JDBC database connection.";
Expand Down Expand Up @@ -146,7 +147,8 @@ private void addErrorToResults(TabularResultData tabularResultData, CliFunctionR
private void updateClusterConfiguration(final Result result, final XmlEntity xmlEntity) {
if (xmlEntity != null) {
persistClusterConfiguration(result,
() -> getSharedConfiguration().addXmlEntity(xmlEntity, null));
() -> ((InternalClusterConfigurationService) getConfigurationService())
.addXmlEntity(xmlEntity, null));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import org.apache.geode.distributed.DistributedMember;
import org.apache.geode.management.cli.CliMetaData;
import org.apache.geode.management.cli.Result;
import org.apache.geode.management.internal.cli.commands.GfshCommand;
import org.apache.geode.management.internal.cli.commands.InternalGfshCommand;
import org.apache.geode.management.internal.cli.i18n.CliStrings;
import org.apache.geode.management.internal.cli.result.CompositeResultData;
import org.apache.geode.management.internal.cli.result.ResultBuilder;
Expand All @@ -41,7 +41,7 @@
import org.apache.geode.security.ResourcePermission;

@Experimental
public class DescribeConnectionCommand extends GfshCommand {
public class DescribeConnectionCommand extends InternalGfshCommand {
static final String DESCRIBE_CONNECTION = "describe jdbc-connection";
static final String DESCRIBE_CONNECTION__HELP =
EXPERIMENTAL + "Describe the specified jdbc connection.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import org.apache.geode.distributed.DistributedMember;
import org.apache.geode.management.cli.CliMetaData;
import org.apache.geode.management.cli.Result;
import org.apache.geode.management.internal.cli.commands.GfshCommand;
import org.apache.geode.management.internal.cli.commands.InternalGfshCommand;
import org.apache.geode.management.internal.cli.i18n.CliStrings;
import org.apache.geode.management.internal.cli.result.CompositeResultData;
import org.apache.geode.management.internal.cli.result.ResultBuilder;
Expand All @@ -41,7 +41,7 @@
import org.apache.geode.security.ResourcePermission;

@Experimental
public class DescribeMappingCommand extends GfshCommand {
public class DescribeMappingCommand extends InternalGfshCommand {
static final String DESCRIBE_MAPPING = "describe jdbc-mapping";
static final String DESCRIBE_MAPPING__HELP =
EXPERIMENTAL + "Describe the specified jdbc mapping.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
import org.apache.geode.annotations.Experimental;
import org.apache.geode.cache.execute.ResultCollector;
import org.apache.geode.distributed.DistributedMember;
import org.apache.geode.distributed.internal.InternalClusterConfigurationService;
import org.apache.geode.management.cli.CliMetaData;
import org.apache.geode.management.cli.Result;
import org.apache.geode.management.internal.cli.commands.GfshCommand;
import org.apache.geode.management.internal.cli.commands.InternalGfshCommand;
import org.apache.geode.management.internal.cli.functions.CliFunctionResult;
import org.apache.geode.management.internal.cli.i18n.CliStrings;
import org.apache.geode.management.internal.cli.result.ResultBuilder;
Expand All @@ -35,7 +36,7 @@
import org.apache.geode.security.ResourcePermission;

@Experimental
public class DestroyConnectionCommand extends GfshCommand {
public class DestroyConnectionCommand extends InternalGfshCommand {
static final String DESTROY_CONNECTION = "destroy jdbc-connection";
static final String DESTROY_CONNECTION__HELP =
EXPERIMENTAL + "Destroy/Remove the specified jdbc connection.";
Expand Down Expand Up @@ -107,7 +108,8 @@ private void addErrorToResults(TabularResultData tabularResultData, CliFunctionR
private void updateClusterConfiguration(final Result result, final XmlEntity xmlEntity) {
if (xmlEntity != null) {
persistClusterConfiguration(result,
() -> getSharedConfiguration().addXmlEntity(xmlEntity, null));
() -> ((InternalClusterConfigurationService) getConfigurationService())
.addXmlEntity(xmlEntity, null));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
import org.apache.geode.annotations.Experimental;
import org.apache.geode.cache.execute.ResultCollector;
import org.apache.geode.distributed.DistributedMember;
import org.apache.geode.distributed.internal.InternalClusterConfigurationService;
import org.apache.geode.management.cli.CliMetaData;
import org.apache.geode.management.cli.Result;
import org.apache.geode.management.internal.cli.commands.GfshCommand;
import org.apache.geode.management.internal.cli.commands.InternalGfshCommand;
import org.apache.geode.management.internal.cli.functions.CliFunctionResult;
import org.apache.geode.management.internal.cli.i18n.CliStrings;
import org.apache.geode.management.internal.cli.result.ResultBuilder;
Expand All @@ -35,7 +36,7 @@
import org.apache.geode.security.ResourcePermission;

@Experimental
public class DestroyMappingCommand extends GfshCommand {
public class DestroyMappingCommand extends InternalGfshCommand {
static final String DESTROY_MAPPING = "destroy jdbc-mapping";
static final String DESTROY_MAPPING__HELP = EXPERIMENTAL + "Destroy the specified mapping.";
static final String DESTROY_MAPPING__REGION_NAME = "region";
Expand Down Expand Up @@ -104,7 +105,8 @@ private void addErrorToResults(TabularResultData tabularResultData, CliFunctionR
private void updateClusterConfiguration(final Result result, final XmlEntity xmlEntity) {
if (xmlEntity != null) {
persistClusterConfiguration(result,
() -> getSharedConfiguration().addXmlEntity(xmlEntity, null));
() -> ((InternalClusterConfigurationService) getConfigurationService())
.addXmlEntity(xmlEntity, null));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@
import org.apache.geode.distributed.DistributedMember;
import org.apache.geode.management.cli.CliMetaData;
import org.apache.geode.management.cli.Result;
import org.apache.geode.management.internal.cli.commands.GfshCommand;
import org.apache.geode.management.internal.cli.commands.InternalGfshCommand;
import org.apache.geode.management.internal.cli.i18n.CliStrings;
import org.apache.geode.management.internal.cli.result.ResultBuilder;
import org.apache.geode.management.internal.cli.result.TabularResultData;
import org.apache.geode.management.internal.security.ResourceOperation;
import org.apache.geode.security.ResourcePermission;

@Experimental
public class ListConnectionCommand extends GfshCommand {
public class ListConnectionCommand extends InternalGfshCommand {
static final String LIST_JDBC_CONNECTION = "list jdbc-connections";
static final String LIST_JDBC_CONNECTION__HELP =
EXPERIMENTAL + "Display jdbc connections for all members.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@
import org.apache.geode.distributed.DistributedMember;
import org.apache.geode.management.cli.CliMetaData;
import org.apache.geode.management.cli.Result;
import org.apache.geode.management.internal.cli.commands.GfshCommand;
import org.apache.geode.management.internal.cli.commands.InternalGfshCommand;
import org.apache.geode.management.internal.cli.i18n.CliStrings;
import org.apache.geode.management.internal.cli.result.ResultBuilder;
import org.apache.geode.management.internal.cli.result.TabularResultData;
import org.apache.geode.management.internal.security.ResourceOperation;
import org.apache.geode.security.ResourcePermission;

@Experimental
public class ListMappingCommand extends GfshCommand {
public class ListMappingCommand extends InternalGfshCommand {
static final String LIST_MAPPING = "list jdbc-mappings";
static final String LIST_MAPPING__HELP = EXPERIMENTAL + "Display jdbc mappings for all members.";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import org.apache.geode.test.junit.categories.FlakyTest;
import org.apache.geode.test.junit.categories.IntegrationTest;

@Category({IntegrationTest.class, FlakyTest.class})
@Category(IntegrationTest.class)
public class AnalyzeConnectorsSerializablesJUnitTest extends AnalyzeSerializablesJUnitTest {

@Override
Expand Down
4 changes: 3 additions & 1 deletion geode-core/src/main/java/org/apache/geode/cache/Region.java
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,9 @@ <SK, SV> Region<SK, SV> createSubregion(String subregionName,
V put(K key, V value, Object aCallbackArgument) throws TimeoutException, CacheWriterException;

/**
* Creates a new entry in this region with the specified key and value.
* Creates a new entry in this region with the specified key and value if and only if an entry
* does not already exist for the specified key. If an entry already exists for the specified
* key, throws {@link EntryExistsException}.
*
* <p>
* Updates the {@link CacheStatistics#getLastAccessedTime} and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ public String getId() {
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "",
propOrder = {"configPropertyName", "configPropertyType", "configPropertyValue"})
public static class ConfigProperty {
public static class ConfigProperty implements CacheElement {

@XmlElement(name = "config-property-name", namespace = "http://geode.apache.org/schema/cache",
required = true)
Expand All @@ -679,6 +679,16 @@ public ConfigProperty(String name, String type, String value) {
this.configPropertyValue = value;
}

/**
* Get the id of the element. The id is the same as the name.
*
* @return the id of the element
*/
@Override
public String getId() {
return getName();
}

/**
* Gets the value of the configPropertyName property.
*
Expand Down
Loading

0 comments on commit f79c8d9

Please sign in to comment.