From 071b490d330e4cd16aa5c8ee385875ea3b2c98bd Mon Sep 17 00:00:00 2001 From: Liang Tian Date: Thu, 15 Sep 2022 16:37:43 -0700 Subject: [PATCH] add comments to clarify the memory related field stored in DB has unit of MB, instead of Bytes --- .../web/data/services/impl/jpa/entities/CommandEntity.java | 2 ++ .../genie/web/data/services/impl/jpa/entities/JobEntity.java | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/genie-web/src/main/java/com/netflix/genie/web/data/services/impl/jpa/entities/CommandEntity.java b/genie-web/src/main/java/com/netflix/genie/web/data/services/impl/jpa/entities/CommandEntity.java index 9e23eb20db..eda1674f20 100644 --- a/genie-web/src/main/java/com/netflix/genie/web/data/services/impl/jpa/entities/CommandEntity.java +++ b/genie-web/src/main/java/com/netflix/genie/web/data/services/impl/jpa/entities/CommandEntity.java @@ -206,6 +206,8 @@ public class CommandEntity extends BaseEntity { private Integer gpu; @Column(name = "memory") + // Memory that stored in DB has data type of Integer and unit type of MB. If the memory retrieved from db + // is 2048, it means 2048 MB, NOT 2048 Bytes. @Convert(converter = IntegerToLongConverter.class) @Min(1) private Long memory; diff --git a/genie-web/src/main/java/com/netflix/genie/web/data/services/impl/jpa/entities/JobEntity.java b/genie-web/src/main/java/com/netflix/genie/web/data/services/impl/jpa/entities/JobEntity.java index 2accd101a1..cef49cf628 100644 --- a/genie-web/src/main/java/com/netflix/genie/web/data/services/impl/jpa/entities/JobEntity.java +++ b/genie-web/src/main/java/com/netflix/genie/web/data/services/impl/jpa/entities/JobEntity.java @@ -365,11 +365,15 @@ public class JobEntity extends BaseEntity implements private Integer gpuUsed; @Column(name = "requested_memory", updatable = false) + // Memory that stored in DB has data type of Integer and unit type of MB. If the requestedMemory retrieved from db + // is 2048, it means 2048 MB, NOT 2048 Bytes. @Convert(converter = IntegerToLongConverter.class) @Min(value = 1, message = "Can't have less than 1 MB of memory allocated") private Long requestedMemory; @Column(name = "memory_used") + // Memory that stored in DB has data type of Integer and unit type of MB. If the memoryUsed retrieved from db + // is 2048, it means 2048 MB, NOT 2048 Bytes. @Convert(converter = IntegerToLongConverter.class) @Min(value = 1, message = "Can't have less than 1 MB of memory allocated") private Long memoryUsed;