MCPcopy Create free account
hub / github.com/apache/impala / generate_schedule_item

Method generate_schedule_item

tests/comparison/leopard/controller.py:129–143  ·  view source on GitHub ↗

Generate a default schedule_item. This method should normally be called every few hours.

(self)

Source from the content-addressed store, hash-verified

127 sleep(SLEEP_LENGTH)
128
129 def generate_schedule_item(self):
130 '''Generate a default schedule_item. This method should normally be called every few
131 hours.
132 '''
133 if self.should_generate_new_item():
134 profile = ImpalaNestedTypesProfile() if NESTED_TYPES_MODE else DefaultProfile()
135 schedule_item = ScheduleItem(
136 run_name = '{0}-{1}'.format(strftime(
137 "%Y-%b-%d-%H:%M:%S", localtime()), DEFAULT_RUN_NAME),
138 query_profile=profile,
139 time_limit_sec=RUN_TIME_LIMIT)
140 schedule_item.save_pickle()
141 self.time_last_generated = time.time()
142 LOG.info('Generated Schedule Item')
143 sleep(2)
144
145 def should_generate_new_item(self):
146 '''Returns true if a new item should be generated.

Callers 1

runMethod · 0.95

Calls 6

save_pickleMethod · 0.95
DefaultProfileClass · 0.90
ScheduleItemClass · 0.90
formatMethod · 0.45

Tested by

no test coverage detected