Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from typing import Dict
- from ja.common.message.base import Serializable
- from sqlalchemy import Column, Integer, ForeignKey, String
- from sqlalchemy.orm import relationship
- from ja.server.database.sql.base import Base
- class ResourceAllocation(Base):
- __tablename__ = "resource_allocation"
- id = Column(Integer, primary_key=True)
- cpu_threads = Column(Integer)
- memory = Column(Integer)
- swap = Column(Integer)
- """
- Represents a group of resources on a work machine.
- """
- def __init__(self, cpu_threads: int, memory: int, swap: int):
- """!
- Create the ResourceAllocation object.
- @param cpu_threads The amount of CPU threads.
- @param memory The amount of RAM, in MB.
- @param swap The amount of swap space, in MB.
- """
- self._cpu_threads = cpu_threads
- self._memory = memory
- self._swap = swap
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement