Package com.linkedin.databus.bootstrap.common

Examples of com.linkedin.databus.bootstrap.common.SourceInfo


  @Override
  public ConsumerCallbackResult onStartSource(String source, Schema sourceSchema)
  {
    _numEvents = 0;
    boolean ret = false;
    SourceInfo srcInfo = null;
    _currentSource = source;
    _srcRm.start();
    try
    {
      srcInfo = _trackedSources.get(source);
      if (null == srcInfo)
      {
        LOG.error("Source :"
            + source
            + " not managed in this bootstrap DB instance !! Managed Sources : ("
            + _trackedSources + ")");
        return ConsumerCallbackResult.ERROR;
      }
      ret = prepareStatement(srcInfo.getSrcId());
    } catch (SQLException e)
    {

      if (null != _statsCollector)
        _statsCollector.registerSQLException();
View Full Code Here


  }

  private void updateProducerSourceMetaData(String source) throws SQLException
  {
    // Update the metadata for this source
    SourceInfo srcinfo = _trackedSources.get(source);
    _currentRowId = getLastLogEntry(source);
    _currentLogId = srcinfo.getCurrLogId();

    setLogPosition(_currentLogId, _currentRowId, _newWindowScn, source);

    // Update the source info for this source
    srcinfo.setMaxRowId(_currentRowId);
    srcinfo.setWindowScn(_newWindowScn);
  }
View Full Code Here

  private void updateSourcesInDB() throws SQLException
  {
    for (Map.Entry<String, SourceInfo> entry : _trackedSources.entrySet())
    {
      SourceInfo srcinfo = entry.getValue();
      srcinfo.saveToDB(getConnection());
    }

    for (Map.Entry<String, SourceInfo> entry : _trackedSources.entrySet())
    {
      SourceInfo srcinfo = entry.getValue();
      if (srcinfo.getNumRows() >= _maxRowsInLog)
      {
        srcinfo.switchLogFile(getConnection());
        setLogPosition(srcinfo.getCurrLogId(), 0, _newWindowScn, entry.getKey());
        // getConnection().commit();
        _bootstrapDao.createNewLogTable(srcinfo.getSrcId());
      }
    }
  }
View Full Code Here

TOP

Related Classes of com.linkedin.databus.bootstrap.common.SourceInfo

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.