Advertisement
Guest User

Untitled

a guest
Jan 21st, 2020
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.89 KB | None | 0 0
  1. from typing import Dict
  2.  
  3. from ja.common.message.base import Serializable
  4. from sqlalchemy import Column, Integer, ForeignKey, String
  5. from sqlalchemy.orm import relationship
  6. from ja.server.database.sql.base import Base
  7.  
  8.  
  9. class ResourceAllocation(Base):
  10.     __tablename__ = "resource_allocation"
  11.  
  12.     id = Column(Integer, primary_key=True)
  13.     cpu_threads = Column(Integer)
  14.     memory = Column(Integer)
  15.     swap = Column(Integer)
  16.     """
  17.    Represents a group of resources on a work machine.
  18.    """
  19.  
  20.     def __init__(self, cpu_threads: int, memory: int, swap: int):
  21.         """!
  22.        Create the ResourceAllocation object.
  23.  
  24.        @param cpu_threads The amount of CPU threads.
  25.        @param memory The amount of RAM, in MB.
  26.        @param swap The amount of swap space, in MB.
  27.        """
  28.         self._cpu_threads = cpu_threads
  29.         self._memory = memory
  30.         self._swap = swap
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement