Search in sources :

Example 1 with UserServiceLoggingContext

use of io.cdap.cdap.logging.context.UserServiceLoggingContext in project cdap by caskdata.

the class MockLogReader method generateLogs.

public void generateLogs() throws InterruptedException {
    // Add logs for app testApp2, worker testWorker1
    generateLogs(new WorkerLoggingContext(NamespaceId.DEFAULT.getEntityName(), "testApp2", "testWorker1", "", ""), NamespaceId.DEFAULT.app("testApp2").worker("testWorker1"), ProgramRunStatus.RUNNING);
    // Add logs for app testApp3, mapreduce testMapReduce1
    generateLogs(new MapReduceLoggingContext(NamespaceId.DEFAULT.getEntityName(), "testApp3", "testMapReduce1", ""), NamespaceId.DEFAULT.app("testApp3").mr("testMapReduce1"), ProgramRunStatus.SUSPENDED);
    // Add logs for app testApp1, service testService1
    generateLogs(new UserServiceLoggingContext(NamespaceId.DEFAULT.getEntityName(), "testApp4", "testService1", "test1", "", ""), NamespaceId.DEFAULT.app("testApp4").service("testService1"), ProgramRunStatus.RUNNING);
    // Add logs for app testApp1, mapreduce testMapReduce1
    generateLogs(new MapReduceLoggingContext(TEST_NAMESPACE_ID.getNamespace(), "testTemplate1", "testMapReduce1", ""), TEST_NAMESPACE_ID.app("testTemplate1").mr("testMapReduce1"), ProgramRunStatus.COMPLETED);
    // Add logs for app testApp1, worker testWorker1 in testNamespace
    generateLogs(new WorkerLoggingContext(TEST_NAMESPACE_ID.getNamespace(), "testApp1", "testWorker1", "", ""), TEST_NAMESPACE_ID.app("testApp1").worker("testWorker1"), ProgramRunStatus.COMPLETED);
    // Add logs for app testApp1, service testService1 in testNamespace
    generateLogs(new UserServiceLoggingContext(TEST_NAMESPACE_ID.getNamespace(), "testApp4", "testService1", "test1", "", ""), TEST_NAMESPACE_ID.app("testApp4").service("testService1"), ProgramRunStatus.KILLED);
    // Add logs for testWorkflow1 in testNamespace
    generateLogs(new WorkflowLoggingContext(TEST_NAMESPACE_ID.getNamespace(), "testTemplate1", "testWorkflow1", "testRun1"), TEST_NAMESPACE_ID.app("testTemplate1").workflow("testWorkflow1"), ProgramRunStatus.COMPLETED);
    // Add logs for testWorkflow1 in default namespace
    generateLogs(new WorkflowLoggingContext(NamespaceId.DEFAULT.getEntityName(), "testTemplate1", "testWorkflow1", "testRun2"), NamespaceId.DEFAULT.app("testTemplate1").workflow("testWorkflow1"), ProgramRunStatus.COMPLETED);
    generateWorkflowLogs();
}
Also used : WorkerLoggingContext(io.cdap.cdap.logging.context.WorkerLoggingContext) WorkflowLoggingContext(io.cdap.cdap.logging.context.WorkflowLoggingContext) MapReduceLoggingContext(io.cdap.cdap.logging.context.MapReduceLoggingContext) UserServiceLoggingContext(io.cdap.cdap.logging.context.UserServiceLoggingContext)

Aggregations

MapReduceLoggingContext (io.cdap.cdap.logging.context.MapReduceLoggingContext)1 UserServiceLoggingContext (io.cdap.cdap.logging.context.UserServiceLoggingContext)1 WorkerLoggingContext (io.cdap.cdap.logging.context.WorkerLoggingContext)1 WorkflowLoggingContext (io.cdap.cdap.logging.context.WorkflowLoggingContext)1