[
https://issues.apache.org/jira/browse/GEODE-3283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16151005#comment-16151005
]
ASF GitHub Bot commented on GEODE-3283:
---------------------------------------
Github user nreich commented on a diff in the pull request:
https://github.com/apache/geode/pull/753#discussion_r136641632
--- Diff:
geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportDataCommand.java
---
@@ -87,4 +80,45 @@ public Result exportData(
}
return result;
}
+
+ private Result getFunctionResult(ResultCollector<?, ?> rc) {
+ Result result;
+ List<Object> results = (List<Object>) rc.getResult();
+ if (results != null) {
+ Object resultObj = results.get(0);
+ if (resultObj instanceof String) {
+ result = ResultBuilder.createInfoResult((String) resultObj);
+ } else if (resultObj instanceof Exception) {
+ result = ResultBuilder.createGemFireErrorResult(((Exception)
resultObj).getMessage());
+ } else {
+ result = ResultBuilder.createGemFireErrorResult(
+ CliStrings.format(CliStrings.COMMAND_FAILURE_MESSAGE,
CliStrings.EXPORT_DATA));
+ }
+ } else {
+ result = ResultBuilder.createGemFireErrorResult(
+ CliStrings.format(CliStrings.COMMAND_FAILURE_MESSAGE,
CliStrings.EXPORT_DATA));
+ }
+ return result;
+ }
+
+ private String defaultFileName(String dirPath, String regionName) {
+ return new File(dirPath, regionName +
RegionSnapshotService.SNAPSHOT_FILE_EXTENSION)
+ .getAbsolutePath();
+ }
+
+ private Optional<Result> validatePath(String filePath, String dirPath,
boolean parallel) {
--- End diff --
I thought about having them both extend the same abstract base class: that
would remove the duplicate code. The method is not dependant on state of the
object, so it could be extracted into a static helper method (suggestions on
where would be best to put it if this route is desirable?).
> Add gfsh option on export/import to parallelize a snapshot for PRs
> ------------------------------------------------------------------
>
> Key: GEODE-3283
> URL: https://issues.apache.org/jira/browse/GEODE-3283
> Project: Geode
> Issue Type: Sub-task
> Components: snapshot
> Reporter: Fred Krone
> Assignee: Nick Reich
>
> This is related to another ticket to improve snapshot export time
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)