public class PythonPartition extends Object implements Partition<Object>
Python worker can create a partition object using information in this PythonPartition.
If this object is constructed from serialized python partition, python worker can deserialize it to create python partition directly. If this object is constructed from moduleName and className/functionName, python worker will use `importlib` to load python partition function.
| 限定符和类型 | 字段和说明 |
|---|---|
static PythonPartition |
BroadcastPartition |
static String |
FORWARD_PARTITION_CLASS |
static PythonPartition |
ForwardPartition |
static PythonPartition |
KeyPartition |
static PythonPartition |
RoundRobinPartition |
| 构造器和说明 |
|---|
PythonPartition(byte[] partition) |
PythonPartition(String moduleName,
String functionName)
Create a python partition from a moduleName and partition function name
|
| 限定符和类型 | 方法和说明 |
|---|---|
String |
getFunctionName() |
String |
getModuleName() |
byte[] |
getPartition() |
boolean |
isConstructedFromBinary() |
int[] |
partition(Object record,
int numPartition)
Given a record and downstream partitions, determine which partition(s) should receive the
record.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitloadCheckpoint, saveCheckpointpublic static final PythonPartition BroadcastPartition
public static final PythonPartition KeyPartition
public static final PythonPartition RoundRobinPartition
public static final PythonPartition ForwardPartition
public int[] partition(Object record, int numPartition)
Partitionpublic byte[] getPartition()
public String getModuleName()
public String getFunctionName()
public boolean isConstructedFromBinary()
Copyright © 2021. All rights reserved.