Search in sources :

Example 11 with ProgramRunId

use of co.cask.cdap.proto.id.ProgramRunId in project cdap by caskdata.

the class PreviewHttpHandler method getPreviewLogsPrev.

@GET
@Path("/previews/{preview-id}/logs/prev")
public void getPreviewLogsPrev(HttpRequest request, HttpResponder responder, @PathParam("namespace-id") String namespaceId, @PathParam("preview-id") String previewId, @QueryParam("max") @DefaultValue("50") int maxEvents, @QueryParam("fromOffset") @DefaultValue("") String fromOffsetStr, @QueryParam("escape") @DefaultValue("true") boolean escape, @QueryParam("filter") @DefaultValue("") String filterStr, @QueryParam("format") @DefaultValue("text") String format, @QueryParam("suppress") List<String> suppress) throws Exception {
    ProgramRunId runId = getProgramRunId(namespaceId, previewId);
    RunRecordMeta runRecord = getRunRecord(namespaceId, previewId);
    LoggingContext loggingContext = LoggingContextHelper.getLoggingContextWithRunId(namespaceId, previewId, runId.getProgram(), runId.getType(), runId.getRun(), runRecord.getSystemArgs());
    doPrev(responder, loggingContext, maxEvents, fromOffsetStr, escape, filterStr, runRecord, format, suppress);
}
Also used : LoggingContext(co.cask.cdap.common.logging.LoggingContext) RunRecordMeta(co.cask.cdap.internal.app.store.RunRecordMeta) ProgramRunId(co.cask.cdap.proto.id.ProgramRunId) Path(javax.ws.rs.Path) GET(javax.ws.rs.GET)

Example 12 with ProgramRunId

use of co.cask.cdap.proto.id.ProgramRunId in project cdap by caskdata.

the class RemoteRuntimeStoreHandler method addWorkflowNodeState.

@POST
@Path("/addWorkflowNodeState")
public void addWorkflowNodeState(HttpRequest request, HttpResponder responder) throws Exception {
    Iterator<MethodArgument> arguments = parseArguments(request);
    ProgramRunId workflowRunId = deserializeNext(arguments);
    WorkflowNodeStateDetail nodeStateDetail = deserializeNext(arguments);
    store.addWorkflowNodeState(workflowRunId, nodeStateDetail);
    responder.sendStatus(HttpResponseStatus.OK);
}
Also used : MethodArgument(co.cask.cdap.common.internal.remote.MethodArgument) ProgramRunId(co.cask.cdap.proto.id.ProgramRunId) WorkflowNodeStateDetail(co.cask.cdap.proto.WorkflowNodeStateDetail) Path(javax.ws.rs.Path) POST(javax.ws.rs.POST)

Example 13 with ProgramRunId

use of co.cask.cdap.proto.id.ProgramRunId in project cdap by caskdata.

the class RemoteRuntimeStoreHandler method updateWorkflowToken.

@POST
@Path("/updateWorkflowToken")
public void updateWorkflowToken(HttpRequest request, HttpResponder responder) throws Exception {
    Iterator<MethodArgument> arguments = parseArguments(request);
    ProgramRunId workflowRunId = deserializeNext(arguments);
    WorkflowToken token = deserializeNext(arguments);
    store.updateWorkflowToken(workflowRunId, token);
    responder.sendStatus(HttpResponseStatus.OK);
}
Also used : MethodArgument(co.cask.cdap.common.internal.remote.MethodArgument) WorkflowToken(co.cask.cdap.api.workflow.WorkflowToken) ProgramRunId(co.cask.cdap.proto.id.ProgramRunId) Path(javax.ws.rs.Path) POST(javax.ws.rs.POST)

Example 14 with ProgramRunId

use of co.cask.cdap.proto.id.ProgramRunId in project cdap by caskdata.

the class RemoteLineageWriterHandler method addStreamAccess.

@POST
@Path("/addStreamAccess")
public void addStreamAccess(HttpRequest request, HttpResponder responder) throws Exception {
    Iterator<MethodArgument> arguments = parseArguments(request);
    ProgramRunId run = deserializeNext(arguments);
    StreamId stream = deserializeNext(arguments);
    AccessType accessType = deserializeNext(arguments);
    NamespacedEntityId component = deserializeNext(arguments);
    lineageWriter.addAccess(run, stream, accessType, component);
    responder.sendStatus(HttpResponseStatus.OK);
}
Also used : StreamId(co.cask.cdap.proto.id.StreamId) NamespacedEntityId(co.cask.cdap.proto.id.NamespacedEntityId) MethodArgument(co.cask.cdap.common.internal.remote.MethodArgument) ProgramRunId(co.cask.cdap.proto.id.ProgramRunId) AccessType(co.cask.cdap.data2.metadata.lineage.AccessType) Path(javax.ws.rs.Path) POST(javax.ws.rs.POST)

Example 15 with ProgramRunId

use of co.cask.cdap.proto.id.ProgramRunId in project cdap by caskdata.

the class RemoteLineageWriterHandler method addDatasetAccess.

@POST
@Path("/addDatasetAccess")
public void addDatasetAccess(HttpRequest request, HttpResponder responder) throws Exception {
    Iterator<MethodArgument> arguments = parseArguments(request);
    ProgramRunId run = deserializeNext(arguments);
    DatasetId datasetInstance = deserializeNext(arguments);
    AccessType accessType = deserializeNext(arguments);
    NamespacedEntityId component = deserializeNext(arguments);
    lineageWriter.addAccess(run, datasetInstance, accessType, component);
    responder.sendStatus(HttpResponseStatus.OK);
}
Also used : NamespacedEntityId(co.cask.cdap.proto.id.NamespacedEntityId) MethodArgument(co.cask.cdap.common.internal.remote.MethodArgument) ProgramRunId(co.cask.cdap.proto.id.ProgramRunId) AccessType(co.cask.cdap.data2.metadata.lineage.AccessType) DatasetId(co.cask.cdap.proto.id.DatasetId) Path(javax.ws.rs.Path) POST(javax.ws.rs.POST)

Aggregations

ProgramRunId (co.cask.cdap.proto.id.ProgramRunId)53 ProgramId (co.cask.cdap.proto.id.ProgramId)23 Test (org.junit.Test)22 ApplicationId (co.cask.cdap.proto.id.ApplicationId)12 RunRecordMeta (co.cask.cdap.internal.app.store.RunRecordMeta)10 Path (javax.ws.rs.Path)10 RunId (org.apache.twill.api.RunId)10 DatasetId (co.cask.cdap.proto.id.DatasetId)9 Relation (co.cask.cdap.data2.metadata.lineage.Relation)7 HashSet (java.util.HashSet)7 NotFoundException (co.cask.cdap.common.NotFoundException)6 WorkflowNodeStateDetail (co.cask.cdap.proto.WorkflowNodeStateDetail)6 HashMap (java.util.HashMap)6 GET (javax.ws.rs.GET)6 ApplicationSpecification (co.cask.cdap.api.app.ApplicationSpecification)5 NamespacedEntityId (co.cask.cdap.proto.id.NamespacedEntityId)5 StreamId (co.cask.cdap.proto.id.StreamId)5 Map (java.util.Map)5 CommandInputError (co.cask.cdap.cli.exception.CommandInputError)4 MethodArgument (co.cask.cdap.common.internal.remote.MethodArgument)4