Package com.linkedin.databus.core

Examples of com.linkedin.databus.core.DatabusRuntimeException


      Integer i = yc.getValue();
      return i;
    }
    else
    {
      throw new DatabusRuntimeException("Unknown MySQL type in the event" + s.getClass() + " Object = " + s);
    }
  }
View Full Code Here


    URI u = null;
    try
    {
      u = new URI(s);
    } catch (URISyntaxException e){
      throw new DatabusRuntimeException("Unable to decode a URI from the string s = " + s + " subscription = " + toString());
    }


    if (null == u.getScheme())
    {
      // TODO: Have V2 style subscriptions have an explicit codec type. Make it return "legacy" codec
      // here. Given a subscription string, we should be able to convert it to DatabusSubscription
      // in an idempotent way. That is, converting back and forth should give the same value

      // Subscription of type com.linkedin.databus.events.dbName.tableName
      String[] parts = s.split("\\.");
      int len = parts.length;
      if (len == 0)
      {
        // Error case
        String errMsg = "Unexpected format for subscription. sub = " + toString() + " string = " + s;
        throw new DatabusRuntimeException(errMsg);
      }
      else if (len == 1)
      {
        // Unit-tests case: logicalSource is specified as "source1"
        return parts[0];
      }
      else
      {
        // Expected case. com.linkedin.databus.events.dbName.tableName
        String pn = parts[len-2] + "_" + parts[len-1];
        return pn;
      }
    }
    else if (u.getScheme().equals("espresso"))
    {
      // Given that this subscription conforms to EspressoSubscriptionUriCodec,
      // logicalSourceName (DBName.TableName) and partitionNumber(1) are guaranteed to be non-null
      String dbName = getPhysicalPartition().getName();
      boolean isWildCardOnTables = getLogicalSource().isAllSourcesWildcard();
      String name = getLogicalPartition().getSource().getName();
      boolean isWildCardOnPartitions = getPhysicalPartition().isAnyPartitionWildcard();
      String pId =  getPhysicalPartition().getId().toString();

      StringBuilder sb = new StringBuilder();
      sb.append(dbName);

      if (! isWildCardOnTables)
      {
        sb.append("_");
        String[] parts = name.split("\\.");
        assert(parts.length == 2);
        sb.append(parts[1]);
      }

      if (!isWildCardOnPartitions)
      {
        sb.append("_");
        sb.append(pId);
      }

      s = sb.toString();
    }
    else
    {
      String errMsg = "The subscription object described as " + toString() + " is not of null or espresso type codec";
      throw new DatabusRuntimeException(errMsg);
    }
    return s;
  }
View Full Code Here

  {
    FileSystemSchemaRegistryService service = new FileSystemSchemaRegistryService(config);
    service.initializeSchemaSet();
    if (0 == service.getCurSchemaSet().size())
    {
      throw new DatabusRuntimeException("no schemas loaded; please check the schemas directory: " +
                                        config.getSchemaDir().getAbsolutePath() );
    }

    if (config.getRefreshPeriodMs() > 0)
    {
View Full Code Here

TOP

Related Classes of com.linkedin.databus.core.DatabusRuntimeException

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.