MCPcopy Create free account
hub / github.com/apache/pig / get_next_input

Method get_next_input

src/python/streaming/controller.py:158–184  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

156 input_str = self.get_next_input()
157
158 def get_next_input(self):
159 input_stream = self.input_stream
160 output_stream = self.output_stream
161
162 input_str = input_stream.readline()
163
164 while input_str.endswith(END_RECORD_DELIM) == False:
165 line = input_stream.readline()
166 if line == '':
167 input_str = ''
168 break
169 input_str += line
170
171 if input_str == '':
172 return END_OF_STREAM
173
174 if input_str == TURN_ON_OUTPUT_CAPTURING:
175 logging.debug("Turned on Output Capturing")
176 sys.stdout = output_stream
177 return self.get_next_input()
178
179 if input_str == END_OF_STREAM:
180 return input_str
181
182 self.input_count += 1
183
184 return input_str[:-END_RECORD_DELIM_LENGTH]
185
186 def update_next_input_count_to_log(self):
187 """

Callers 3

mainMethod · 0.95

Calls 1

debugMethod · 0.80

Tested by 2