HCE Project Python language Distributed Tasks Manager Application, Distributed Crawler Application and client API bindings.  2.0.0-chaika
Hierarchical Cluster Engine Python language binding
dtm.EventObjects.DeleteTask Class Reference

DeleteTask event object, to delete task from DTM application and from EE. More...

Inheritance diagram for dtm.EventObjects.DeleteTask:
Collaboration diagram for dtm.EventObjects.DeleteTask:

Public Member Functions

def __init__ (self, deleteTaskId, taskId=None)
 constructor initialize task's fields More...
 
def toJSON (self)
 
- Public Member Functions inherited from dtm.EventObjects.Task
def __init__ (self)
 constructor initialize task's fields More...
 
def setSessionVar (self, sessionVarName, sessionVarValue)
 Set the OS session variable for EE process. More...
 
def setStrategyVar (self, strategyVarName, strategyVarValue)
 Set the strategy variable. More...
 
def setFile (self, fileItem)
 Set the file item. More...
 
def setLimitsVar (self, limitsVarName, limitsVarValue)
 Set the limits variable. More...
 

Public Attributes

 id
 The task Id. More...
 
 deleteTaskId
 
 alg
 The algorithm of task termination in the EE. More...
 
 delay
 The delay of task termination in the EE. More...
 
 repeat
 The repeat of task termination in the EE. More...
 
 signal
 The signal it is a UNIX signal used to terminate task process in the EE. More...
 
 host
 The host name or IP address of task process HCE node in the EE. More...
 
 port
 The TCP port of the HCE node admin interface for the task process in the EE. More...
 
 action
 
 strategy
 The task strategy items init. More...
 
 name
 
- Public Attributes inherited from dtm.EventObjects.Task
 id
 The task Id. More...
 
 command
 The task command line to execute inside EE. More...
 
 input
 The task cstdin stream buffer for EE process. More...
 
 files
 The task files items attached init. More...
 
 session
 The task session items init. More...
 
 strategy
 The task strategy items init. More...
 
 limits
 The task limits init. More...
 
 autoCleanupFields
 The task autoCleanupFields init. More...
 
 type
 The task type init. More...
 
 name
 The task name init. More...
 

Static Public Attributes

int GROUP_DELETE = -1
 
int RESPONSE_CODE_DBI_ERROR = 1
 
int RESPONSE_CODE_UNKNOWN_ERROR = 2
 
int RESPONSE_CODE_DRCE_ERROR = 3
 
int TERMINATE_ALG_DEFAULT = 1
 
int TERMINATE_ALG_CUSTOM = 2
 
int TERMINATE_DELAY_DEFAULT = 1000
 
int TERMINATE_REPEAT_DEFAULT = 3
 
int TERMINATE_SIGTERM = 15
 
int TERMINATE_SIGKILL = 9
 
int ACTION_DELETE_TASK_DATA = 0
 
int ACTION_TERMINATE_TASK_AND_DELETE_DATA = 1
 
int ACTION_TERMINATE_TASK_ONLY = 2
 
int ACTION_DELETE_ON_DTM = 3
 
string DEFAULT_TASK_NAME = "DELETE"
 
- Static Public Attributes inherited from dtm.EventObjects.Task
int FILE_ACTION_CREATE_BEFORE = 1
 
int FILE_ACTION_DELETE_BEFORE = 2
 
int FILE_ACTION_READ_AFTER = 4
 
int FILE_ACTION_DELETE_AFTER = 8
 
int FILE_ACTION_BASE64_ENCODED = 2147483648
 
string STRATEGY_DATE = "DATE"
 
string STRATEGY_DATE_MAX = "DATE_MAX"
 
string STRATEGY_DATE_SHIFT = "DATE_SHIFT"
 
string STRATEGY_CPU = "CPU"
 
string STRATEGY_RAM_FREE = "RAM_FREE"
 
string STRATEGY_RAM = "RAM"
 
string STRATEGY_DISK_FREE = "DISK_FREE"
 
string STRATEGY_DISK = "DISK"
 
string STRATEGY_TIME = "TIME"
 
string STRATEGY_THREADS = "THREADS"
 
string STRATEGY_SDELAY = "SDELAY"
 
string STRATEGY_RDELAY = "RDELAY"
 
string STRATEGY_RETRY = "RETRY"
 
string STRATEGY_PRIORITY = "PRIORITY"
 
string STRATEGY_CPU_LOAD_MAX = "CPU_LOAD_MAX"
 
string STRATEGY_IO_WAIT_MAX = "IO_WAIT_MAX"
 
string STRATEGY_autoCleanupFields = "autoCleanupFields"
 
string STRATEGY_AUTOCLEANUP_TTL = "TTL"
 
string STRATEGY_AUTOCLEANUP_DELETE_TYPE = "DeleteType"
 
string STRATEGY_AUTOCLEANUP_DELETE_RETRIES = "DeleteRetries"
 
string STRATEGY_AUTOCLEANUP_SSTATE = "State"
 
int TASK_MODE_SYNCH = 1
 
int TASK_MODE_ASYNCH = 2
 
int TIME_MAX_DEFAULT = 60000
 
int TASK_TYPE_SHELL = 0
 
int TASK_TYPE_SSH = 1
 
int TYPE_DEFAULT = 0
 

Detailed Description

DeleteTask event object, to delete task from DTM application and from EE.

The DeleteTask object used to completely delete all task(s)-related data inside DTM application and EE. If the task is in progress, it will be terminated and result data will be deleted.

Definition at line 429 of file EventObjects.py.

Constructor & Destructor Documentation

◆ __init__()

def dtm.EventObjects.DeleteTask.__init__ (   self,
  deleteTaskId,
  taskId = None 
)

constructor initialize task's fields

Parameters
taskIdThe task Id to delete.

Definition at line 457 of file EventObjects.py.

457  def __init__(self, deleteTaskId, taskId=None):
458  super(DeleteTask, self).__init__()
459 
461  if taskId is None:
462  idGenerator = IDGenerator()
463  self.id = ctypes.c_uint32(zlib.crc32(idGenerator.get_connection_uid(), int(time.time()))).value
464  else:
465  self.id = taskId
466  #Strategy priority init
467  self.setStrategyVar(self.STRATEGY_PRIORITY, 1)
468  #The task Id to delete, used for EE request TERMINATE task
469  self.deleteTaskId = deleteTaskId
470 
472  self.alg = self.TERMINATE_ALG_DEFAULT
473 
475  self.delay = self.TERMINATE_DELAY_DEFAULT
476 
478  self.repeat = self.TERMINATE_REPEAT_DEFAULT
479 
481  self.signal = self.TERMINATE_SIGTERM
482 
484  self.host = ""
485 
487  self.port = 0
488  # Action that will be performed on EEManager, default only delete task's data on EE and delete task on DTM
489  # - this is possible only for tasks in proper state (that is not in active states)
490  self.action = self.ACTION_DELETE_TASK_DATA
491 
493  self.strategy = {}
494  #TODO: possible find the way to define decorator
495  #@property
496  #def id(self):
497  # return self.id
498 
499  #@id.setter
500  #def id(self, value):
501  # self.deleteTaskId = value
502  self.name = self.DEFAULT_TASK_NAME
503 
def __init__(self)
constructor
Definition: UIDGenerator.py:19

Member Function Documentation

◆ toJSON()

def dtm.EventObjects.DeleteTask.toJSON (   self)

Definition at line 504 of file EventObjects.py.

504  def toJSON(self):
505  return json.dumps(self, default=lambda o: o.__dict__, sort_keys=True, indent=4)
506 
507 
508 

Member Data Documentation

◆ action

dtm.EventObjects.DeleteTask.action

Definition at line 490 of file EventObjects.py.

◆ ACTION_DELETE_ON_DTM

int dtm.EventObjects.DeleteTask.ACTION_DELETE_ON_DTM = 3
static

Definition at line 449 of file EventObjects.py.

◆ ACTION_DELETE_TASK_DATA

int dtm.EventObjects.DeleteTask.ACTION_DELETE_TASK_DATA = 0
static

Definition at line 446 of file EventObjects.py.

◆ ACTION_TERMINATE_TASK_AND_DELETE_DATA

int dtm.EventObjects.DeleteTask.ACTION_TERMINATE_TASK_AND_DELETE_DATA = 1
static

Definition at line 447 of file EventObjects.py.

◆ ACTION_TERMINATE_TASK_ONLY

int dtm.EventObjects.DeleteTask.ACTION_TERMINATE_TASK_ONLY = 2
static

Definition at line 448 of file EventObjects.py.

◆ alg

dtm.EventObjects.DeleteTask.alg

The algorithm of task termination in the EE.

Definition at line 472 of file EventObjects.py.

◆ DEFAULT_TASK_NAME

string dtm.EventObjects.DeleteTask.DEFAULT_TASK_NAME = "DELETE"
static

Definition at line 451 of file EventObjects.py.

◆ delay

dtm.EventObjects.DeleteTask.delay

The delay of task termination in the EE.

Definition at line 475 of file EventObjects.py.

◆ deleteTaskId

dtm.EventObjects.DeleteTask.deleteTaskId

Definition at line 469 of file EventObjects.py.

◆ GROUP_DELETE

int dtm.EventObjects.DeleteTask.GROUP_DELETE = -1
static

Definition at line 431 of file EventObjects.py.

◆ host

dtm.EventObjects.DeleteTask.host

The host name or IP address of task process HCE node in the EE.

Definition at line 484 of file EventObjects.py.

◆ id

dtm.EventObjects.DeleteTask.id

The task Id.

Definition at line 463 of file EventObjects.py.

◆ name

dtm.EventObjects.DeleteTask.name

Definition at line 502 of file EventObjects.py.

◆ port

dtm.EventObjects.DeleteTask.port

The TCP port of the HCE node admin interface for the task process in the EE.

Definition at line 487 of file EventObjects.py.

◆ repeat

dtm.EventObjects.DeleteTask.repeat

The repeat of task termination in the EE.

Definition at line 478 of file EventObjects.py.

◆ RESPONSE_CODE_DBI_ERROR

int dtm.EventObjects.DeleteTask.RESPONSE_CODE_DBI_ERROR = 1
static

Definition at line 433 of file EventObjects.py.

◆ RESPONSE_CODE_DRCE_ERROR

int dtm.EventObjects.DeleteTask.RESPONSE_CODE_DRCE_ERROR = 3
static

Definition at line 435 of file EventObjects.py.

◆ RESPONSE_CODE_UNKNOWN_ERROR

int dtm.EventObjects.DeleteTask.RESPONSE_CODE_UNKNOWN_ERROR = 2
static

Definition at line 434 of file EventObjects.py.

◆ signal

dtm.EventObjects.DeleteTask.signal

The signal it is a UNIX signal used to terminate task process in the EE.

Definition at line 481 of file EventObjects.py.

◆ strategy

dtm.EventObjects.DeleteTask.strategy

The task strategy items init.

Definition at line 493 of file EventObjects.py.

◆ TERMINATE_ALG_CUSTOM

int dtm.EventObjects.DeleteTask.TERMINATE_ALG_CUSTOM = 2
static

Definition at line 438 of file EventObjects.py.

◆ TERMINATE_ALG_DEFAULT

int dtm.EventObjects.DeleteTask.TERMINATE_ALG_DEFAULT = 1
static

Definition at line 437 of file EventObjects.py.

◆ TERMINATE_DELAY_DEFAULT

int dtm.EventObjects.DeleteTask.TERMINATE_DELAY_DEFAULT = 1000
static

Definition at line 440 of file EventObjects.py.

◆ TERMINATE_REPEAT_DEFAULT

int dtm.EventObjects.DeleteTask.TERMINATE_REPEAT_DEFAULT = 3
static

Definition at line 441 of file EventObjects.py.

◆ TERMINATE_SIGKILL

int dtm.EventObjects.DeleteTask.TERMINATE_SIGKILL = 9
static

Definition at line 444 of file EventObjects.py.

◆ TERMINATE_SIGTERM

int dtm.EventObjects.DeleteTask.TERMINATE_SIGTERM = 15
static

Definition at line 443 of file EventObjects.py.


The documentation for this class was generated from the following file: