geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [05/33] geode git commit: GEODE-2420: Renamed methods that had signatures changed
Date Tue, 23 May 2017 22:39:10 GMT
GEODE-2420: Renamed methods that had signatures changed

Updated javadocs for the renamed methods to explicitly call out the
exceptions thrown


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/adbdf50f
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/adbdf50f
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/adbdf50f

Branch: refs/heads/feature/GEODE-2632-17
Commit: adbdf50f1a5986e5c75b47184f547a3e0d78f0e2
Parents: c5962aa
Author: Ken Howe <khowe@pivotal.io>
Authored: Tue May 23 09:40:27 2017 -0700
Committer: Ken Howe <khowe@pivotal.io>
Committed: Tue May 23 09:42:36 2017 -0700

----------------------------------------------------------------------
 .../internal/cli/commands/ExportLogsCommand.java   | 17 +++++++++--------
 .../cli/commands/ExportLogsCommandTest.java        |  9 ++++-----
 .../cli/commands/ExportLogsFileSizeLimitTest.java  |  7 +++----
 3 files changed, 16 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/adbdf50f/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommand.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommand.java
b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommand.java
index ab93f94..b824bc9 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommand.java
@@ -142,7 +142,7 @@ public class ExportLogsCommand implements CommandMarker {
         // The sum of the estimated export sizes from each member should not exceed the
         // disk available on the locator
         try {
-          sizeCheckIsEnabledAndWithinDiskSpaceOfMember("locator", parseFileSizeLimit(fileSizeLimit),
+          checkIfExportLogsOverflowsDisk("locator", parseFileSizeLimit(fileSizeLimit),
               totalEstimatedExportSize, getLocalDiskAvailable());
         } catch (ManagementException e) {
           return ResultBuilder.createUserErrorResult(e.getMessage());
@@ -201,8 +201,7 @@ public class ExportLogsCommand implements CommandMarker {
       logger.info("Zipping into: " + exportedLogsZipFile.toString());
       ZipUtils.zipDirectory(exportedLogsDir, exportedLogsZipFile);
       try {
-        isFileSizeCheckEnabledAndWithinLimit(parseFileSizeLimit(fileSizeLimit),
-            exportedLogsZipFile.toFile());
+        checkFileSizeWithinLimit(parseFileSizeLimit(fileSizeLimit), exportedLogsZipFile.toFile());
       } catch (ManagementException e) {
         FileUtils.deleteQuietly(exportedLogsZipFile.toFile());
         return ResultBuilder.createUserErrorResult(e.getMessage());
@@ -263,9 +262,10 @@ public class ExportLogsCommand implements CommandMarker {
   }
 
   /**
-   * Throws ManagementException if file size is over fileSizeLimit bytes
+   * @throws ManagementException if checking is enabled (fileSizeLimit > 0) and file size
is over
+   *         fileSizeLimit bytes
    */
-  void isFileSizeCheckEnabledAndWithinLimit(long fileSizeLimitBytes, File file) {
+  void checkFileSizeWithinLimit(long fileSizeLimitBytes, File file) {
     if (fileSizeLimitBytes > 0) {
       if (FileUtils.sizeOf(file) > fileSizeLimitBytes) {
         StringBuilder sb = new StringBuilder();
@@ -280,10 +280,11 @@ public class ExportLogsCommand implements CommandMarker {
 
 
   /**
-   * Throws ManagementException if export file size checking is enabled and the space required
on a
-   * cluster member to filter and zip up files to be exported exceeds the disk space available
+   * @throws ManagementException if export file size checking is enabled (fileSizeLimit >
0) and the
+   *         space required on a cluster member to filter and zip up files to be exported
exceeds
+   *         the disk space available
    */
-  void sizeCheckIsEnabledAndWithinDiskSpaceOfMember(String memberName, long fileSizeLimitBytes,
+  void checkIfExportLogsOverflowsDisk(String memberName, long fileSizeLimitBytes,
       long estimatedSize, long diskAvailable) {
     if (fileSizeLimitBytes > 0) {
       StringBuilder sb = new StringBuilder();

http://git-wip-us.apache.org/repos/asf/geode/blob/adbdf50f/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommandTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommandTest.java
b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommandTest.java
index 8888a91..16549e7 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommandTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommandTest.java
@@ -127,7 +127,7 @@ public class ExportLogsCommandTest {
     final Execution mockFunctionExecutor = mock(Execution.class);
     final ExportLogsCommand cmd =
         createExportLogsCommand(mockCache, mockDistributedMember, mockFunctionExecutor);
-    cmd.sizeCheckIsEnabledAndWithinDiskSpaceOfMember("clusterMember", 0, MEGABYTE + 1024,
MEGABYTE);
+    cmd.checkIfExportLogsOverflowsDisk("clusterMember", 0, MEGABYTE + 1024, MEGABYTE);
   }
 
   @Test
@@ -137,8 +137,7 @@ public class ExportLogsCommandTest {
     final Execution mockFunctionExecutor = mock(Execution.class);
     final ExportLogsCommand cmd =
         createExportLogsCommand(mockCache, mockDistributedMember, mockFunctionExecutor);
-    cmd.sizeCheckIsEnabledAndWithinDiskSpaceOfMember("clusterMember", 10 * MEGABYTE,
-        MEGABYTE - 1024, MEGABYTE);
+    cmd.checkIfExportLogsOverflowsDisk("clusterMember", 10 * MEGABYTE, MEGABYTE - 1024, MEGABYTE);
   }
 
   @Test
@@ -148,8 +147,8 @@ public class ExportLogsCommandTest {
     final Execution mockFunctionExecutor = mock(Execution.class);
     final ExportLogsCommand cmd =
         createExportLogsCommand(mockCache, mockDistributedMember, mockFunctionExecutor);
-    assertThatThrownBy(() -> cmd.sizeCheckIsEnabledAndWithinDiskSpaceOfMember("clusterMember",
-        10 * MEGABYTE, MEGABYTE + 1024, MEGABYTE)).isInstanceOf(ManagementException.class);
+    assertThatThrownBy(() -> cmd.checkIfExportLogsOverflowsDisk("clusterMember", 10 *
MEGABYTE,
+        MEGABYTE + 1024, MEGABYTE)).isInstanceOf(ManagementException.class);
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/geode/blob/adbdf50f/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ExportLogsFileSizeLimitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ExportLogsFileSizeLimitTest.java
b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ExportLogsFileSizeLimitTest.java
index 4ab88b6..09ee08d 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ExportLogsFileSizeLimitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ExportLogsFileSizeLimitTest.java
@@ -53,8 +53,7 @@ public class ExportLogsFileSizeLimitTest {
 
     ExportLogsCommand exportLogsCommand = new ExportLogsCommand();
 
-    assertThatThrownBy(
-        () -> exportLogsCommand.isFileSizeCheckEnabledAndWithinLimit(MEGABYTE, file));
+    assertThatThrownBy(() -> exportLogsCommand.checkFileSizeWithinLimit(MEGABYTE, file));
   }
 
   @Test
@@ -64,7 +63,7 @@ public class ExportLogsFileSizeLimitTest {
 
     ExportLogsCommand exportLogsCommand = new ExportLogsCommand();
 
-    exportLogsCommand.isFileSizeCheckEnabledAndWithinLimit(MEGABYTE, file);
+    exportLogsCommand.checkFileSizeWithinLimit(MEGABYTE, file);
   }
 
   @Test
@@ -74,7 +73,7 @@ public class ExportLogsFileSizeLimitTest {
 
     ExportLogsCommand exportLogsCommand = new ExportLogsCommand();
 
-    exportLogsCommand.isFileSizeCheckEnabledAndWithinLimit(0, file);
+    exportLogsCommand.checkFileSizeWithinLimit(0, file);
   }
 
   private void fillUpFile(File file, long sizeInBytes) throws IOException {


Mime
View raw message