mirror of
https://github.com/wassname/ray.git
synced 2026-07-16 11:21:10 +08:00
Remove (object) from class declarations. (#6658)
This commit is contained in:
committed by
Philipp Moritz
parent
f1b56fa5ee
commit
39a3459886
@@ -31,7 +31,7 @@ def _hash(value):
|
||||
return int(hashlib.sha1(value).hexdigest(), 16)
|
||||
|
||||
|
||||
class DataChannel(object):
|
||||
class DataChannel:
|
||||
"""A data channel for actor-to-actor communication.
|
||||
|
||||
Attributes:
|
||||
@@ -62,7 +62,7 @@ _CLOSE_FLAG = b" "
|
||||
|
||||
|
||||
# Pulls and merges data from multiple input channels
|
||||
class DataInput(object):
|
||||
class DataInput:
|
||||
"""An input gate of an operator instance.
|
||||
|
||||
The input gate pulls records from all input channels in a round-robin
|
||||
@@ -124,7 +124,7 @@ class DataInput(object):
|
||||
|
||||
|
||||
# Selects output channel(s) and pushes data
|
||||
class DataOutput(object):
|
||||
class DataOutput:
|
||||
"""An output gate of an operator instance.
|
||||
|
||||
The output gate pushes records to output channels according to the
|
||||
|
||||
@@ -17,7 +17,7 @@ parser.add_argument("--input-file", required=True, help="the input text file")
|
||||
|
||||
|
||||
# A class used to check attribute-based key selection
|
||||
class Record(object):
|
||||
class Record:
|
||||
def __init__(self, record):
|
||||
k, _ = record
|
||||
self.word = k
|
||||
|
||||
@@ -23,7 +23,7 @@ parser.add_argument(
|
||||
# A custom data source that reads articles from wikipedia
|
||||
# Custom data sources need to implement a get_next() method
|
||||
# that returns the next data element, in this case sentences
|
||||
class Wikipedia(object):
|
||||
class Wikipedia:
|
||||
def __init__(self, title_file):
|
||||
# Titles in this file will be as queries
|
||||
self.title_file = title_file
|
||||
|
||||
@@ -16,7 +16,7 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@ray.remote
|
||||
class JobWorker(object):
|
||||
class JobWorker:
|
||||
"""A streaming job worker.
|
||||
|
||||
Attributes:
|
||||
|
||||
@@ -12,7 +12,7 @@ logger.setLevel("DEBUG")
|
||||
|
||||
|
||||
# Stream partitioning schemes
|
||||
class PScheme(object):
|
||||
class PScheme:
|
||||
def __init__(self, strategy, partition_fn=None):
|
||||
self.strategy = strategy
|
||||
self.partition_fn = partition_fn
|
||||
@@ -51,7 +51,7 @@ class OpType(enum.Enum):
|
||||
|
||||
|
||||
# A logical dataflow operator
|
||||
class Operator(object):
|
||||
class Operator:
|
||||
def __init__(self,
|
||||
id,
|
||||
op_type,
|
||||
|
||||
@@ -34,7 +34,7 @@ all_to_all_strategies = [
|
||||
|
||||
|
||||
# Environment configuration
|
||||
class Conf(object):
|
||||
class Conf:
|
||||
"""Environment configuration.
|
||||
|
||||
This class includes all information about the configuration of the
|
||||
@@ -253,7 +253,7 @@ class ExecutionGraph:
|
||||
|
||||
|
||||
# The execution environment for a streaming job
|
||||
class Environment(object):
|
||||
class Environment:
|
||||
"""A streaming environment.
|
||||
|
||||
This class is responsible for constructing the logical and the
|
||||
@@ -394,7 +394,7 @@ class Environment(object):
|
||||
|
||||
|
||||
# A DataStream corresponds to an edge in the logical dataflow
|
||||
class DataStream(object):
|
||||
class DataStream:
|
||||
"""A data stream.
|
||||
|
||||
This class contains all information about a logical stream, i.e. an edge
|
||||
|
||||
Reference in New Issue
Block a user