///
import { StorageType } from './../common/types';
import { FunctionEnv } from './../common/SerializeFunction';
import { Client, Request } from './Client';
declare type ResponseFactory = (rdd: RDD) => Request | Promise>;
export declare class RDD {
context: Context;
constructor(context: Context);
generateTask(): Request | Promise>;
collect(): Promise;
take(count: number): Promise;
count(): Promise;
max(): Promise;
min(): Promise;
mapPartitions(func: (v: T[]) => T1[] | Promise, env?: FunctionEnv): RDD;
glom(): RDD;
map(func: ((v: T) => T1), env?: FunctionEnv): RDD;
reduce(func: ((a: T, b: T) => T), env?: FunctionEnv): Promise;
flatMap(func: ((v: T) => T1[]), env?: FunctionEnv): RDD;
filter(func: (v: T) => boolean, env?: FunctionEnv): RDD;
distinct(numPartitions?: number): RDD;
repartition(numPartitions: number): RDD;
partitionBy(numPartitions: number, partitionFunc: (v: T) => number, env?: FunctionEnv): GeneratedRDD;
coalesce(numPartitions: number): GeneratedRDD;
reduceByKey(this: RDD<[K, V]>, func: ((a: V, B: V) => V), numPartitions?: number, partitionFunc?: (v: K) => number, env?: FunctionEnv): RDD<[K, V]>;
combineByKey(this: RDD<[K, V]>, createCombiner: ((a: V) => C), mergeValue: ((a: C, b: V) => C), mergeCombiners: ((a: C, b: C) => C), numPartitions?: number, partitionFunc?: (v: K) => number, env?: FunctionEnv): RDD<[K, C]>;
persist(storageType?: StorageType): CacheRDD;
cache(): CacheRDD;
union(...others: RDD[]): RDD;
getNumPartitions(): Promise;
saveAsTextFile(baseUrl: string, { overwrite, encoding, extension, compressor, functionEnv, }?: {
overwrite?: boolean;
encoding?: string;
extension?: string;
compressor?: (data: Buffer) => Buffer | Promise;
functionEnv?: FunctionEnv;
}): Promise;
groupWith(this: RDD<[K, V]>, other1: RDD<[K, V1]>): RDD<[K, [V[], V1[]]]>;
groupWith(this: RDD<[K, V]>, other1: RDD<[K, V1]>, other2: RDD<[K, V2]>): RDD<[K, [V[], V1[], V2[]]]>;
groupWith(this: RDD<[K, V]>, other1: RDD<[K, V1]>, other2: RDD<[K, V2]>, other3: RDD<[K, V3]>): RDD<[K, [V[], V1[], V2[], V3[]]]>;
cogroup(this: RDD<[K, V]>, other: RDD<[K, V1]>, numPartitions?: number): RDD<[K, [V[], V1[]]]>;
join(this: RDD<[K, V]>, other: RDD<[K, V1]>, numPartitions?: number): RDD<[K, [V, V1]]>;
leftOuterJoin(this: RDD<[K, V]>, other: RDD<[K, V1]>, numPartitions?: number): RDD<[K, [V, V1 | null]]>;
rightOuterJoin(this: RDD<[K, V]>, other: RDD<[K, V1]>, numPartitions?: number): RDD<[K, [V | null, V1]]>;
fullOuterJoin(this: RDD<[K, V]>, other: RDD<[K, V1]>, numPartitions?: number): RDD<[K, [V | null, V1 | null]]>;
sort(ascending?: boolean, numPartitions?: number): RDD;
sortBy(keyFunc: (data: T) => K, ascending?: boolean, numPartitions?: number, env?: FunctionEnv): RDD;
}
export declare class GeneratedRDD extends RDD {
_generateTask: ResponseFactory;
constructor(context: Context, generateTask: ResponseFactory);
generateTask(): Request | Promise>;
}
export declare class CacheRDD extends RDD {
cacheId: number | null;
dependency: RDD;
storageType: StorageType;
constructor(storageType: StorageType, dependency: RDD);
generateTask(): Promise>;
unpersist(): Promise;
}
export declare class Context {
client: Client;
constructor(c: Client);
emptyRDD(): RDD;
range(from: number, to?: number, step?: number, numPartitions?: number): RDD;
parallelize(arr: T[], numPartitions?: number): RDD;
union(...rdds: RDD[]): RDD;
binaryFiles(baseUrl: string, { recursive, }?: {
recursive?: boolean;
}): RDD<[string, Buffer]>;
wholeTextFiles(baseUrl: string, { decompressor, encoding, recursive, functionEnv, }?: {
encoding?: string;
recursive?: boolean;
decompressor?: (data: Buffer, filename: string) => Buffer | Promise;
functionEnv?: FunctionEnv;
}): RDD<[string, string]>;
textFile(baseUrl: string, options?: {
encoding?: string;
recursive?: boolean;
decompressor?: (data: Buffer, filename: string) => Buffer | Promise;
functionEnv?: FunctionEnv;
__dangerousDontCopy?: boolean;
}): RDD;
}
export {};