Package com.linkedin.databus2.producers.db

Examples of com.linkedin.databus2.producers.db.EventReaderSummary


              .getStatsCollector(statsCollectorName),
          maxScnReaderWriters);
    } else if (uri.startsWith("mock")) {
      // Get all relevant pConfig attributes
      //TODO add real instantiation
      EventProducerServiceProvider mockProvider = _producersRegistry.getEventProducerServiceProvider("mock");
      if (null == mockProvider)
      {
        throw new DatabusRuntimeException("relay event producer not available: " + "mock");
      }
      producer = mockProvider.createProducer(pConfig, schemaRegistryService,
                                             dbusEventBuffer,
                                             _inBoundStatsCollectors
                                                     .getStatsCollector(statsCollectorName),
                                             maxScnReaderWriters);
    } else if (uri.startsWith("gg:")){
      producer = new GoldenGateEventProducer(pConfig,
                                             schemaRegistryService,
                                             dbusEventBuffer,
                                             _inBoundStatsCollectors
                                                 .getStatsCollector(statsCollectorName),
                                             maxScnReaderWriters);

    } else if (uri.startsWith("mysql:")){
       LOG.info("Adding OpenReplicatorEventProducer for uri :" + uri);
       final String serviceName = "or";
       EventProducerServiceProvider orProvider = _producersRegistry.getEventProducerServiceProvider(serviceName);
       if (null == orProvider)
       {
         throw new DatabusRuntimeException("relay event producer not available: " + serviceName);
       }
       producer = orProvider.createProducer(pConfig, schemaRegistryService,
                                            dbusEventBuffer,
                                            _inBoundStatsCollectors.getStatsCollector(statsCollectorName),
                                            maxScnReaderWriters);
    } else
     {
View Full Code Here


     {
      // Get all relevant pConfig attributes and initialize the nettyThreadPool objects
      RelayEventProducer.DatabusClientNettyThreadPools nettyThreadPools =
            new RelayEventProducer.DatabusClientNettyThreadPools(0,getNetworkTimeoutTimer(),getBossExecutorService(),
                                        getIoExecutorService(), getHttpChannelGroup());
      producer = new RelayEventProducer(pConfig, dbusEventBuffer,
          _inBoundStatsCollectors
              .getStatsCollector(statsCollectorName),
          maxScnReaderWriters,nettyThreadPools);
    }
View Full Code Here

        for ( OracleTriggerMonitoredSourceInfo sourceInfo : _sources)
        {
          LOG.info("Bootstrapping " + sourceInfo.getEventView());
          _bootstrapSeedWriter.start(maxScn);
          EventReaderSummary summary = readEventsForSource(sourceInfo, maxScn);
          // Script assumes seeding is done for one schema at a time
          // just use one source to get the schema name for sy$txlog
          endScn = getMaxScn(_sources.get(0));
          _bootstrapSeedWriter.endEvents(BootstrapEventBuffer.END_OF_SOURCE, endScn, null);
          summaries.add(summary);
View Full Code Here

      }
    }
    long timeEnd = System.currentTimeMillis();
    long elapsedMin = (timeEnd - timeStart)/(MILLISEC_TO_MIN);
    LOG.info("Processed " + numRowsFetched + " rows of Source: " +  sourceInfo.getSourceName() + " in " + elapsedMin + " minutes" );
    return new EventReaderSummary(sourceInfo.getSourceId(), sourceInfo.getSourceName(), -1,
                                  numRowsFetched, totalEventSize, (timeEnd - timeStart),totProcessTime,0,0,0);
  }
View Full Code Here

       
        String dir = _config.getAvroSeedInputDirMap().get(sourceInfo.getEventView());
       
        File d = new File(dir);

        EventReaderSummary summary = readEventsFromHadoopFiles(sourceInfo, d, endScn);
        // Script assumes seeding is done for one schema at a time
        _bootstrapEventBuffer.endEvents(BootstrapEventBuffer.END_OF_SOURCE, endScn, null);
        summaries.add(summary);
      }
      } catch (Exception ex) {
View Full Code Here

      }
   
    long timeEnd = System.currentTimeMillis();
    long elapsedMin = (timeEnd - timeStart)/(MILLISEC_TO_MIN);
    LOG.info("Processed " + numRead + " rows of Source: " +  sourceInfo.getSourceName() + " in " + elapsedMin + " minutes" );
    return new EventReaderSummary(sourceInfo.getSourceId(), sourceInfo.getSourceName(), -1,
                    (int)numRead, numBytes, (timeEnd - timeStart),(timeEnd-timeStart)/numRead,0,0,0);
  }
View Full Code Here

      }
      long endDbUpdatesMs = System.currentTimeMillis();
      long dbUpdatesElapsedTimeMs = endDbUpdatesMs - startDbUpdatesMs;

      // Log Event Summary at logical source level
      EventReaderSummary summary = new EventReaderSummary(sourceId, _monitoredSources.get(sourceId).getSourceName(),
                                                          scn, eventsInDbUpdate, dbUpdatesEventsSize,-1L /* Not supported */,
                                                          dbUpdatesElapsedTimeMs,  timestamp, timestamp, -1L /* Not supported */);
      if (_eventsLog.isInfoEnabled())
      {
        _eventsLog.info(summary.toString());
      }
      summaries.add(summary);

      if(_log.isDebugEnabled())
        _log.debug("There are "+ eventsInDbUpdate + " events seen in the current dbUpdate");
    }

    // Log Event Summary at Physical source level
    ReadEventCycleSummary summary = new ReadEventCycleSummary(_pConfig.getName(),
                                                              summaries,
                                                              scn,
                                                              -1 /* Overall time including query time not calculated */);

    if (_eventsLog.isInfoEnabled())
    {
      _eventsLog.info(summary.toString());
    }

    _log.info("Writing "+ eventsInTransactionCount + " events from transaction with scn: " + scn);
    if(scn <= 0)
      throw new DatabusException("Unable to write events to buffer because of negative/zero scn: " + scn);
View Full Code Here

        long endDbUpdatesMs = System.currentTimeMillis();
        long dbUpdatesElapsedTimeMs = endDbUpdatesMs - startDbUpdatesMs;

        // Log Event Summary at logical source level
        EventReaderSummary summary = new EventReaderSummary(sourceId, _monitoredSources.get(sourceId).getSourceName(),
                                                            scn, t.getDbChangeEntrySet().size(), dbUpdatesEventsSize,-1L /* Not supported */,
                                                            dbUpdatesElapsedTimeMs,  timestamp, timestamp, -1L /* Not supported */);
        if (_eventsLog.isInfoEnabled())
        {
          _eventsLog.info(summary.toString());
        }
        summaries.add(summary);

        long tsEnd = System.currentTimeMillis();
        perSourceStats.addTimeOfLastDBAccess(tsEnd);
        globalStats.addTimeOfLastDBAccess(tsEnd);
      }
      _eventBuffer.endEvents(scn, _relayInboundStatsCollector);
      // Log Event Summary at Physical source level
      ReadEventCycleSummary summary = new ReadEventCycleSummary(_physicalSourceStaticConfig.getName(),
                                                                summaries,
                                                                scn,
                                                                -1 /* Overall time including query time not calculated */);

      if (_eventsLog.isInfoEnabled())
      {
        _eventsLog.info(summary.toString());
      }
    }
View Full Code Here

    protected EventReaderSummary getSummary(int sourceId)
    {
      DbusEventsTotalStats stats = _stats.getSourceStats(sourceId);
      if (stats != null)
      {
        EventReaderSummary summary = new EventReaderSummary( (short) sourceId, stats.getDimension(),
            stats.getMaxScn(), (int) stats.getNumDataEvents(),
            stats.getSizeDataEvents()*(int) (stats.getNumDataEvents()),
            System.currentTimeMillis(), 0, _stats.getTotalStats().getTimestampMinScnEvent(),
            stats.getTimestampMaxScnEvent(),0L);
        return summary;
View Full Code Here

    /**
     * produce diff of eventreader summary s1-s2
     */
    protected EventReaderSummary getDiff(EventReaderSummary s1, EventReaderSummary s2)
    {
      EventReaderSummary diff = new EventReaderSummary(s1.getSourceId(), s1.getSourceName(), s1.getEndOfPeriodSCN(),
          s1.getNumberOfEvents()-s2.getNumberOfEvents(), s1.getSizeOfSerializedEvents()-s2.getSizeOfSerializedEvents(), s1.getReadMillis()-s2.getReadMillis(),
          s1.getEventMillis(),
          s2.getTimeProdEnd(), s1.getTimeProdEnd(), s1.getQueryExecTime());
      return diff;
    }
View Full Code Here

TOP

Related Classes of com.linkedin.databus2.producers.db.EventReaderSummary

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.