Github user jinmeiliao commented on a diff in the pull request:

    https://github.com/apache/geode/pull/753#discussion_r136638194
  
    --- 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 --
    
    this seems to be duplicated between import/export, any way we can use the 
same code base?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to