Examples of ReportManager


Examples of com.cloudera.flume.reporter.ReportManager

  /**
   * This gets reports and outputs them to std err in csv format.
   */
  public static void dumpReports() {
    ReportManager rman = ReportManager.get();
    SortedMap<String, Reportable> sorted = new TreeMap<String, Reportable>(rman
        .getReportables());
    for (Map.Entry<String, Reportable> ent : sorted.entrySet()) {
      String params = ent.getKey();
      ReportEvent r = ent.getValue().getReport();
      System.out.println(new String(r.toString()));
View Full Code Here

Examples of com.cloudera.flume.reporter.ReportManager

  }
 
  @Test
  public void testReports() throws TException, IOException {
    FlumeConfiguration.createTestableConfiguration();
    ReportManager rptMan = ReportManager.get();
    rptMan.clear();
    FlumeConfiguration.get().set(FlumeConfiguration.WEBAPPS_PATH,
        "build/webapps");
    FlumeConfiguration.get().set(FlumeConfiguration.MASTER_STORE, "memory");
    FlumeConfiguration.get().setInt(FlumeConfiguration.MASTER_HEARTBEAT_PORT, 55556);
    FlumeMaster master = new FlumeMaster(new CommandManager(),
        new ConfigManager(), new StatusManager(), new MasterAckManager(),
        FlumeConfiguration.get());
    MasterClientServer delegate = new MasterClientServer(master, cfg);
    delegate.masterRPC.serve();
   
    ReportEvent r = new ReportEvent("foo");
    r.setStringMetric("bar", "baz");
    Map<String, ReportEvent> rptMap = new HashMap<String, ReportEvent>();
    rptMap.put("test-report", r);
    delegate.putReports(rptMap);
   
    Map<String, Reportable> reportables = rptMan.getReportables();
   
    delegate.stop();
   
    assertEquals(1, reportables.size());
    assertNotNull(reportables.get("test-report"));
View Full Code Here

Examples of com.cloudera.flume.reporter.ReportManager

   * Avro interface: returns a map of reports in serializable form
   */
  @Override
  public AvroFlumeReport getReportByName(CharSequence reportName)
      throws AvroRemoteException {
    ReportManager reportManager = ReportManager.get();
    Map<String, Reportable> reports = reportManager.getReportables();
    if (reports.containsKey(reportName.toString())) {
      return reportToAvro(reports.get(reportName.toString()).getReport());
    }
    return null;
  }
View Full Code Here

Examples of com.cloudera.flume.reporter.ReportManager

   * Thrift interface: returns a serializable report with given name or null if
   * report doesn't exist
   */
  @Override
  public ThriftFlumeReport getReportByName(String reportName) throws TException {
    ReportManager reportManager = ReportManager.get();
    Map<String, Reportable> reports = reportManager.getReportables();
    if (reports.containsKey(reportName)) {
      return reportToThrift(reports.get(reportName).getReport());
    }

    return null;
View Full Code Here

Examples of com.cloudera.flume.reporter.ReportManager

   */
  @Override
  public Map<String, ThriftFlumeReport> getAllReports() throws TException {
    Map<String, ThriftFlumeReport> retMap = new HashMap<String, ThriftFlumeReport>();

    ReportManager reportManager = ReportManager.get();
    Map<String, Reportable> reports = reportManager.getReportables();

    for (Entry<String, Reportable> e : reports.entrySet()) {
      ThriftFlumeReport report = reportToThrift(e.getValue().getReport());
      retMap.put(e.getKey(), report);
    }
View Full Code Here

Examples of com.cloudera.flume.reporter.ReportManager

   * in Reportable objects.
   */
  public void putReports(Map<String, ReportEvent> reports) {
    Preconditions.checkNotNull(reports,
        "putReports called with null report map");
    ReportManager rptManager = ReportManager.get();
    for (final Entry<String, ReportEvent> r : reports.entrySet()) {
      rptManager.add(new Reportable() {

        @Override
        public String getName() {
          return r.getKey();
        }
View Full Code Here

Examples of com.cloudera.flume.reporter.ReportManager

  @Override
  public Map<CharSequence, AvroFlumeReport> getAllReports()
      throws AvroRemoteException {
    Map<CharSequence, AvroFlumeReport> retMap = new HashMap<CharSequence, AvroFlumeReport>();

    ReportManager reportManager = ReportManager.get();
    Map<String, Reportable> reports = reportManager.getReportables();

    for (Entry<String, Reportable> e : reports.entrySet()) {
      AvroFlumeReport report = reportToAvro(e.getValue().getReport());
      retMap.put(e.getKey(), report);
    }
View Full Code Here

Examples of org.emftrace.core.reportmanager.ReportManager

   *
   * @return new ReportManager-component
   */
  public static ReportManager createReportManager()
  {
    return new ReportManager();
  }
View Full Code Here

Examples of org.emftrace.core.reportmanager.ReportManager

    }
   
    @Test
    public void testCreateReportManager()
    {
      ReportManager tmp = null;
      assertNull(tmp);
      tmp = EMFTraceCoreFactory.createReportManager();
      assertNotNull(tmp);
    }
View Full Code Here

Examples of org.joget.report.service.ReportManager

    protected ReportWorkflowProcessInstance updateProcessData(WorkflowProcess wfProcess, WorkflowProcess wfTrackProcess, String appId, String appVersion) {
        String processInstanceId = wfProcess.getInstanceId();

        WorkflowManager workflowManager = (WorkflowManager) AppUtil.getApplicationContext().getBean("workflowManager");
        ReportManager reportManager = (ReportManager) AppUtil.getApplicationContext().getBean("reportManager");
        AppService appService = (AppService) AppUtil.getApplicationContext().getBean("appService");

        if (wfTrackProcess != null) {
            ReportWorkflowProcessInstance pInstance = reportManager.getReportWorkflowProcessInstance(processInstanceId);
            if (pInstance == null) {
                pInstance = new ReportWorkflowProcessInstance();
                pInstance.setInstanceId(processInstanceId);

                //get app
                AppDefinition appDef = appService.getAppDefinition(appId, appVersion);
                ReportApp reportApp = reportManager.getReportApp(appId, appVersion, appDef.getName());

                //get package
                ReportWorkflowPackage reportPackage = reportManager.getReportWorkflowPackage(reportApp, wfProcess.getPackageId(), wfProcess.getVersion(), wfProcess.getName());

                //get process
                ReportWorkflowProcess reportProcess = reportManager.getReportWorkflowProcess(reportPackage, wfProcess.getIdWithoutVersion(), wfProcess.getName());
                pInstance.setReportWorkflowProcess(reportProcess);
            }

            pInstance.setRequester(wfTrackProcess.getRequesterId());
            pInstance.setState(wfProcess.getState());
            pInstance.setDue(wfTrackProcess.getDue());
            pInstance.setStartedTime(wfTrackProcess.getStartedTime());
            pInstance.setFinishTime(wfTrackProcess.getFinishTime());
            pInstance.setDelay(wfTrackProcess.getDelayInSeconds());
            pInstance.setTimeConsumingFromStartedTime(wfTrackProcess.getTimeConsumingFromDateStartedInSeconds());

            reportManager.saveReportWorkflowProcessInstance(pInstance);

            return reportManager.getReportWorkflowProcessInstance(processInstanceId);
        }
        return null;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.