Package com.linkedin.databus.core.util

Examples of com.linkedin.databus.core.util.InvalidConfigException


    @Override
    public RuntimeConfig build() throws InvalidConfigException
    {
      if (null != _managedInstance) return _managedInstance.new RuntimeConfig(_enabled);
      throw new InvalidConfigException("No ContainerStatisticsCollector instance assigned");
    }
View Full Code Here


    @Override
    public RuntimeConfig build() throws InvalidConfigException
    {
      if (null != _managedInstance) return _managedInstance.new RuntimeConfig(_enabled);
      throw new InvalidConfigException("No ContainerStatisticsCollector instance assigned");
    }
View Full Code Here

  {
    // Make sure the URI from the configuration file identifies an Oracle JDBC source.
    String uri = physicalSourceConfig.getUri();
    if(!uri.startsWith("jdbc:oracle"))
    {
      throw new InvalidConfigException("Invalid source URI (" + physicalSourceConfig.getUri() + "). Only jdbc:oracle: URIs are supported.");
    }

    // Parse each one of the logical sources
    List<OracleTriggerMonitoredSourceInfo> sources = new ArrayList<OracleTriggerMonitoredSourceInfo>();
    for(LogicalSourceStaticConfig sourceConfig : physicalSourceConfig.getSources())
    {
      OracleTriggerMonitoredSourceInfo source = buildOracleMonitoredSourceInfo(sourceConfig, physicalSourceConfig, schemaRegistryService);
      sources.add(source);
    }

    DataSource ds = null;
    try
    {
        ds = OracleJarUtils.createOracleDataSource(uri);
    } catch (Exception e)
    {
      String errMsg = "Oracle URI likely not supported. Trouble creating OracleDataSource";
      _log.error(errMsg);
      throw new InvalidConfigException(errMsg + e.getMessage());
    }

    // Create the event producer
    EventProducer eventProducer = new OracleEventProducer(sources,
                                                          ds,
View Full Code Here

  {
    String schema = null;
  try {
    schema = schemaRegistryService.fetchLatestSchemaBySourceName(sourceConfig.getName());
  } catch (NoSuchSchemaException e) {
        throw new InvalidConfigException("Unable to load the schema for source (" + sourceConfig.getName() + ").");
  }

    if(schema == null)
    {
      throw new InvalidConfigException("Unable to load the schema for source (" + sourceConfig.getName() + ").");
    }

    _log.info("Loading schema for source id " + sourceConfig.getId() + ": " + schema);

View Full Code Here

        return new ConstantPartitionFunction(constantPartitionNumber);
      }
      catch(Exception ex)
      {
        // Could be a NumberFormatException, IndexOutOfBoundsException or other exception when trying to parse the partition number.
        throw new InvalidConfigException("Invalid partition configuration (" + partitionFunction + "). " +
            "Could not parse the constant partition number.");
      }
    }
    else
    {
      throw new InvalidConfigException("Invalid partition configuration (" + partitionFunction + ").");
    }
  }
View Full Code Here

      long bufferCapacityInBytes = bufferConfig.getMaxSize();
      long maxWindowSizeInBytes = (long) ((connConfig
          .getCheckpointThresholdPct() / 100.0) * bufferCapacityInBytes);
      //After DDSDBUS-3222, this condition essentially boils down to : checkpointThresholdPct can at most be 100-(10K/maxSize) - in practice at least 99.99%
      if ((maxWindowSizeInBytes + connConfig.getFreeBufferThreshold()) > bufferCapacityInBytes) {
        throw new InvalidConfigException(
            "Invalid configuration. Could lead to deadlock: ((checkPointThresholdPct*maxSize) + freeBufferThreshold) > maxSize"
        + " freeBufferThreshold=" + _freeBufferThreshold + " checkpointThresholdPct=" + _checkpointThresholdPct
        + " maxSize=" + bufferCapacityInBytes);
      }
      int readBufferSize = bufferConfig.getReadBufferSize();
      //After DDSDBUS-3222, this condition essentially boils down to : is readBufferSize > 10K - which is the fixed size of freeBufferThreshold
      if (readBufferSize <= connConfig.getFreeBufferThreshold() )
      {
          throw new InvalidConfigException(
                        "Invalid configuration. Could lead to deadlock: readBufferSize <= freeBufferThreshold. Increase readBufferSize to be greater than freeBufferThreshold "
                                + " readBufferSize=" + readBufferSize + " freeBufferThreshold= " + _freeBufferThreshold
                        );
      }
    }
View Full Code Here

      if ((_keyMin >= 0) && (_keyMax > 0)) {
        keyRange = new Range(_keyMin, _keyMax);
      }

      if (getConsumerParallelism() < 1) {
        throw new InvalidConfigException(
            "Invalid consumer parallelism:"
                + getConsumerParallelism());
      }

      if (_checkpointThresholdPct <= 0.0 || _checkpointThresholdPct > 100.0)
      {
        throw new InvalidConfigException("checkpointThresholdPct must be in (0, 100]");
      }

      validateMaxEventSize(_eventBuffer);
      if(_bstEventBuffer != null)
      {
View Full Code Here

  }

  @Override
  public BackoffTimerStaticConfig build() throws InvalidConfigException
  {
    if (0 > _initSleep) throw new InvalidConfigException("initial sleep must be non-negative:" +
        _initSleep);
    if (0 > _maxSleep) throw new InvalidConfigException("max sleep must be non-negative: " +
        _maxSleep);

    BackoffTimerStaticConfig newConfig = new BackoffTimerStaticConfig(_initSleep, _maxSleep,
        _sleepIncFactor, _sleepIncDelta, _maxRetryNum);

    //sanity check
    long secondSleep = newConfig.calcNextSleep(_initSleep);
    if (secondSleep < _initSleep || secondSleep < 0)
      throw new InvalidConfigException("sleeps are decreasing!");

    return newConfig;
  }
View Full Code Here

      StaticConfig config = null;
      try
      {
        config = new StaticConfig(numBuckets, IDConfig.fromString(buckets));
      } catch (Exception ex) {
        throw new InvalidConfigException(ex);
      }     
      return config;
    }
View Full Code Here

        cpPersistenceProvider = new SharedCheckpointPersistenceProvider(groupMember, getSharedState());
        break;

        case EXISTING: cpPersistenceProvider = _existing; break;
        case NONE: cpPersistenceProvider = null; break;
        default: throw new InvalidConfigException("Unable to create persistence provider of type: " +
                                       getType());
      }

      return cpPersistenceProvider;
    }
View Full Code Here

TOP

Related Classes of com.linkedin.databus.core.util.InvalidConfigException

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.