@hpcc-js/comms
Version:
hpcc-js - Communications
209 lines • 9.86 kB
TypeScript
import { Cache, StateCallback, StateEvents, StateObject, StatePropCallback, StringAnyMap, XMLNode } from "@hpcc-js/util";
import { IConnection, IOptions } from "../connection";
import { SMCActivity } from "../services/wsSMC";
import * as WsTopology from "../services/wsTopology";
import * as WsWorkunits from "../services/wsWorkunits";
import { ECLGraph, ScopeGraph, XGMMLGraph } from "./graph";
import { Resource } from "./resource";
import { Result } from "./result";
import { BaseScope, Scope } from "./scope";
import { SourceFile } from "./sourceFile";
import { Timer } from "./timer";
export declare class WorkunitCache extends Cache<{
Wuid: string;
}, Workunit> {
constructor();
}
export interface DebugState {
sequence: number;
state: string;
[key: string]: any;
}
export interface IWorkunit {
ResultViews: any[];
HelpersCount: number;
}
export interface IDebugWorkunit {
DebugState?: DebugState;
}
export interface ITimeElapsed {
scope: string;
start: string;
elapsed: number;
finish: string;
}
export declare type WorkunitEvents = "completed" | StateEvents;
export declare type UWorkunitState = WsWorkunits.WUQuery.ECLWorkunit & WsWorkunits.WUInfo.Workunit & SMCActivity.ActiveWorkunit & IWorkunit & IDebugWorkunit;
export declare type IWorkunitState = WsWorkunits.WUQuery.ECLWorkunit | WsWorkunits.WUInfo.Workunit | SMCActivity.ActiveWorkunit | IWorkunit | IDebugWorkunit;
export declare class Workunit extends StateObject<UWorkunitState, IWorkunitState> implements WsWorkunits.WUInfo.Workunit {
connection: WsWorkunits.WorkunitsService;
topologyConnection: WsTopology.TopologyService;
private _debugMode;
private _debugAllGraph;
private _submitAction;
readonly properties: WsWorkunits.WUQuery.ECLWorkunit & WsWorkunits.WUInfo.Workunit;
readonly Wuid: string;
readonly Owner: string;
readonly Cluster: string;
readonly Jobname: string;
readonly Description: string;
readonly ActionEx: string;
readonly StateID: WsWorkunits.WUStateID;
readonly State: string;
readonly Protected: boolean;
readonly Exceptions: WsWorkunits.WUInfo.Exceptions2;
readonly ResultViews: any[];
private _resultCache;
readonly ResultCount: number;
readonly Results: WsWorkunits.WUInfo.Results;
readonly CResults: Result[];
readonly SequenceResults: {
[key: number]: Result;
};
readonly Timers: WsWorkunits.WUInfo.Timers;
readonly CTimers: Timer[];
private _graphCache;
readonly GraphCount: number;
readonly Graphs: WsWorkunits.WUInfo.Graphs;
readonly CGraphs: ECLGraph[];
readonly ThorLogList: WsWorkunits.WUInfo.ThorLogList;
readonly ResourceURLCount: number;
readonly ResourceURLs: WsWorkunits.WUInfo.ResourceURLs;
readonly CResourceURLs: Resource[];
readonly TotalClusterTime: string;
readonly DateTimeScheduled: string;
readonly IsPausing: boolean;
readonly ThorLCR: boolean;
readonly ApplicationValues: WsWorkunits.WUInfo.ApplicationValues;
readonly HasArchiveQuery: boolean;
readonly StateEx: string;
readonly PriorityClass: number;
readonly PriorityLevel: number;
readonly Snapshot: string;
readonly ResultLimit: number;
readonly EventSchedule: number;
readonly HaveSubGraphTimings: boolean;
readonly Query: WsWorkunits.WUInfo.Query;
readonly HelpersCount: number;
readonly Helpers: WsWorkunits.WUInfo.Helpers;
readonly DebugValues: WsWorkunits.WUInfo.DebugValues;
readonly AllowedClusters: WsWorkunits.WUInfo.AllowedClusters;
readonly ErrorCount: number;
readonly WarningCount: number;
readonly InfoCount: number;
readonly AlertCount: number;
readonly SourceFileCount: number;
readonly SourceFiles: WsWorkunits.WUInfo.SourceFiles;
readonly CSourceFiles: SourceFile[];
readonly VariableCount: number;
readonly Variables: WsWorkunits.WUInfo.Variables;
readonly TimerCount: number;
readonly HasDebugValue: boolean;
readonly ApplicationValueCount: number;
readonly XmlParams: string;
readonly AccessFlag: number;
readonly ClusterFlag: number;
readonly ResultViewCount: number;
readonly DebugValueCount: number;
readonly WorkflowCount: number;
readonly Archived: boolean;
readonly RoxieCluster: string;
readonly DebugState: DebugState;
readonly Queue: string;
readonly Active: boolean;
readonly Action: number;
readonly Scope: string;
readonly AbortBy: string;
readonly AbortTime: string;
readonly Workflows: WsWorkunits.WUInfo.Workflows;
readonly TimingData: WsWorkunits.WUInfo.TimingData;
readonly HelpersDesc: string;
readonly GraphsDesc: string;
readonly SourceFilesDesc: string;
readonly ResultsDesc: string;
readonly VariablesDesc: string;
readonly TimersDesc: string;
readonly DebugValuesDesc: string;
readonly ApplicationValuesDesc: string;
readonly WorkflowsDesc: string;
static create(optsConnection: IOptions | IConnection): Promise<Workunit>;
static attach(optsConnection: IOptions | IConnection, wuid: string, state?: IWorkunitState): Workunit;
static existsLocal(wuid: string): boolean;
static submit(server: IOptions | IConnection, target: string, ecl: string): Promise<Workunit>;
static query(server: IOptions | IConnection, opts: WsWorkunits.WUQuery.Request): Promise<Workunit[]>;
protected constructor(optsConnection: IOptions | IConnection, wuid?: string);
clearState(wuid?: string): void;
update(request: Partial<WsWorkunits.WUUpdate.Request>): Promise<Workunit>;
submit(_cluster?: string, action?: WsWorkunits.WUUpdate.Action, resultLimit?: number): Promise<Workunit>;
isComplete(): boolean;
isFailed(): boolean;
isDeleted(): boolean;
isDebugging(): boolean;
isRunning(): boolean;
setToFailed(): Promise<WsWorkunits.WUAction.Response>;
pause(): Promise<WsWorkunits.WUAction.Response>;
pauseNow(): Promise<WsWorkunits.WUAction.Response>;
resume(): Promise<WsWorkunits.WUAction.Response>;
abort(): Promise<WsWorkunits.WUAction.Response>;
delete(): Promise<WsWorkunits.WUAction.Response>;
restore(): Promise<WsWorkunits.WUAction.Response>;
deschedule(): Promise<WsWorkunits.WUAction.Response>;
reschedule(): Promise<WsWorkunits.WUAction.Response>;
resubmit(): Promise<Workunit>;
clone(): Promise<Workunit>;
refreshState(): Promise<this>;
refreshInfo(): Promise<this>;
refreshDebug(): Promise<this>;
refresh(full?: boolean): Promise<this>;
eclExceptions(): WsWorkunits.WUInfo.ECLException[];
fetchECLExceptions(): Promise<WsWorkunits.WUInfo.ECLException[]>;
fetchResults(): Promise<Result[]>;
fetchGraphs(): Promise<ECLGraph[]>;
fetchDetailsMeta(request?: Partial<WsWorkunits.WUDetailsMeta.Request>): Promise<WsWorkunits.WUDetailsMeta.Response>;
fetchDetailsRaw(request?: Partial<WsWorkunits.WUDetails.Request>): Promise<WsWorkunits.WUDetails.Scope[]>;
fetchDetailsNormalized(request?: Partial<WsWorkunits.WUDetails.Request>): Promise<{
meta: WsWorkunits.WUDetailsMeta.Response;
columns: {
[id: string]: any;
};
data: object[];
}>;
fetchDetails(request?: Partial<WsWorkunits.WUDetails.Request>): Promise<Scope[]>;
fetchDetailsHierarchy(request?: Partial<WsWorkunits.WUDetails.Request>): Promise<Scope[]>;
fetchGraphDetails(graphIDs: string[], rootTypes: string[]): Promise<BaseScope[]>;
fetchScopeGraphs(graphIDs?: string[]): Promise<ScopeGraph>;
fetchTimeElapsed(): Promise<ITimeElapsed[]>;
protected _monitor(): void;
protected _monitorTimeoutDuraction(): number;
on(eventID: WorkunitEvents, propIDorCallback: StateCallback | keyof UWorkunitState, callback?: StatePropCallback): this;
watchUntilComplete(callback?: StateCallback): Promise<this>;
watchUntilRunning(callback?: StateCallback): Promise<this>;
protected WUQuery(_request?: Partial<WsWorkunits.WUQuery.Request>): Promise<WsWorkunits.WUQuery.Response>;
protected WUCreate(): Promise<WsWorkunits.WUCreate.Response>;
protected WUInfo(_request?: Partial<WsWorkunits.WUInfo.Request>): Promise<WsWorkunits.WUInfo.Response>;
protected WUResubmit(request: Partial<WsWorkunits.WUResubmit.Request>): Promise<WsWorkunits.WUResubmit.Response>;
protected WUDetailsMeta(request: Partial<WsWorkunits.WUDetailsMeta.Request>): Promise<WsWorkunits.WUDetailsMeta.Response>;
protected WUDetails(request: Partial<WsWorkunits.WUDetails.Request>): Promise<WsWorkunits.WUDetails.Response>;
protected WUAction(actionType: WsWorkunits.WUAction.Type): Promise<WsWorkunits.WUAction.Response>;
protected WUCDebug(command: string, opts?: any): Promise<XMLNode | null>;
debug(command: string, opts?: object): Promise<XMLNode>;
debugStatus(): Promise<XMLNode>;
debugContinue(mode?: string): Promise<XMLNode>;
debugStep(mode: string): Promise<XMLNode>;
debugPause(): Promise<XMLNode>;
debugQuit(): Promise<XMLNode>;
debugDeleteAllBreakpoints(): Promise<XMLNode>;
protected debugBreakpointResponseParser(rootNode: StringAnyMap): any;
debugBreakpointAdd(id: string, mode: string, action: string): Promise<XMLNode>;
debugBreakpointList(): Promise<any[]>;
debugGraph(): Promise<XGMMLGraph>;
debugBreakpointValid(path: string): Promise<IECLDefintion[]>;
debugPrint(edgeID: string, startRow?: number, numRows?: number): Promise<StringAnyMap[]>;
}
export interface IECLDefintion {
id: string;
file: string;
line: number;
column: number;
}
//# sourceMappingURL=workunit.d.ts.map