@@ -51,11 +51,17 @@ def _dict_printable_fields(dict_object, skip_fields):
5151 'compression_type' ]
5252
5353
54- class Source (object ):
55- """Generic source."""
54+ class NativeSource (object ):
55+ """A source implemented by Dataflow service.
56+
57+ This class is to be only inherited by sources natively implemented by Cloud
58+ Dataflow service, hence should not be sub-classed by users.
59+
60+ This class is deprecated and should not be used to define new sources.
61+ """
5662
5763 def reader (self ):
58- """Returns a SourceReader instance associated with this source."""
64+ """Returns a NativeSourceReader instance associated with this source."""
5965 raise NotImplementedError
6066
6167 def __repr__ (self ):
@@ -65,8 +71,8 @@ def __repr__(self):
6571 _minor_fields )))
6672
6773
68- class SourceReader (object ):
69- """A generic reader for a source."""
74+ class NativeSourceReader (object ):
75+ """A reader for a source implemented by Dataflow service ."""
7076
7177 def __enter__ (self ):
7278 """Opens everything necessary for a reader to function properly."""
@@ -98,12 +104,13 @@ def request_dynamic_split(self, dynamic_split_request):
98104 """Attempts to split the input in two parts.
99105
100106 The two parts are named the "primary" part and the "residual" part. The
101- current 'SourceReader ' keeps processing the primary part, while the
107+ current 'NativeSourceReader ' keeps processing the primary part, while the
102108 residual part will be processed elsewhere (e.g. perhaps on a different
103109 worker).
104110
105111 The primary and residual parts, if concatenated, must represent the
106- same input as the current input of this 'SourceReader' before this call.
112+ same input as the current input of this 'NativeSourceReader' before this
113+ call.
107114
108115 The boundary between the primary part and the residual part is
109116 specified in a framework-specific way using 'DynamicSplitRequest' e.g.,
@@ -127,7 +134,7 @@ def request_dynamic_split(self, dynamic_split_request):
127134
128135 Returns:
129136 'None' if the 'DynamicSplitRequest' cannot be honored (in that
130- case the input represented by this 'SourceReader ' stays the same),
137+ case the input represented by this 'NativeSourceReader ' stays the same),
131138 or a 'DynamicSplitResult' describing how the input was split into a
132139 primary and residual part.
133140 """
@@ -139,7 +146,7 @@ def request_dynamic_split(self, dynamic_split_request):
139146
140147
141148class ReaderProgress (object ):
142- """A representation of how far a SourceReader has read through the source ."""
149+ """A representation of how far a NativeSourceReader has read."""
143150
144151 def __init__ (self , position = None , percent_complete = None , remaining_time = None ):
145152
@@ -179,7 +186,7 @@ def remaining_time(self):
179186
180187
181188class ReaderPosition (object ):
182- """A representation of position in an iteration through a 'SourceReader '."""
189+ """A representation of position in an iteration of a 'NativeSourceReader '."""
183190
184191 def __init__ (self , end = None , key = None , byte_offset = None , record_index = None ,
185192 shuffle_position = None , concat_position = None ):
@@ -231,7 +238,7 @@ def __init__(self, index, position):
231238
232239
233240class DynamicSplitRequest (object ):
234- """Specifies how 'SourceReader .request_dynamic_split' should split the input .
241+ """Specifies how 'NativeSourceReader .request_dynamic_split' should split.
235242 """
236243
237244 def __init__ (self , progress ):
@@ -291,9 +298,6 @@ def Write(self, o): # pylint: disable=invalid-name
291298class RangeTracker (object ):
292299 """A thread-safe helper object for implementing dynamic work rebalancing.
293300
294- ``RangeTracker`` can be used for implementing dynamic work rebalancing in
295- position-based subclasses of ``iobase.SourceReader``.
296-
297301 **Usage of the RangeTracker class hierarchy**
298302
299303 The ``RangeTracker`` class should not be used per se---all users should use
0 commit comments