[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2018-05-08 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16467718#comment-16467718
 ] 

ASF subversion and git services commented on GEODE-2668:


Commit 62841692a06de682059529a28a73ed3ae9638ec8 in geode's branch 
refs/heads/develop from [~khowe]
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=6284169 ]

GEODE-2668: Better handling of configuration updates (#1892)

In cases where destroying GWRs may fail on some or all servers, control
configuration updating based on state of --if-exists option.
--if-exists == true --> update config
--if-exists == false --> do not update config

Added tests for edge cases with failures on servers.

> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>Assignee: Kenneth Howe
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 3.5h
>  Remaining Estimate: 0h
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2018-04-30 Thread Barbara Pruijn (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16459110#comment-16459110
 ] 

Barbara Pruijn commented on GEODE-2668:
---

If the gateway receiver does not exist and we run the destroy gateway receiver 
command, we should get an error that the gateway receiver doesn't exist.
 We should *not* state:
{code:java}
gfsh>destroy gateway-receiver
This change is not persisted in the cluster configuration, either because the 
cluster configuration service is not running or the command is operating on 
targeted members.
Member | Status
-- | --
s1 | ERROR: Gateway receiver not found.{code}
We should state:
 {{Gateway receiver not found.}}

> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2018-04-23 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16449102#comment-16449102
 ] 

ASF subversion and git services commented on GEODE-2668:


Commit 89629358dbacd3835ce35da15412c8c2e8de9353 in geode's branch 
refs/heads/feature/GEODE-4624 from [~khowe]
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=8962935 ]

GEODE-2668: Add new command class for destroy gateway-receivers (#1764)

* GEODE-2668: Add new command class for destroy gateway-receivers

- New DUnit and unit tests for command and function classes
- Use new cluster configuration service instead of XmlEntity



> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2018-04-23 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16449101#comment-16449101
 ] 

ASF subversion and git services commented on GEODE-2668:


Commit 89629358dbacd3835ce35da15412c8c2e8de9353 in geode's branch 
refs/heads/feature/GEODE-4624 from [~khowe]
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=8962935 ]

GEODE-2668: Add new command class for destroy gateway-receivers (#1764)

* GEODE-2668: Add new command class for destroy gateway-receivers

- New DUnit and unit tests for command and function classes
- Use new cluster configuration service instead of XmlEntity



> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2018-04-23 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16448673#comment-16448673
 ] 

ASF subversion and git services commented on GEODE-2668:


Commit 89629358dbacd3835ce35da15412c8c2e8de9353 in geode's branch 
refs/heads/feature/GEODE-925 from [~khowe]
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=8962935 ]

GEODE-2668: Add new command class for destroy gateway-receivers (#1764)

* GEODE-2668: Add new command class for destroy gateway-receivers

- New DUnit and unit tests for command and function classes
- Use new cluster configuration service instead of XmlEntity



> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2018-04-23 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16448672#comment-16448672
 ] 

ASF subversion and git services commented on GEODE-2668:


Commit 89629358dbacd3835ce35da15412c8c2e8de9353 in geode's branch 
refs/heads/feature/GEODE-925 from [~khowe]
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=8962935 ]

GEODE-2668: Add new command class for destroy gateway-receivers (#1764)

* GEODE-2668: Add new command class for destroy gateway-receivers

- New DUnit and unit tests for command and function classes
- Use new cluster configuration service instead of XmlEntity



> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2018-04-23 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16448215#comment-16448215
 ] 

ASF subversion and git services commented on GEODE-2668:


Commit 89629358dbacd3835ce35da15412c8c2e8de9353 in geode's branch 
refs/heads/develop from [~khowe]
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=8962935 ]

GEODE-2668: Add new command class for destroy gateway-receivers (#1764)

* GEODE-2668: Add new command class for destroy gateway-receivers

- New DUnit and unit tests for command and function classes
- Use new cluster configuration service instead of XmlEntity



> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2018-04-23 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16448214#comment-16448214
 ] 

ASF subversion and git services commented on GEODE-2668:


Commit 89629358dbacd3835ce35da15412c8c2e8de9353 in geode's branch 
refs/heads/develop from [~khowe]
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=8962935 ]

GEODE-2668: Add new command class for destroy gateway-receivers (#1764)

* GEODE-2668: Add new command class for destroy gateway-receivers

- New DUnit and unit tests for command and function classes
- Use new cluster configuration service instead of XmlEntity



> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2017-12-08 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16284340#comment-16284340
 ] 

ASF subversion and git services commented on GEODE-2668:


Commit fa2687c76a5fd93d968449a40450c28e8814ee58 in geode's branch 
refs/heads/develop from [~jinmeiliao]
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=fa2687c ]

 GEODE-2668: build tabular command result from a list of function results  
(#1127)

* GEODE-2668: build tabular command result from a list of function results

* reduce duplicate code to create the tabular results
* promote presentation consistency
* Add more validation for CreateGatewaySender/Receiver command and reworked the 
tests


> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2017-12-08 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16284341#comment-16284341
 ] 

ASF subversion and git services commented on GEODE-2668:


Commit fa2687c76a5fd93d968449a40450c28e8814ee58 in geode's branch 
refs/heads/develop from [~jinmeiliao]
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=fa2687c ]

 GEODE-2668: build tabular command result from a list of function results  
(#1127)

* GEODE-2668: build tabular command result from a list of function results

* reduce duplicate code to create the tabular results
* promote presentation consistency
* Add more validation for CreateGatewaySender/Receiver command and reworked the 
tests


> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2017-12-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16284333#comment-16284333
 ] 

ASF GitHub Bot commented on GEODE-2668:
---

jdeppe-pivotal commented on a change in pull request #1127:  GEODE-2668: build 
tabular command result from a list of function results 
URL: https://github.com/apache/geode/pull/1127#discussion_r155889761
 
 

 ##
 File path: 
geode-core/src/main/java/org/apache/geode/management/internal/cli/result/ResultBuilder.java
 ##
 @@ -188,6 +189,22 @@ public static CommandResult buildResult(ResultData 
resultData) {
 return new CommandResult(resultData);
   }
 
+  public static CommandResult buildResult(List 
functionResults) {
+TabularResultData tabularData = ResultBuilder.createTabularResultData();
+boolean success = false;
+for (CliFunctionResult result : functionResults) {
+  tabularData.accumulate("Member", result.getMemberIdOrName());
+  tabularData.accumulate("Status", result.getStatus());
+  // if one member returns back successful results, the command results in 
success
+  if (result.isSuccessful()) {
+success = true;
+  }
+}
+
+tabularData.setStatus(success ? Result.Status.OK : Result.Status.ERROR);
+return ResultBuilder.buildResult(tabularData);
+  }
 
 Review comment:
   I'm not sure we can come up with and cover all situations of partial 
failures for every command. I really like that we're being consistent across 
all commands (even if it ultimately turns out to be wrong; which I don't think 
it will). At the very least we're not hiding errors and now, with commands 
being idempotent, users should be able to recover from almost anything.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2017-12-07 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16282122#comment-16282122
 ] 

ASF GitHub Bot commented on GEODE-2668:
---

jinmeiliao opened a new pull request #1140:  GEODE-2668: update cluster config 
after destroy gateway sender 
URL: https://github.com/apache/geode/pull/1140
 
 
   This is built on top of PR 1127. Only the last commit's content is for this 
PR.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2017-12-07 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16282036#comment-16282036
 ] 

ASF GitHub Bot commented on GEODE-2668:
---

jinmeiliao commented on issue #1127:  GEODE-2668: build tabular command result 
from a list of function results 
URL: https://github.com/apache/geode/pull/1127#issuecomment-350007800
 
 
   precheckin green


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2017-12-07 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16282035#comment-16282035
 ] 

ASF GitHub Bot commented on GEODE-2668:
---

jinmeiliao commented on a change in pull request #1127:  GEODE-2668: build 
tabular command result from a list of function results 
URL: https://github.com/apache/geode/pull/1127#discussion_r19300
 
 

 ##
 File path: 
geode-core/src/test/java/org/apache/geode/management/internal/cli/functions/CliFunctionResultTest.java
 ##
 @@ -29,14 +29,20 @@
   private CliFunctionResult result;
 
 Review comment:
   just to avoid declaring it in each method. save me some typing


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2017-12-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16280964#comment-16280964
 ] 

ASF GitHub Bot commented on GEODE-2668:
---

pdxrunner commented on a change in pull request #1127:  GEODE-2668: build 
tabular command result from a list of function results 
URL: https://github.com/apache/geode/pull/1127#discussion_r155368475
 
 

 ##
 File path: 
geode-core/src/main/java/org/apache/geode/management/internal/cli/result/ResultBuilder.java
 ##
 @@ -188,6 +189,22 @@ public static CommandResult buildResult(ResultData 
resultData) {
 return new CommandResult(resultData);
   }
 
+  public static CommandResult buildResult(List 
functionResults) {
+TabularResultData tabularData = ResultBuilder.createTabularResultData();
+boolean success = false;
+for (CliFunctionResult result : functionResults) {
+  tabularData.accumulate("Member", result.getMemberIdOrName());
+  tabularData.accumulate("Status", result.getStatus());
+  // if one member returns back successful results, the command results in 
success
+  if (result.isSuccessful()) {
+success = true;
+  }
+}
+
+tabularData.setStatus(success ? Result.Status.OK : Result.Status.ERROR);
+return ResultBuilder.buildResult(tabularData);
+  }
 
 Review comment:
   OK. Does still bother me to see "ERROR" in a command output with a command 
status OK.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2017-12-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16280920#comment-16280920
 ] 

ASF GitHub Bot commented on GEODE-2668:
---

jinmeiliao commented on a change in pull request #1127:  GEODE-2668: build 
tabular command result from a list of function results 
URL: https://github.com/apache/geode/pull/1127#discussion_r155361794
 
 

 ##
 File path: 
geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateGatewaySenderCommand.java
 ##
 @@ -60,8 +62,9 @@ public Result createGatewaySender(@CliOption(key = 
{CliStrings.GROUP, CliStrings
   @CliOption(key = 
CliStrings.CREATE_GATEWAYSENDER__REMOTEDISTRIBUTEDSYSTEMID, mandatory = true,
   help = 
CliStrings.CREATE_GATEWAYSENDER__REMOTEDISTRIBUTEDSYSTEMID__HELP) Integer 
remoteDistributedSystemId,
 
 
 Review comment:
   I didn't notice this difference. This definitely looks more readable to me.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2017-12-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16280917#comment-16280917
 ] 

ASF GitHub Bot commented on GEODE-2668:
---

jinmeiliao commented on a change in pull request #1127:  GEODE-2668: build 
tabular command result from a list of function results 
URL: https://github.com/apache/geode/pull/1127#discussion_r155361022
 
 

 ##
 File path: 
geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/WANCommandUtils.java
 ##
 @@ -208,24 +203,22 @@ public static void verifySenderAttributes(String 
senderId, int remoteDsID, boole
 }
   }
 
-  public static void verifySenderDestroyed(String senderId, boolean 
isParallel) {
+  public static void verifySenderNotExist(String senderId, boolean isParallel) 
{
 
 Review comment:
   fixed


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2017-12-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16280915#comment-16280915
 ] 

ASF GitHub Bot commented on GEODE-2668:
---

jinmeiliao commented on a change in pull request #1127:  GEODE-2668: build 
tabular command result from a list of function results 
URL: https://github.com/apache/geode/pull/1127#discussion_r155360878
 
 

 ##
 File path: 
geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/CreateDestroyGatewaySenderCommandDUnitTest.java
 ##
 @@ -0,0 +1,322 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+package org.apache.geode.internal.cache.wan.wancommand;
+
+import static 
org.apache.geode.distributed.ConfigurationProperties.DISTRIBUTED_SYSTEM_ID;
+import static 
org.apache.geode.distributed.ConfigurationProperties.REMOTE_LOCATORS;
+import static 
org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.verifySenderAttributes;
+import static 
org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.verifySenderNotExist;
+import static 
org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.verifySenderState;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import org.apache.geode.cache.wan.GatewaySender;
+import org.apache.geode.management.internal.cli.i18n.CliStrings;
+import org.apache.geode.test.dunit.rules.LocatorServerStartupRule;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.junit.categories.DistributedTest;
+import org.apache.geode.test.junit.rules.GfshCommandRule;
+
+@Category(DistributedTest.class)
+public class CreateDestroyGatewaySenderCommandDUnitTest {
+
+  public static final String CREATE =
+  "create gateway-sender --id=ln " + "--remote-distributed-system-id=2";
+  public static final String DESTROY = "destroy gateway-sender --id=ln ";
+
+  @ClassRule
+  public static LocatorServerStartupRule locatorServerStartupRule = new 
LocatorServerStartupRule();
+
+  @Rule
+  public GfshCommandRule gfsh = new GfshCommandRule();
+
+  private static MemberVM locatorSite1;
+  private static MemberVM server1;
+  private static MemberVM server2;
+  private static MemberVM server3;
+
+  @BeforeClass
+  public static void beforeClass() throws Exception {
+Properties props = new Properties();
+props.setProperty(DISTRIBUTED_SYSTEM_ID, "" + 1);
+locatorSite1 = locatorServerStartupRule.startLocatorVM(1, props);
+
+props.setProperty(DISTRIBUTED_SYSTEM_ID, "" + 2);
+props.setProperty(REMOTE_LOCATORS, "localhost[" + locatorSite1.getPort() + 
"]");
+locatorServerStartupRule.startLocatorVM(2, props);
+
+server1 = locatorServerStartupRule.startServerVM(3, "senderGroup1", 
locatorSite1.getPort());
+server2 = locatorServerStartupRule.startServerVM(4, 
locatorSite1.getPort());
+server3 = locatorServerStartupRule.startServerVM(5, 
locatorSite1.getPort());
+  }
+
+  @Before
+  public void before() throws Exception {
+gfsh.connectAndVerify(locatorSite1);
+  }
+
+  @After
+  public void after() {
+gfsh.executeAndAssertThat(DESTROY + " --if-exists").statusIsSuccess();
+  }
+
+  /**
+   * GatewaySender with all default attributes
+   */
+  @Test
+  public void testCreateDestroyGatewaySenderWithDefault() throws Exception {
+
gfsh.executeAndAssertThat(CREATE).statusIsSuccess().tableHasColumnWithExactValuesInAnyOrder(
+"Status", "GatewaySender \"ln\" created on \"server-3\"",
+"GatewaySender \"ln\" created on \"server-4\"",
+"GatewaySender \"ln\" created on \"server-5\"");
+
+MemberVM.invokeInEveryMember(() -> verifySenderState("ln", true, false), 
server1, server2,
+server3);
+
+locatorSite1.invoke(() -> {
+  String xml = 
LocatorServerStartupRule.getLocator().getSharedConfiguration()
+  .getConfiguration("cluster").getCacheXmlContent();
+  

[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2017-12-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16280913#comment-16280913
 ] 

ASF GitHub Bot commented on GEODE-2668:
---

jinmeiliao commented on a change in pull request #1127:  GEODE-2668: build 
tabular command result from a list of function results 
URL: https://github.com/apache/geode/pull/1127#discussion_r155360772
 
 

 ##
 File path: 
geode-core/src/test/java/org/apache/geode/management/internal/cli/functions/CliFunctionResultTest.java
 ##
 @@ -29,14 +29,20 @@
   private CliFunctionResult result;
 
   @Test
-  public void getErrorMessage() throws Exception {
+  public void getStatus() throws Exception {
 
 Review comment:
   fixed


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2017-12-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16280908#comment-16280908
 ] 

ASF GitHub Bot commented on GEODE-2668:
---

jinmeiliao commented on a change in pull request #1127:  GEODE-2668: build 
tabular command result from a list of function results 
URL: https://github.com/apache/geode/pull/1127#discussion_r155360117
 
 

 ##
 File path: 
geode-core/src/main/java/org/apache/geode/management/internal/cli/result/ResultBuilder.java
 ##
 @@ -188,6 +189,22 @@ public static CommandResult buildResult(ResultData 
resultData) {
 return new CommandResult(resultData);
   }
 
+  public static CommandResult buildResult(List 
functionResults) {
+TabularResultData tabularData = ResultBuilder.createTabularResultData();
+boolean success = false;
+for (CliFunctionResult result : functionResults) {
+  tabularData.accumulate("Member", result.getMemberIdOrName());
+  tabularData.accumulate("Status", result.getStatus());
 
 Review comment:
   shouldn't be.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2017-12-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16280904#comment-16280904
 ] 

ASF GitHub Bot commented on GEODE-2668:
---

jinmeiliao commented on a change in pull request #1127:  GEODE-2668: build 
tabular command result from a list of function results 
URL: https://github.com/apache/geode/pull/1127#discussion_r155359722
 
 

 ##
 File path: 
geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateGatewaySenderCommand.java
 ##
 @@ -96,64 +99,63 @@ public Result createGatewaySender(@CliOption(key = 
{CliStrings.GROUP, CliStrings
   @CliOption(key = CliStrings.CREATE_GATEWAYSENDER__ALERTTHRESHOLD,
   help = CliStrings.CREATE_GATEWAYSENDER__ALERTTHRESHOLD__HELP) 
Integer alertThreshold,
 
-  @CliOption(key = CliStrings.CREATE_GATEWAYSENDER__DISPATCHERTHREADS,
+  @CliOption(key = CREATE_GATEWAYSENDER__DISPATCHERTHREADS,
   help = CliStrings.CREATE_GATEWAYSENDER__DISPATCHERTHREADS__HELP) 
Integer dispatcherThreads,
 
-  @CliOption(key = CliStrings.CREATE_GATEWAYSENDER__ORDERPOLICY,
-  help = CliStrings.CREATE_GATEWAYSENDER__ORDERPOLICY__HELP) String 
orderPolicy,
+  @CliOption(key = CREATE_GATEWAYSENDER__ORDERPOLICY,
 
 Review comment:
   must have done this acidentally.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2017-12-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16280903#comment-16280903
 ] 

ASF GitHub Bot commented on GEODE-2668:
---

jinmeiliao commented on a change in pull request #1127:  GEODE-2668: build 
tabular command result from a list of function results 
URL: https://github.com/apache/geode/pull/1127#discussion_r155359659
 
 

 ##
 File path: 
geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateGatewayReceiverCommand.java
 ##
 @@ -78,51 +79,50 @@ public Result createGatewayReceiver(@CliOption(key = 
{CliStrings.GROUP, CliStrin
   @CliOption(key = CliStrings.CREATE_GATEWAYRECEIVER__HOSTNAMEFORSENDERS,
   help = CliStrings.CREATE_GATEWAYRECEIVER__HOSTNAMEFORSENDERS__HELP) 
String hostnameForSenders) {
 
-Result result;
+GatewayReceiverFunctionArgs gatewayReceiverFunctionArgs =
+new GatewayReceiverFunctionArgs(manualStart, startPort, endPort, 
bindAddress,
+socketBufferSize, maximumTimeBetweenPings, 
gatewayTransportFilters, hostnameForSenders);
 
-AtomicReference xmlEntity = new AtomicReference<>();
-try {
-  GatewayReceiverFunctionArgs gatewayReceiverFunctionArgs = new 
GatewayReceiverFunctionArgs(
-  manualStart, startPort, endPort, bindAddress, socketBufferSize, 
maximumTimeBetweenPings,
-  gatewayTransportFilters, hostnameForSenders);
+Set membersToCreateGatewayReceiverOn =
+CliUtil.findMembers(onGroups, onMember);
 
-  Set membersToCreateGatewayReceiverOn =
-  CliUtil.findMembers(onGroups, onMember);
+if (membersToCreateGatewayReceiverOn.isEmpty()) {
+  return 
ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE);
 
 Review comment:
   findXX will return an empty set while getXX will raise an exception which 
will be handled by the executor the same way. We can do it either way. use 
getXXX is probably easier


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2017-12-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16280901#comment-16280901
 ] 

ASF GitHub Bot commented on GEODE-2668:
---

jinmeiliao commented on a change in pull request #1127:  GEODE-2668: build 
tabular command result from a list of function results 
URL: https://github.com/apache/geode/pull/1127#discussion_r155359446
 
 

 ##
 File path: 
geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/AlterRegionCommand.java
 ##
 @@ -139,39 +133,22 @@ public Result alterRegion(
   new Object[] {evictionMax}));
 
 Review comment:
   removed `Object[]{}`. I didn't spend much time refactoring this particular 
command, only the part building the result


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2017-12-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16280765#comment-16280765
 ] 

ASF GitHub Bot commented on GEODE-2668:
---

jinmeiliao commented on a change in pull request #1127:  GEODE-2668: build 
tabular command result from a list of function results 
URL: https://github.com/apache/geode/pull/1127#discussion_r155338740
 
 

 ##
 File path: 
geode-core/src/main/java/org/apache/geode/management/internal/cli/result/ResultBuilder.java
 ##
 @@ -188,6 +189,22 @@ public static CommandResult buildResult(ResultData 
resultData) {
 return new CommandResult(resultData);
   }
 
+  public static CommandResult buildResult(List 
functionResults) {
+TabularResultData tabularData = ResultBuilder.createTabularResultData();
+boolean success = false;
+for (CliFunctionResult result : functionResults) {
+  tabularData.accumulate("Member", result.getMemberIdOrName());
+  tabularData.accumulate("Status", result.getStatus());
+  // if one member returns back successful results, the command results in 
success
+  if (result.isSuccessful()) {
+success = true;
+  }
+}
+
+tabularData.setStatus(success ? Result.Status.OK : Result.Status.ERROR);
+return ResultBuilder.buildResult(tabularData);
+  }
 
 Review comment:
   deemed successful only means the command result status is OK, not ERROR. 
User does get warned about one member's region creation failed by the tabular 
view.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2017-12-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16280757#comment-16280757
 ] 

ASF GitHub Bot commented on GEODE-2668:
---

pdxrunner commented on a change in pull request #1127:  GEODE-2668: build 
tabular command result from a list of function results 
URL: https://github.com/apache/geode/pull/1127#discussion_r155337849
 
 

 ##
 File path: 
geode-core/src/main/java/org/apache/geode/management/internal/cli/result/ResultBuilder.java
 ##
 @@ -188,6 +189,22 @@ public static CommandResult buildResult(ResultData 
resultData) {
 return new CommandResult(resultData);
   }
 
+  public static CommandResult buildResult(List 
functionResults) {
+TabularResultData tabularData = ResultBuilder.createTabularResultData();
+boolean success = false;
+for (CliFunctionResult result : functionResults) {
+  tabularData.accumulate("Member", result.getMemberIdOrName());
+  tabularData.accumulate("Status", result.getStatus());
+  // if one member returns back successful results, the command results in 
success
+  if (result.isSuccessful()) {
+success = true;
+  }
+}
+
+tabularData.setStatus(success ? Result.Status.OK : Result.Status.ERROR);
+return ResultBuilder.buildResult(tabularData);
+  }
 
 Review comment:
   Yes ..., maybe ...? for instance if a replicated region is being created on 
a server group, but failed on one member in the group, then UNTIL a new server 
comes up the replicated copies may not exist. Should/does a user get warned 
about this condition? The result of the command isn't what the user expected.
   
   However if we take the fact of the updated cluster config as the "truth", 
then your reasoning makes sense.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2017-12-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16280747#comment-16280747
 ] 

ASF GitHub Bot commented on GEODE-2668:
---

jinmeiliao commented on a change in pull request #1127:  GEODE-2668: build 
tabular command result from a list of function results 
URL: https://github.com/apache/geode/pull/1127#discussion_r155336622
 
 

 ##
 File path: 
geode-core/src/main/java/org/apache/geode/management/internal/cli/result/ResultBuilder.java
 ##
 @@ -188,6 +189,22 @@ public static CommandResult buildResult(ResultData 
resultData) {
 return new CommandResult(resultData);
   }
 
+  public static CommandResult buildResult(List 
functionResults) {
+TabularResultData tabularData = ResultBuilder.createTabularResultData();
+boolean success = false;
+for (CliFunctionResult result : functionResults) {
+  tabularData.accumulate("Member", result.getMemberIdOrName());
+  tabularData.accumulate("Status", result.getStatus());
+  // if one member returns back successful results, the command results in 
success
+  if (result.isSuccessful()) {
+success = true;
+  }
+}
+
+tabularData.setStatus(success ? Result.Status.OK : Result.Status.ERROR);
+return ResultBuilder.buildResult(tabularData);
+  }
 
 Review comment:
   Also, often times, the creation of a region (or any entity) would fail on 
only partial members because that member already has that region, so you will 
see results like:
   Member | Status
   server-0 | regionA successfully created
   server-1 | ERROR: failed to create the region because regionA already exists
   
   In this case, the command should still be deemed successful.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2017-12-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16280744#comment-16280744
 ] 

ASF GitHub Bot commented on GEODE-2668:
---

jinmeiliao commented on a change in pull request #1127:  GEODE-2668: build 
tabular command result from a list of function results 
URL: https://github.com/apache/geode/pull/1127#discussion_r155335924
 
 

 ##
 File path: 
geode-core/src/main/java/org/apache/geode/management/internal/cli/result/ResultBuilder.java
 ##
 @@ -188,6 +189,22 @@ public static CommandResult buildResult(ResultData 
resultData) {
 return new CommandResult(resultData);
   }
 
+  public static CommandResult buildResult(List 
functionResults) {
+TabularResultData tabularData = ResultBuilder.createTabularResultData();
+boolean success = false;
+for (CliFunctionResult result : functionResults) {
+  tabularData.accumulate("Member", result.getMemberIdOrName());
+  tabularData.accumulate("Status", result.getStatus());
+  // if one member returns back successful results, the command results in 
success
+  if (result.isSuccessful()) {
+success = true;
+  }
+}
+
+tabularData.setStatus(success ? Result.Status.OK : Result.Status.ERROR);
+return ResultBuilder.buildResult(tabularData);
+  }
 
 Review comment:
   yes, if the region is created on at least one member, because cluster config 
will be updated with this region, so when a new server comes up, it will have 
that region on the new server. That aspect makes me think this command should 
be deemed successful.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2017-12-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16280736#comment-16280736
 ] 

ASF GitHub Bot commented on GEODE-2668:
---

pdxrunner commented on a change in pull request #1127:  GEODE-2668: build 
tabular command result from a list of function results 
URL: https://github.com/apache/geode/pull/1127#discussion_r155335054
 
 

 ##
 File path: 
geode-core/src/main/java/org/apache/geode/management/internal/cli/result/ResultBuilder.java
 ##
 @@ -188,6 +189,22 @@ public static CommandResult buildResult(ResultData 
resultData) {
 return new CommandResult(resultData);
   }
 
+  public static CommandResult buildResult(List 
functionResults) {
+TabularResultData tabularData = ResultBuilder.createTabularResultData();
+boolean success = false;
+for (CliFunctionResult result : functionResults) {
+  tabularData.accumulate("Member", result.getMemberIdOrName());
+  tabularData.accumulate("Status", result.getStatus());
+  // if one member returns back successful results, the command results in 
success
+  if (result.isSuccessful()) {
+success = true;
+  }
+}
+
+tabularData.setStatus(success ? Result.Status.OK : Result.Status.ERROR);
+return ResultBuilder.buildResult(tabularData);
+  }
 
 Review comment:
   With regard to destroy region and create region commands. You're assuming 
that when destroying, if destroy succeeded on one, say, member1, then it may 
fail on member2 because with a distributed destroy the region may already have 
been destroyed before the function is executed on member2.
   
   However with create, the region is being created on a set of members, if 
creation succeeds on one member but fails on another, did the command really 
succeed?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2017-12-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16280731#comment-16280731
 ] 

ASF GitHub Bot commented on GEODE-2668:
---

PurelyApplied commented on a change in pull request #1127:  GEODE-2668: build 
tabular command result from a list of function results 
URL: https://github.com/apache/geode/pull/1127#discussion_r155334581
 
 

 ##
 File path: 
geode-core/src/main/java/org/apache/geode/management/internal/cli/result/ResultBuilder.java
 ##
 @@ -188,6 +189,22 @@ public static CommandResult buildResult(ResultData 
resultData) {
 return new CommandResult(resultData);
   }
 
+  public static CommandResult buildResult(List 
functionResults) {
+TabularResultData tabularData = ResultBuilder.createTabularResultData();
+boolean success = false;
+for (CliFunctionResult result : functionResults) {
+  tabularData.accumulate("Member", result.getMemberIdOrName());
+  tabularData.accumulate("Status", result.getStatus());
+  // if one member returns back successful results, the command results in 
success
+  if (result.isSuccessful()) {
+success = true;
+  }
+}
+
+tabularData.setStatus(success ? Result.Status.OK : Result.Status.ERROR);
+return ResultBuilder.buildResult(tabularData);
+  }
 
 Review comment:
   Ahh, that makes sense.  And the same holds for the indexing, etc?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2017-12-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16280728#comment-16280728
 ] 

ASF GitHub Bot commented on GEODE-2668:
---

jinmeiliao commented on a change in pull request #1127:  GEODE-2668: build 
tabular command result from a list of function results 
URL: https://github.com/apache/geode/pull/1127#discussion_r155334235
 
 

 ##
 File path: 
geode-core/src/main/java/org/apache/geode/management/internal/cli/result/ResultBuilder.java
 ##
 @@ -188,6 +189,22 @@ public static CommandResult buildResult(ResultData 
resultData) {
 return new CommandResult(resultData);
   }
 
+  public static CommandResult buildResult(List 
functionResults) {
+TabularResultData tabularData = ResultBuilder.createTabularResultData();
+boolean success = false;
+for (CliFunctionResult result : functionResults) {
+  tabularData.accumulate("Member", result.getMemberIdOrName());
+  tabularData.accumulate("Status", result.getStatus());
+  // if one member returns back successful results, the command results in 
success
+  if (result.isSuccessful()) {
+success = true;
+  }
+}
+
+tabularData.setStatus(success ? Result.Status.OK : Result.Status.ERROR);
+return ResultBuilder.buildResult(tabularData);
+  }
 
 Review comment:
   Before this change, there is a lot of differences on how to report these 
FunctionResults back from different members. Different command handles it 
differently. Some would ignore failures, even if all results came back as 
failed, it would still mark the command as successful. Some would mark the 
command as failed, but if one result came back with a valid xml, it will still 
use it to update cluster config. So hopefully, with this change, we can have 
some consistency. Even that means we will need to change how command report 
failure/success


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2017-12-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16280714#comment-16280714
 ] 

ASF GitHub Bot commented on GEODE-2668:
---

jinmeiliao commented on a change in pull request #1127:  GEODE-2668: build 
tabular command result from a list of function results 
URL: https://github.com/apache/geode/pull/1127#discussion_r155332887
 
 

 ##
 File path: 
geode-core/src/main/java/org/apache/geode/management/internal/cli/result/ResultBuilder.java
 ##
 @@ -188,6 +189,22 @@ public static CommandResult buildResult(ResultData 
resultData) {
 return new CommandResult(resultData);
   }
 
+  public static CommandResult buildResult(List 
functionResults) {
+TabularResultData tabularData = ResultBuilder.createTabularResultData();
+boolean success = false;
+for (CliFunctionResult result : functionResults) {
+  tabularData.accumulate("Member", result.getMemberIdOrName());
+  tabularData.accumulate("Status", result.getStatus());
+  // if one member returns back successful results, the command results in 
success
+  if (result.isSuccessful()) {
+success = true;
+  }
+}
+
+tabularData.setStatus(success ? Result.Status.OK : Result.Status.ERROR);
+return ResultBuilder.buildResult(tabularData);
+  }
 
 Review comment:
   region.destroy is a distributed action, unless scope is LOCAL. So a 
replicated/partitioned region, if destroy is successful on one member, then 
it's destroyed in the entire cluster. And if there is one successful result, we 
would get xmlEntity to update the cluster config. That alone would also make 
the command deemed successful.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2017-12-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16280690#comment-16280690
 ] 

ASF GitHub Bot commented on GEODE-2668:
---

PurelyApplied commented on a change in pull request #1127:  GEODE-2668: build 
tabular command result from a list of function results 
URL: https://github.com/apache/geode/pull/1127#discussion_r155328290
 
 

 ##
 File path: 
geode-core/src/test/java/org/apache/geode/management/internal/cli/functions/CliFunctionResultTest.java
 ##
 @@ -29,14 +29,20 @@
   private CliFunctionResult result;
 
   @Test
-  public void getErrorMessage() throws Exception {
+  public void getStatus() throws Exception {
 
 Review comment:
   I don't think the overlap is significant enough between each assignment and 
assertion here.  It deserves to be four `@Test`s.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2017-12-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16280686#comment-16280686
 ] 

ASF GitHub Bot commented on GEODE-2668:
---

PurelyApplied commented on a change in pull request #1127:  GEODE-2668: build 
tabular command result from a list of function results 
URL: https://github.com/apache/geode/pull/1127#discussion_r155322641
 
 

 ##
 File path: 
geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateGatewaySenderCommand.java
 ##
 @@ -96,64 +99,63 @@ public Result createGatewaySender(@CliOption(key = 
{CliStrings.GROUP, CliStrings
   @CliOption(key = CliStrings.CREATE_GATEWAYSENDER__ALERTTHRESHOLD,
   help = CliStrings.CREATE_GATEWAYSENDER__ALERTTHRESHOLD__HELP) 
Integer alertThreshold,
 
-  @CliOption(key = CliStrings.CREATE_GATEWAYSENDER__DISPATCHERTHREADS,
+  @CliOption(key = CREATE_GATEWAYSENDER__DISPATCHERTHREADS,
   help = CliStrings.CREATE_GATEWAYSENDER__DISPATCHERTHREADS__HELP) 
Integer dispatcherThreads,
 
-  @CliOption(key = CliStrings.CREATE_GATEWAYSENDER__ORDERPOLICY,
-  help = CliStrings.CREATE_GATEWAYSENDER__ORDERPOLICY__HELP) String 
orderPolicy,
+  @CliOption(key = CREATE_GATEWAYSENDER__ORDERPOLICY,
 
 Review comment:
   For consistency, either statically import all the used `CliString` fields or 
refer to all of them via the class.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2017-12-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16280695#comment-16280695
 ] 

ASF GitHub Bot commented on GEODE-2668:
---

PurelyApplied commented on a change in pull request #1127:  GEODE-2668: build 
tabular command result from a list of function results 
URL: https://github.com/apache/geode/pull/1127#discussion_r155330308
 
 

 ##
 File path: 
geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DestroyGatewaySenderCommandTest.java
 ##
 @@ -88,7 +88,7 @@ public void oneFunctionReturnsError() throws Exception {
 functionResults.add(result2);
 
 doReturn(mock(Set.class)).when(command).getMembers(any(), any());
-parser.executeAndAssertThat(command, "destroy gateway-sender 
--id=1").statusIsError()
+parser.executeAndAssertThat(command, "destroy gateway-sender 
--id=1").statusIsSuccess()
 
 Review comment:
   I'm confused as to why something displaying `ERROR: result2` is a successful 
execution.  I would be more inclined to say that any member error constitutes a 
command error, rather than any success constitutes command success.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2017-12-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16280694#comment-16280694
 ] 

ASF GitHub Bot commented on GEODE-2668:
---

PurelyApplied commented on a change in pull request #1127:  GEODE-2668: build 
tabular command result from a list of function results 
URL: https://github.com/apache/geode/pull/1127#discussion_r155327018
 
 

 ##
 File path: 
geode-core/src/main/java/org/apache/geode/management/internal/cli/result/ResultBuilder.java
 ##
 @@ -188,6 +189,22 @@ public static CommandResult buildResult(ResultData 
resultData) {
 return new CommandResult(resultData);
   }
 
+  public static CommandResult buildResult(List 
functionResults) {
+TabularResultData tabularData = ResultBuilder.createTabularResultData();
+boolean success = false;
+for (CliFunctionResult result : functionResults) {
+  tabularData.accumulate("Member", result.getMemberIdOrName());
+  tabularData.accumulate("Status", result.getStatus());
 
 Review comment:
   Changes in output aren't considered breaking changes, right?  If anyone is 
parsing output, this could throw them for a loop.
   
   Also will need to update documentation to reflect the new expected displays.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2017-12-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16280691#comment-16280691
 ] 

ASF GitHub Bot commented on GEODE-2668:
---

PurelyApplied commented on a change in pull request #1127:  GEODE-2668: build 
tabular command result from a list of function results 
URL: https://github.com/apache/geode/pull/1127#discussion_r155322158
 
 

 ##
 File path: 
geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateGatewaySenderCommand.java
 ##
 @@ -60,8 +62,9 @@ public Result createGatewaySender(@CliOption(key = 
{CliStrings.GROUP, CliStrings
   @CliOption(key = 
CliStrings.CREATE_GATEWAYSENDER__REMOTEDISTRIBUTEDSYSTEMID, mandatory = true,
   help = 
CliStrings.CREATE_GATEWAYSENDER__REMOTEDISTRIBUTEDSYSTEMID__HELP) Integer 
remoteDistributedSystemId,
 
 
 Review comment:
   While I personally like the readability of the extra spacing in a long list 
of `CliOption` arguments, it's counter to all our other `GfshCommand` classes.  
Would it be preferable to expand other commands or to collapse this one?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2017-12-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16280692#comment-16280692
 ] 

ASF GitHub Bot commented on GEODE-2668:
---

PurelyApplied commented on a change in pull request #1127:  GEODE-2668: build 
tabular command result from a list of function results 
URL: https://github.com/apache/geode/pull/1127#discussion_r155329081
 
 

 ##
 File path: 
geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/CreateDestroyGatewaySenderCommandDUnitTest.java
 ##
 @@ -0,0 +1,322 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+package org.apache.geode.internal.cache.wan.wancommand;
+
+import static 
org.apache.geode.distributed.ConfigurationProperties.DISTRIBUTED_SYSTEM_ID;
+import static 
org.apache.geode.distributed.ConfigurationProperties.REMOTE_LOCATORS;
+import static 
org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.verifySenderAttributes;
+import static 
org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.verifySenderNotExist;
+import static 
org.apache.geode.internal.cache.wan.wancommand.WANCommandUtils.verifySenderState;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import org.apache.geode.cache.wan.GatewaySender;
+import org.apache.geode.management.internal.cli.i18n.CliStrings;
+import org.apache.geode.test.dunit.rules.LocatorServerStartupRule;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.junit.categories.DistributedTest;
+import org.apache.geode.test.junit.rules.GfshCommandRule;
+
+@Category(DistributedTest.class)
+public class CreateDestroyGatewaySenderCommandDUnitTest {
+
+  public static final String CREATE =
+  "create gateway-sender --id=ln " + "--remote-distributed-system-id=2";
+  public static final String DESTROY = "destroy gateway-sender --id=ln ";
+
+  @ClassRule
+  public static LocatorServerStartupRule locatorServerStartupRule = new 
LocatorServerStartupRule();
+
+  @Rule
+  public GfshCommandRule gfsh = new GfshCommandRule();
+
+  private static MemberVM locatorSite1;
+  private static MemberVM server1;
+  private static MemberVM server2;
+  private static MemberVM server3;
+
+  @BeforeClass
+  public static void beforeClass() throws Exception {
+Properties props = new Properties();
+props.setProperty(DISTRIBUTED_SYSTEM_ID, "" + 1);
+locatorSite1 = locatorServerStartupRule.startLocatorVM(1, props);
+
+props.setProperty(DISTRIBUTED_SYSTEM_ID, "" + 2);
+props.setProperty(REMOTE_LOCATORS, "localhost[" + locatorSite1.getPort() + 
"]");
+locatorServerStartupRule.startLocatorVM(2, props);
+
+server1 = locatorServerStartupRule.startServerVM(3, "senderGroup1", 
locatorSite1.getPort());
+server2 = locatorServerStartupRule.startServerVM(4, 
locatorSite1.getPort());
+server3 = locatorServerStartupRule.startServerVM(5, 
locatorSite1.getPort());
+  }
+
+  @Before
+  public void before() throws Exception {
+gfsh.connectAndVerify(locatorSite1);
+  }
+
+  @After
+  public void after() {
+gfsh.executeAndAssertThat(DESTROY + " --if-exists").statusIsSuccess();
+  }
+
+  /**
+   * GatewaySender with all default attributes
+   */
+  @Test
+  public void testCreateDestroyGatewaySenderWithDefault() throws Exception {
+
gfsh.executeAndAssertThat(CREATE).statusIsSuccess().tableHasColumnWithExactValuesInAnyOrder(
+"Status", "GatewaySender \"ln\" created on \"server-3\"",
+"GatewaySender \"ln\" created on \"server-4\"",
+"GatewaySender \"ln\" created on \"server-5\"");
+
+MemberVM.invokeInEveryMember(() -> verifySenderState("ln", true, false), 
server1, server2,
+server3);
+
+locatorSite1.invoke(() -> {
+  String xml = 
LocatorServerStartupRule.getLocator().getSharedConfiguration()
+  .getConfiguration("cluster").getCacheXmlContent();
+  

[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2017-12-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16280687#comment-16280687
 ] 

ASF GitHub Bot commented on GEODE-2668:
---

PurelyApplied commented on a change in pull request #1127:  GEODE-2668: build 
tabular command result from a list of function results 
URL: https://github.com/apache/geode/pull/1127#discussion_r155318904
 
 

 ##
 File path: 
geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/AlterRegionCommand.java
 ##
 @@ -139,39 +133,22 @@ public Result alterRegion(
   new Object[] {evictionMax}));
 
 Review comment:
   Regarding the validation block:
   
   * I wouldn't mind seeing all the validation get its own method, just to 
detract less from the main intent of the function itself.
   * The `new Object[]{arg}` is redundant with the signature 
`CliStrings.format(String pattern, Object... arguments)`.  There's no need to 
construct the array.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2017-12-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16280693#comment-16280693
 ] 

ASF GitHub Bot commented on GEODE-2668:
---

PurelyApplied commented on a change in pull request #1127:  GEODE-2668: build 
tabular command result from a list of function results 
URL: https://github.com/apache/geode/pull/1127#discussion_r155329533
 
 

 ##
 File path: 
geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/WANCommandUtils.java
 ##
 @@ -208,24 +203,22 @@ public static void verifySenderAttributes(String 
senderId, int remoteDsID, boole
 }
   }
 
-  public static void verifySenderDestroyed(String senderId, boolean 
isParallel) {
+  public static void verifySenderNotExist(String senderId, boolean isParallel) 
{
 
 Review comment:
   I would go with `verifySenderDoesNotExist`.  Or maybe 
`verifySenderNotExists`.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2017-12-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16280689#comment-16280689
 ] 

ASF GitHub Bot commented on GEODE-2668:
---

PurelyApplied commented on a change in pull request #1127:  GEODE-2668: build 
tabular command result from a list of function results 
URL: https://github.com/apache/geode/pull/1127#discussion_r155321442
 
 

 ##
 File path: 
geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateGatewayReceiverCommand.java
 ##
 @@ -78,51 +79,50 @@ public Result createGatewayReceiver(@CliOption(key = 
{CliStrings.GROUP, CliStrin
   @CliOption(key = CliStrings.CREATE_GATEWAYRECEIVER__HOSTNAMEFORSENDERS,
   help = CliStrings.CREATE_GATEWAYRECEIVER__HOSTNAMEFORSENDERS__HELP) 
String hostnameForSenders) {
 
-Result result;
+GatewayReceiverFunctionArgs gatewayReceiverFunctionArgs =
+new GatewayReceiverFunctionArgs(manualStart, startPort, endPort, 
bindAddress,
+socketBufferSize, maximumTimeBetweenPings, 
gatewayTransportFilters, hostnameForSenders);
 
-AtomicReference xmlEntity = new AtomicReference<>();
-try {
-  GatewayReceiverFunctionArgs gatewayReceiverFunctionArgs = new 
GatewayReceiverFunctionArgs(
-  manualStart, startPort, endPort, bindAddress, socketBufferSize, 
maximumTimeBetweenPings,
-  gatewayTransportFilters, hostnameForSenders);
+Set membersToCreateGatewayReceiverOn =
+CliUtil.findMembers(onGroups, onMember);
 
-  Set membersToCreateGatewayReceiverOn =
-  CliUtil.findMembers(onGroups, onMember);
+if (membersToCreateGatewayReceiverOn.isEmpty()) {
+  return 
ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE);
 
 Review comment:
   I'm unclear on when we should return an error result vs raise an 
`IllegalArgumentException`.  Do we do the former here because it might not be 
the user's fault that no member was found?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2017-12-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16280688#comment-16280688
 ] 

ASF GitHub Bot commented on GEODE-2668:
---

PurelyApplied commented on a change in pull request #1127:  GEODE-2668: build 
tabular command result from a list of function results 
URL: https://github.com/apache/geode/pull/1127#discussion_r155327983
 
 

 ##
 File path: 
geode-core/src/test/java/org/apache/geode/management/internal/cli/functions/CliFunctionResultTest.java
 ##
 @@ -29,14 +29,20 @@
   private CliFunctionResult result;
 
 Review comment:
   There's no real reason for this to be a class field.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2017-12-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16280660#comment-16280660
 ] 

ASF GitHub Bot commented on GEODE-2668:
---

jinmeiliao commented on a change in pull request #1127:  GEODE-2668: build 
tabular command result from a list of function results 
URL: https://github.com/apache/geode/pull/1127#discussion_r155327158
 
 

 ##
 File path: 
geode-core/src/main/java/org/apache/geode/management/internal/cli/result/ResultBuilder.java
 ##
 @@ -188,6 +189,22 @@ public static CommandResult buildResult(ResultData 
resultData) {
 return new CommandResult(resultData);
   }
 
+  public static CommandResult buildResult(List 
functionResults) {
+TabularResultData tabularData = ResultBuilder.createTabularResultData();
+boolean success = false;
+for (CliFunctionResult result : functionResults) {
+  tabularData.accumulate("Member", result.getMemberIdOrName());
+  tabularData.accumulate("Status", result.getStatus());
+  // if one member returns back successful results, the command results in 
success
+  if (result.isSuccessful()) {
+success = true;
+  }
+}
+
+tabularData.setStatus(success ? Result.Status.OK : Result.Status.ERROR);
+return ResultBuilder.buildResult(tabularData);
+  }
 
 Review comment:
   right, as far as I see, this is the only case. (destroy region, create 
region, create index .). I think this promotes consistency.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2017-12-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16280662#comment-16280662
 ] 

ASF GitHub Bot commented on GEODE-2668:
---

jinmeiliao commented on issue #1127:  GEODE-2668: build tabular command result 
from a list of function results 
URL: https://github.com/apache/geode/pull/1127#issuecomment-349738361
 
 
   precheckin green


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2017-12-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16280483#comment-16280483
 ] 

ASF GitHub Bot commented on GEODE-2668:
---

pdxrunner commented on a change in pull request #1127:  GEODE-2668: build 
tabular command result from a list of function results 
URL: https://github.com/apache/geode/pull/1127#discussion_r155293906
 
 

 ##
 File path: 
geode-core/src/main/java/org/apache/geode/management/internal/cli/result/ResultBuilder.java
 ##
 @@ -188,6 +189,22 @@ public static CommandResult buildResult(ResultData 
resultData) {
 return new CommandResult(resultData);
   }
 
+  public static CommandResult buildResult(List 
functionResults) {
+TabularResultData tabularData = ResultBuilder.createTabularResultData();
+boolean success = false;
+for (CliFunctionResult result : functionResults) {
+  tabularData.accumulate("Member", result.getMemberIdOrName());
+  tabularData.accumulate("Status", result.getStatus());
+  // if one member returns back successful results, the command results in 
success
+  if (result.isSuccessful()) {
+success = true;
+  }
+}
+
+tabularData.setStatus(success ? Result.Status.OK : Result.Status.ERROR);
+return ResultBuilder.buildResult(tabularData);
+  }
 
 Review comment:
   There are two ways of determining command success, 1) If function succeeds 
on (at least) one member, then the command succeeds, 2) If function fails on 
(at least) one member, then the command fails.
   
   This implementation only supports case (1).


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GEODE-2668) Add gfsh command to destroy gateway receiver

2017-12-05 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16279753#comment-16279753
 ] 

ASF GitHub Bot commented on GEODE-2668:
---

jinmeiliao opened a new pull request #1127:  GEODE-2668: build tabular command 
result from a list of function results 
URL: https://github.com/apache/geode/pull/1127
 
 
   This includes 2 commits, one is general refactor to reduce code duplicates, 
one is to udpate cluster config when destroy gateway sender.
   
   Thank you for submitting a contribution to Apache Geode.
   
   In order to streamline the review of the contribution we ask you
   to ensure the following steps have been taken:
   
   ### For all changes:
   - [ ] Is there a JIRA ticket associated with this PR? Is it referenced in 
the commit message?
   
   - [ ] Has your PR been rebased against the latest commit within the target 
branch (typically `develop`)?
   
   - [ ] Is your initial contribution a single, squashed commit?
   
   - [ ] Does `gradlew build` run cleanly?
   
   - [ ] Have you written or updated unit tests to verify your changes?
   
   - [ ] If adding new dependencies to the code, are these dependencies 
licensed in a way that is compatible for inclusion under [ASF 
2.0](http://www.apache.org/legal/resolved.html#category-a)?
   
   ### Note:
   Please ensure that once the PR is submitted, you check travis-ci for build 
issues and
   submit an update to your PR as soon as possible. If you need help, please 
send an
   email to d...@geode.apache.org.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add gfsh command to destroy gateway receiver
> 
>
> Key: GEODE-2668
> URL: https://issues.apache.org/jira/browse/GEODE-2668
> Project: Geode
>  Issue Type: Sub-task
>  Components: docs, gfsh
>Reporter: Swapnil Bawaskar
>
> Currently, there is a {{create gateway-receiver}} command, but no 
> corresponding destroy command.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)