def keyed_gather(self, partition_func: PartitionFunc = None, key_comparator=None, use_disk=False): p_func_java_ref = None comparator_func_java_ref = None if partition_func is not None: p_func_java_ref = self.__env.functions.partition.to_java_ref( partition_func) if key_comparator is not None: key_comparator_wrapped = function_wrapper(key_comparator) comparator_func_java_ref = self.__env.functions.comparator.build( key_comparator_wrapped) keyed_gather_t_link_java_ref = None if p_func_java_ref is None and comparator_func_java_ref is None: keyed_gather_t_link_java_ref = self.__java_ref.keyedGather() elif comparator_func_java_ref is None and p_func_java_ref is not None: keyed_gather_t_link_java_ref = self.__java_ref.keyedGather( p_func_java_ref) else: keyed_gather_t_link_java_ref = self.__java_ref.keyedGather( p_func_java_ref, comparator_func_java_ref) if use_disk: keyed_gather_t_link_java_ref = keyed_gather_t_link_java_ref.useDisk( ) return Tl.TLink(keyed_gather_t_link_java_ref, self.__env)
def keyed_reduce(self, reduce_func): reduce_wrapper = function_wrapper(reduce_func) reduce_func_java_ref = self.__env.functions.reduce.build( reduce_wrapper) reduce_t_link_java_ref = self.__java_ref.keyedReduce( reduce_func_java_ref) return Tl.TLink(reduce_t_link_java_ref, self.__env)
def partition(self, partition_func: PartitionFunc): p_func_java_ref = self.__env.functions.partition.to_java_ref(partition_func) partition_link_java_ref = self.__java_ref.partition(p_func_java_ref) return tl.TLink(partition_link_java_ref, self.__env)
def all_gather(self): return tl.TLink(self.__java_ref.allGather(), self.__env)
def gather(self): return tl.TLink(self.__java_ref.gather(), self.__env)
def direct(self): return tl.TLink(self.__java_ref.direct(), self.__env)
def direct(self): return Tl.TLink(self.__java_ref.keyedDirect(), self.__env)