Package com.linkedin.databus.client.pub

Examples of com.linkedin.databus.client.pub.DatabusRegistration


        _log.warn("Partition (" + partition
            + ") not available to be dropped. skipping !! Active Partitions :" + regMap.keySet());
        return;
      }

      DatabusRegistration reg = regMap.get(partition);

      // Deregister the regMap which will shutdown the partition
      reg.deregister();

      regMap.remove(partition);
      _partitionSet.remove(partition);

      // remove dropped partition specific metrics
      _relayEventStatsMerger.removeStatsCollector(reg.getRegistrationId().getId());
      _bootstrapEventStatsMerger.removeStatsCollector(reg.getRegistrationId().getId());
      _relayCallbackStatsMerger.removeStatsCollector(reg.getRegistrationId().getId());
      _bootstrapCallbackStatsMerger.removeStatsCollector(reg.getRegistrationId().getId());

      // Notify Listener
      _partitionListener.onDropPartition(partition, reg);
    } else {
      throw new IllegalStateException("Registration is not in correct state to drop a partition !! State :" + _state);
View Full Code Here


    DatabusHttpClientImpl client = new DatabusHttpClientImpl(clientConfig);

    List<DatabusRegistration> regs = new ArrayList<DatabusRegistration>();
    for (String cluster : _clusters)
    {
      DatabusRegistration reg = client.registerCluster(cluster,
                           createConsumerFactory(cluster, _valueDumpFile, _eventDumpFile),
                           createServerSideFactory(cluster),
                           createPartitionListener(cluster),
                           sources);
      regs.add(reg);
View Full Code Here

    // V2 Registration lookup first
    RegistrationStatsInfo regStatsInfo = null;
    try
    {
      DatabusRegistration r = findV2Registration(request, REGISTRATION_KEY_PREFIX);
      writeJsonObjectToResponse(r, request);
    }
    catch (RequestProcessingException ex)
    {
      found = false;
View Full Code Here

   *           when registration could not be found.
   */
  private void pauseResumeRegistration(DatabusRequest request, boolean doPause) throws IOException,
      RequestProcessingException
  {
    DatabusRegistration r = null;
    DatabusV3Registration r2 = null;

    boolean found = true;
    boolean isRunning = false;
    boolean isPaused = false;
    boolean isSuspended = false;
    RegistrationId regId = null;
    RequestProcessingException rEx = null;
    RegStatePair regStatePair = null;
    try
    {
      r = findV2Registration(request, PAUSE_REGISTRATION);
      isRunning = r.getState().isRunning();
      isPaused = (r.getState() == DatabusRegistration.RegistrationState.PAUSED);
      isSuspended =
          (r.getState() == DatabusRegistration.RegistrationState.SUSPENDED_ON_ERROR);
      regId = r.getRegistrationId();
    }
    catch (RequestProcessingException ex)
    {
      found = false;
      rEx = ex;
    }

    if (!found)
    {
      try
      {
        r2 = findV3Registration(request, PAUSE_REGISTRATION);
        found = true;
        isRunning = r2.getState().isRunning();
        isPaused = (r2.getState() == RegistrationState.PAUSED);
        isSuspended = (r2.getState() == RegistrationState.SUSPENDED_ON_ERROR);
        regId = r.getRegistrationId();
      }
      catch (RequestProcessingException ex)
      {
        found = false;
        rEx = ex;
      }
    }

    if (!found)
      throw rEx;

    LOG.info("REST call to pause registration : " + regId);

    if (isRunning)
    {
      if (doPause)
      {
        if (!isPaused)
        {
          if (null != r)
          {
            r.pause();
            regStatePair = new RegStatePair(r.getState(), r.getRegistrationId());
          }
          else
          {
            r2.pause();
            regStatePair = new RegStatePair(r2.getState().name(), r2.getRegistrationId());
          }
        }
      }
      else
      {
        if (isPaused || isSuspended)
        {
          if (null != r)
          {
            r.resume();
            regStatePair = new RegStatePair(r.getState(), r.getRegistrationId());
          }
          else
          {
            r2.resume();
            regStatePair = new RegStatePair(r2.getState().name(), r2.getRegistrationId());
View Full Code Here

TOP

Related Classes of com.linkedin.databus.client.pub.DatabusRegistration

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.