Package com.linkedin.databus2.core

Examples of com.linkedin.databus2.core.BackoffTimer


    _isConsumeCurrent = isConsumeCurrent;
    _remoteExceptionHandler = new RemoteExceptionHandler(sourcesConn, dbusEventBuffer, eventFactory);
    _relayCallsStats = _sourcesConn.getLocalRelayCallsStatsCollector();
    _isReadLatestScnOnErrorEnabled = isReadLatestScnOnErrorEnabled;
    _pullerBufferUtilizationPct = pullerBufferUtilPct;
    _retriesOnFallOff = new BackoffTimer("RetriesOnFallOff",
        new BackoffTimerStaticConfig(0, 0, 1, 0, sourcesConn.getConnectionConfig().getNumRetriesOnFallOff()));
    _noEventsConnectionResetTimeSec = noEventsConnectionResetTimeSec;
  }
View Full Code Here


    Random rng = new Random();
    DatabusRelayConnection relayConn = null;
    ServerInfo serverInfo = null;

    int retriesLeft;
    BackoffTimer originalCounter =_status.getRetriesCounter();

    if( curState.isRelayFellOff())
      _status.setRetriesCounter(_retriesOnFallOff);

    while (null == relayConn && (retriesLeft = _status.getRetriesLeft()) >= 0 && !checkForShutdownRequest())
View Full Code Here

    // Create a infinite backoff timer that waits for maximum of 1 sec
    // for writing the control message to evb
    BackoffTimerStaticConfig timerConfig = new BackoffTimerStaticConfig(
        1, 1000, 1, 1, -1);
    BackoffTimer timer = new BackoffTimer("EVB More Space Timer",
        timerConfig);
    timer.reset();

    byte[] eventBytes = new byte[event.size()];

    _log.info("Event size: " + eventBytes.length);
    _log.info("Event:" + event.toString());

    event.getRawBytes().get(eventBytes);

    UnifiedClientStats unifiedClientStats = _sourcesConn.getUnifiedClientStats();

    while ((!success) && (timer.getRemainingRetriesNum() > 0))
    {
      ByteArrayInputStream cpIs = new ByteArrayInputStream(
          eventBytes);
      ReadableByteChannel cpRbc = Channels.newChannel(cpIs);

      sendHeartbeat(unifiedClientStats);
      int ecnt = curState.getDataEventsBuffer().readEvents(cpRbc);
      if (ecnt <= 0) {
        _log.error("Not enough spece in the event buffer to add a control message :" + message);
        boolean interrupted = !timer.backoffAndSleep();

        if (interrupted)
          throw new InterruptedException(
              "Got interrupted while waiting to write control Message to EVB : " + message);
      } else {
View Full Code Here

                             Logger log)
  {
    super(name, sourcesConn.getConnectionConfig().getBstPullerRetries(), sourcesConn, dbusEventBuffer,
          connStateFactory, bootstrapServers, mbeanServer, eventFactory, log);

    _retriesBeforeCkptCleanup = new BackoffTimer("BSPullerRetriesBeforeCkptCleanup",
                                                 sourcesConn.getConnectionConfig().getBsPullerRetriesBeforeCkptCleanup());
    _bootstrapFilterConfigs = bootstrapFilterConfigs;
    _remoteExceptionHandler = new RemoteExceptionHandler(sourcesConn, dbusEventBuffer, eventFactory);
    _pullerBufferUtilizationPct = pullerBufferUtilPct;
    _v3BootstrapLock = v3BootstrapLock;
View Full Code Here

  public DatabusComponentStatus(String componentName,
                                Status status, String detailedMessage,
                                BackoffTimerStaticConfig errorRetriesConf)
  {
    this(componentName, status, detailedMessage,
         new BackoffTimer(componentName + ".errorRetries", errorRetriesConf));
  }
View Full Code Here

  {
    _config = config;
    _logicalSources = logicalSources;
    _statsCollector = statsCollector;
    _maxRowsInLog = _config.getBootstrapLogSize();
    _retryTimer = new BackoffTimer("BootstrapProducer", config.getRetryConfig());
    _errorRetriesExceeded = false;
    _errorHandler = errorHandler;
    getConnection();
    init();
  }
View Full Code Here

 
  private BackoffTimer _errorRetry;

  public FetchMaxSCNRequest(BackoffTimerStaticConfig backoffConfig)
  {
    _errorRetry = new BackoffTimer("FetchMaxSCNRequest", backoffConfig);
  }
View Full Code Here

  {
    super(name);
    _source = source;
    _bootstrapDao = null;
    _config = config;
    _retryTimer = new BackoffTimer(name + "RetryTimer", config.getRetryConfig());
    _statsCollector = statsCollector;
    _srcRm = new RateMonitor(name + "ProducerSourceRateMonitor");
    _totalRm = new RateMonitor(name + "ProducerTotalRateMonitor");

  }
View Full Code Here

        queryHints, queryHints);
    sources[0] = lssc;
    String role = "MASTER";
    long slowSourceQueryThreshold = 0L;
    long restartScnOffset = 0L;
    BackoffTimerStaticConfigBuilder bsc = new BackoffTimerStaticConfigBuilder();
    ChunkingType ct = ChunkingType.NO_CHUNKING;
    long txnsPerChunk = 0L;
    long scnChunkSize = 0L;
    long chunkedScnThreshold = 0L;
    long maxScnDelayMs = 0L;
    long eventRatePerSec = rate;
    long eventRateThrottleDuration = throttleDuration;
    int largestEventSizeInBytes = 10240;
    long largestWindowSizeInBytes = 10240;
    DbusEventBuffer.Config cfgBuilder = new DbusEventBuffer.Config();
    cfgBuilder.setMaxSize(10 * 1024 * 1024);
    cfgBuilder.setScnIndexSize(2 * 1024 * 1024);
    cfgBuilder.setAllocationPolicy("MMAPPED_MEMORY");

    DbusEventBuffer.StaticConfig dbusEventBuffer = cfgBuilder.build();

    boolean errorOnMissingFields = true;
    String xmlVersion = "1.0";
    String xmlEncoding = "";
    String fieldName = "";
    String regex = "";
    ReplicationBitSetterStaticConfig replicationBitSetter = new ReplicationBitSetterStaticConfig(
        ReplicationBitSetterStaticConfig.SourceType.NONE, fieldName, regex, MissingValueBehavior.STOP_WITH_ERROR);
    PhysicalSourceStaticConfig pssc = new PhysicalSourceStaticConfig(name, id,
        uri, resourceKey, sources, role, slowSourceQueryThreshold,
        restartScnOffset, bsc.build(), ct, txnsPerChunk, scnChunkSize,
        chunkedScnThreshold, maxScnDelayMs, eventRatePerSec, eventRateThrottleDuration, dbusEventBuffer,
        largestEventSizeInBytes, largestWindowSizeInBytes,
        errorOnMissingFields, xmlVersion, xmlEncoding, replicationBitSetter);
    return pssc;
  }
View Full Code Here

  }

  public static ErrorResponse createUnexpectedControlEventErrorResponse(String msg)
  {
    return new ErrorResponse(BinaryProtocol.RESULT_ERR_UNEXPECTED_CONTROL_EVENT,
                             new DatabusException(msg));
  }
View Full Code Here

TOP

Related Classes of com.linkedin.databus2.core.BackoffTimer

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.