Package cascading.stats

Examples of cascading.stats.FlowStats


    // should not throw npe
    assertEquals( 0, cascadeStats.getCounterValue( TestEnum.THIRD ) );
    assertEquals( 0, cascadeStats.getCounterValue( "FOO", "BAR" ) );

    FlowStats flowStats1 = flow1.getFlowStats();

    assertNotNull( flowStats1.getID() );

    assertEquals( 20, flowStats1.getCounterValue( TestEnum.FIRST ) );
    assertEquals( 10, flowStats1.getCounterValue( TestEnum.SECOND ) );

    assertEquals( 10, flowStats1.getFlowStepStats().get( 0 ).getCounterValue( TestEnum.FIRST ) );
    assertEquals( 10, flowStats1.getFlowStepStats().get( 1 ).getCounterValue( TestEnum.FIRST ) );

    // should not throw npe
    assertEquals( 0, flowStats1.getCounterValue( TestEnum.THIRD ) );
    assertEquals( 0, flowStats1.getCounterValue( "FOO", "BAR" ) );

    FlowStats flowStats2 = flow2.getFlowStats();

    assertNotNull( flowStats2.getID() );

    assertEquals( 20, flowStats2.getCounterValue( TestEnum.FIRST ) );
    assertEquals( 10, flowStats2.getCounterValue( TestEnum.SECOND ) );

    cascadeStats.captureDetail();

    assertEquals( 2, flowStats1.getStepsCount() );
    assertEquals( 2, flowStats2.getStepsCount() );

    HadoopStepStats stats1 = (HadoopStepStats) flowStats1.getFlowStepStats().get( 0 );

    assertNotNull( stats1.getID() );
    assertNotNull( stats1.getJobID() );

//      assertEquals( 2, stats1.getNumMapTasks() );
//      assertEquals( 1, stats1.getNumReducerTasks() );

    if( getPlatform().isUseCluster() )
      {
      assertTrue( stats1.getCounterValue( SliceCounters.Process_Duration ) != 0L );

      List<FlowNodeStats> flowNodeStats = stats1.getFlowNodeStats();

      assertTrue( flowNodeStats.get( 0 ).getCounterValue( SliceCounters.Process_Duration ) != 0L );

      assertEquals( 2, flowNodeStats.size() );

      FlowNodeStats mapperNode = flowNodeStats.get( 0 );
      FlowNodeStats reducerNode = flowNodeStats.get( 1 );

      assertEquals( 4, mapperNode.getChildren().size() );
      assertEquals( 1, reducerNode.getChildren().size() );

      Collection<FlowSliceStats> children = reducerNode.getChildren();
      for( FlowSliceStats flowSliceStats : children )
        {
        HadoopSliceStats hadoopSliceStats = (HadoopSliceStats) flowSliceStats;

        if( hadoopSliceStats.getTaskIDNum() == 0 && hadoopSliceStats.getKind() == HadoopSliceStats.Kind.REDUCER )
          assertTrue( hadoopSliceStats.getCounterValue( TestEnum.FIRST ) > 0 ); // in reducer
        }
      }

    HadoopStepStats stats2 = (HadoopStepStats) flowStats2.getFlowStepStats().get( 0 );

    assertNotNull( stats2.getID() );
    assertNotNull( stats2.getJobID() );

//      assertEquals( 2, stats2.getNumMapTasks() );
View Full Code Here


    return Util.findVersion( AppProps.getApplicationJarPath( properties ) );
    }

  private FlowStats createPrepareFlowStats()
    {
    FlowStats flowStats = new FlowStats( this, getClientState() );

    flowStats.prepare();
    flowStats.markPending();

    return flowStats;
    }
View Full Code Here

    // should not throw npe
    assertEquals( 0, cascadeStats.getCounterValue( TestEnum.THIRD ) );
    assertEquals( 0, cascadeStats.getCounterValue( "FOO", "BAR" ) );

    FlowStats flowStats1 = flow1.getFlowStats();

    assertNotNull( flowStats1.getID() );

    assertEquals( 20, flowStats1.getCounterValue( TestEnum.FIRST ) );
    assertEquals( 10, flowStats1.getCounterValue( TestEnum.SECOND ) );

    // should not throw npe
    assertEquals( 0, flowStats1.getCounterValue( TestEnum.THIRD ) );
    assertEquals( 0, flowStats1.getCounterValue( "FOO", "BAR" ) );

    FlowStats flowStats2 = flow2.getFlowStats();

    assertNotNull( flowStats2.getID() );

    assertEquals( 20, flowStats2.getCounterValue( TestEnum.FIRST ) );
    assertEquals( 10, flowStats2.getCounterValue( TestEnum.SECOND ) );

    cascadeStats.captureDetail();
    }
View Full Code Here

    // should not throw npe
    assertEquals( 0, cascadeStats.getCounterValue( TestEnum.THIRD ) );
    assertEquals( 0, cascadeStats.getCounterValue( "FOO", "BAR" ) );

    FlowStats flowStats1 = flow1.getFlowStats();

    assertNotNull( flowStats1.getID() );

    assertEquals( 20, flowStats1.getCounterValue( TestEnum.FIRST ) );
    assertEquals( 10, flowStats1.getCounterValue( TestEnum.SECOND ) );

    // should not throw npe
    assertEquals( 0, flowStats1.getCounterValue( TestEnum.THIRD ) );
    assertEquals( 0, flowStats1.getCounterValue( "FOO", "BAR" ) );

    FlowStats flowStats2 = flow2.getFlowStats();

    assertNotNull( flowStats2.getID() );

    assertEquals( 20, flowStats2.getCounterValue( TestEnum.FIRST ) );
    assertEquals( 10, flowStats2.getCounterValue( TestEnum.SECOND ) );

    cascadeStats.captureDetail();

    assertEquals( 1, flowStats1.getStepsCount() );
    assertEquals( 1, flowStats2.getStepsCount() );

    TezStepStats stats1 = (TezStepStats) flowStats1.getFlowStepStats().get( 0 );

    assertNotNull( stats1.getID() );
//      assertNotNull( stats1.getJobID() );

    if( getPlatform().isUseCluster() )
      {
      List<FlowNodeStats> flowNodeStats = stats1.getFlowNodeStats();
      assertEquals( 3, flowNodeStats.size() );

      // disabled as we cannot get vertex counters in a mini cluster
//      assertTrue( stats1.getCounterValue( SliceCounters.Process_Duration ) != 0L );
//      assertTrue( flowNodeStats.get( 0 ).getCounterValue( SliceCounters.Process_Duration ) != 0L );

//        assertEquals( 5, stats1.getTaskStats().size() );
//
//        for( FlowSliceStats flowSliceStats : stats1.getTaskStats().values() )
//          {
//          Hadoop2TezSliceStats hadoopSliceStats = (Hadoop2TezSliceStats) flowSliceStats;
//
//          if( hadoopSliceStats.getTaskIDNum() == 0 && hadoopSliceStats.getKind() == HadoopSliceStats.Kind.REDUCER )
//            assertTrue( hadoopSliceStats.getCounterValue( TestEnum.FIRST ) > 0 ); // in reducer
//          }
      }

    TezStepStats stats2 = (TezStepStats) flowStats2.getFlowStepStats().get( 0 );

    assertNotNull( stats2.getID() );
//      assertNotNull( stats2.getJobID() );

    // todo: enable when tasks are captured
View Full Code Here

      {
      LOG.warn( "no parent flow set" );
      return;
      }

    FlowStats flowStats = flow.getFlowStats();

    synchronized( flowStats )
      {
      if( flowStats.isStarted() )
        flowStats.markSubmitted();
      }
    }
View Full Code Here

      {
      LOG.warn( "no parent flow set" );
      return;
      }

    FlowStats flowStats = flow.getFlowStats();

    synchronized( flowStats )
      {
      if( flowStats.isStarted() || flowStats.isSubmitted() )
        flowStats.markRunning();
      }
    }
View Full Code Here

TOP

Related Classes of cascading.stats.FlowStats

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.