Repository: geode Updated Branches: refs/heads/feature/GEODE-2420 9ad65d6a3 -> abc0dd2fe
Add initial todo comment Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/abc0dd2f Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/abc0dd2f Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/abc0dd2f Branch: refs/heads/feature/GEODE-2420 Commit: abc0dd2fec9fac8a2408585bda551bc93aef6ab8 Parents: 9ad65d6 Author: Kirk Lund <[email protected]> Authored: Wed Mar 8 13:31:13 2017 -0800 Committer: Kirk Lund <[email protected]> Committed: Wed Mar 8 13:31:13 2017 -0800 ---------------------------------------------------------------------- .../internal/cli/commands/ExportLogCommand.java | 21 +++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/geode/blob/abc0dd2f/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportLogCommand.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportLogCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportLogCommand.java index 36d071c..c293c33 100644 --- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportLogCommand.java +++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportLogCommand.java @@ -30,6 +30,7 @@ import org.apache.geode.management.internal.cli.GfshParseResult; import org.apache.geode.management.internal.cli.functions.ExportLogsFunction; 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.shell.Gfsh; import org.apache.geode.management.internal.cli.util.ExportLogsCacheWriter; import org.apache.geode.management.internal.configuration.utils.ZipUtils; import org.apache.geode.management.internal.security.ResourceOperation; @@ -51,9 +52,9 @@ import java.util.Map; import java.util.Set; public class ExportLogCommand implements CommandMarker { - public final static String FORMAT = "yyyy/MM/dd/HH/mm/ss/SSS/z"; - public final static String ONLY_DATE_FORMAT = "yyyy/MM/dd"; - private final static Logger logger = LogService.getLogger(); + private static final Logger logger = LogService.getLogger(); + public static final String FORMAT = "yyyy/MM/dd/HH/mm/ss/SSS/z"; + public static final String ONLY_DATE_FORMAT = "yyyy/MM/dd"; @CliCommand(value = CliStrings.EXPORT_LOGS, help = CliStrings.EXPORT_LOGS__HELP) @CliMetaData(shellOnly = false, isFileDownloadOverHttp = true, @@ -142,6 +143,12 @@ public class ExportLogCommand implements CommandMarker { logger.info("Zipping into: " + exportedLogsZipFile.toString()); ZipUtils.zipDirectory(exportedLogsDir, exportedLogsZipFile); FileUtils.deleteDirectory(tempDir.toFile()); + + // TODO:GEODE-2420: warn user if exportedLogsZipFile size > threshold + if (isOverDiskSpaceThreshold()) { + // append warning to exportedLogsZipFile.toString()?? + } + result = ResultBuilder.createInfoResult(exportedLogsZipFile.toString()); } catch (Exception ex) { logger.error(ex, ex); @@ -153,6 +160,14 @@ public class ExportLogCommand implements CommandMarker { return result; } + protected static Gfsh getGfsh() { + return Gfsh.getCurrentInstance(); + } + + boolean isOverDiskSpaceThreshold() { + return false; + } + /** * after the export logs, will need to copy the tempFile to the desired location and delete the * temp file.
