Skip to content

Commit

Permalink
add comments to clarify the memory related field stored in DB has uni…
Browse files Browse the repository at this point in the history
…t of MB, instead of Bytes
  • Loading branch information
enicloom committed Sep 16, 2022
1 parent c79bf43 commit 071b490
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 071b490

Please sign in to comment.