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.
| Modifier and Type | Field and Description |
|---|---|
static PythonPartition |
BroadcastPartition |
static String |
FORWARD_PARTITION_CLASS |
static PythonPartition |
ForwardPartition |
static PythonPartition |
KeyPartition |
static PythonPartition |
RoundRobinPartition |
| Constructor and Description |
|---|
PythonPartition(byte[] partition) |
PythonPartition(String moduleName,
String functionName)
Create a python partition from a moduleName and partition function name
|
| Modifier and Type | Method and Description |
|---|---|
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 String FORWARD_PARTITION_CLASS
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.