Package com.linkedin.databus.core.data_model

Examples of com.linkedin.databus.core.data_model.LogicalSource


                         new LogicalPartition(LogicalSourceConfig.DEFAULT_LOGICAL_SOURCE_PARTITION));
  }

  /** get physical partition mapping by logical source */
  public PhysicalPartition getPhysicalPartition(int srcId, LogicalPartition lPartition ) {
    LogicalSource lSource = _logicalId2LogicalSource.get(srcId);
    if(lSource == null)
      return null;

    LogicalPartitionKey lKey = new LogicalPartitionKey(lSource, lPartition);
    PhysicalPartitionKey pKey = _logicalPKey2PhysicalPKey.get(lKey);
View Full Code Here


      // make sure that there is a buf for each id
      // and some can point to the same buf
      boolean debugEnabled = LOG.isDebugEnabled();
      for(int id: ids) {
        // figure out LogicalSource
        LogicalSource lSource = _logicalId2LogicalSource.get(id);
        LogicalPartition lPartition = null; // TBD - should be passed by caller
        if(lPartition == null)
          lPartition = LogicalPartition.createAllPartitionsWildcard(); // use wild card

        if (debugEnabled) LOG.debug("Streaming for logical source=" + lSource + "; partition=" +
View Full Code Here

    DatabusRequest mockReq = EasyMock.createMock(DatabusRequest.class);
    EasyMock.expect(mockReq.getParams()).andReturn(params).anyTimes();
    EasyMock.expect(mockReq.getResponseContent()).andReturn(chunkedWritableByteChannel);
    EasyMock.replay(mockReq);

    LogicalSource lsrc1 = new LogicalSource(srcId1, srcName1);
    SourceIdNameRegistry mockSrcIdReg = EasyMock.createMock(SourceIdNameRegistry.class);
    EasyMock.expect(mockSrcIdReg.getSource(srcId1)).andReturn(lsrc1).anyTimes();
    EasyMock.replay(mockSrcIdReg);

    Map<Short, String> srcSchemaVersions = new HashMap<Short, String>();
View Full Code Here

    DatabusRequest mockReq = EasyMock.createMock(DatabusRequest.class);
    EasyMock.expect(mockReq.getParams()).andReturn(params).anyTimes();
    EasyMock.expect(mockReq.getResponseContent()).andReturn(chunkedWritableByteChannel);
    EasyMock.replay(mockReq);

    LogicalSource lsrc1 = new LogicalSource(srcId1, srcName1);
    SourceIdNameRegistry mockSrcIdReg = EasyMock.createMock(SourceIdNameRegistry.class);
    EasyMock.expect(mockSrcIdReg.getSource(srcId1)).andReturn(lsrc1).anyTimes();
    EasyMock.replay(mockSrcIdReg);

    Map<Short, String> srcSchemaVersions = new HashMap<Short, String>();
View Full Code Here

    DatabusRequest mockReq = EasyMock.createMock(DatabusRequest.class);
    EasyMock.expect(mockReq.getParams()).andReturn(params).anyTimes();
    EasyMock.replay(mockReq);

    LogicalSource lsrc1 = new LogicalSource(srcId1, srcName1);
    SourceIdNameRegistry mockSrcIdReg = EasyMock.createMock(SourceIdNameRegistry.class);
    EasyMock.expect(mockSrcIdReg.getSource(srcId1)).andReturn(lsrc1).anyTimes();
    EasyMock.replay(mockSrcIdReg);

    Map<Short, String> srcSchemaVersions = new HashMap<Short, String>();
View Full Code Here

    DatabusRequest mockReq = EasyMock.createMock(DatabusRequest.class);
    EasyMock.expect(mockReq.getParams()).andReturn(params).anyTimes();
    EasyMock.expect(mockReq.getResponseContent()).andReturn(chunkedWritableByteChannel);
    EasyMock.replay(mockReq);

    LogicalSource lsrc1 = new LogicalSource(srcId1, srcName1);
    SourceIdNameRegistry mockSrcIdReg = EasyMock.createMock(SourceIdNameRegistry.class);
    EasyMock.expect(mockSrcIdReg.getSource(srcId1)).andReturn(lsrc1).anyTimes();
    EasyMock.replay(mockSrcIdReg);

    SchemaRegistryService mockSchemaReg = EasyMock.createMock(SchemaRegistryService.class);
View Full Code Here

      //convert source ids into subscriptions
      if (null == subs) subs = new ArrayList<DatabusSubscription>();
      for (Integer srcId: sourceIds)
      {
        LogicalSource lsource = srcRegistry.getSource(srcId);
        if(lsource == null)
          throw new InvalidRequestParamValueException(COMMAND_NAME, SOURCES_PARAM, srcId.toString());
        if(isDebug)
          LOG.debug("registry returns " + lsource  + " for srcid="+ srcId);
        DatabusSubscription newSub = DatabusSubscription.createSimpleSourceSubscription(lsource);
View Full Code Here

    super();
    _id = id;
    _name = name;
    _uri = uri;
    _partitionFunction = partitionFunction;
    _source = new LogicalSource(Integer.valueOf(_id), _name)// SHOULD be name or uri?
    _partition = new LogicalPartition(partition);
    _skipInfinityScn = skipInfinityScn;
    _regularQueryHints = regularQueryHints;
    _chunkedTxnQueryHints = chunkedTxnQueryHints;
    _chunkedScnQueryHints = chunkedScnQueryHints;
View Full Code Here

      for (String sourceIdStr: sourcesStrArray)
      {
        try
        {
          Integer id = Integer.valueOf(sourceIdStr);
          LogicalSource source = _relay.getSourcesIdNameRegistry().getSource(id);
          if (null != source) sourcesIdList.add(source.asIdNamePair());
          else LOG.error("unable to find source id: " + id);
        }
        catch (NumberFormatException nfe)
        {
          throw new InvalidRequestParamValueException(COMMAND_NAME, SOURCES_NAME_PARAM, sourceIdStr);
View Full Code Here

          int srcId;
          String trimmedSourceId = sourceId.trim();
          try
          {
            srcId = Integer.valueOf(trimmedSourceId);
            LogicalSource lsource = _relay.getSourcesIdNameRegistry().getSource(srcId);
            if (null != lsource) logicalSources.add(lsource);
            else
            {
              LOG.error("No source name for source id: " + srcId);
              throw new InvalidRequestParamValueException(COMMAND_NAME, SOURCES_PARAM, sourceId);
            }
          }
          catch (NumberFormatException nfe)
          {
            if (relayStatsCollector != null)
            {
              relayStatsCollector.registerInvalidRegisterCall();
            }
            throw new InvalidRequestParamValueException(COMMAND_NAME, SOURCES_PARAM, sourceId);
          }
        }
      }

      SchemaRegistryService schemaRegistry = _relay.getSchemaRegistryService();
      ArrayList<RegisterResponseEntry> registeredSources = new ArrayList<RegisterResponseEntry>(20);

      for (LogicalSource lsource: logicalSources)
      {
        getSchemas(schemaRegistry, lsource.getName(), lsource.getId(), sources, registeredSources);
      }

      // Note that, as of April 2013, the Espresso sandbox's schema registry
      // (in JSON format) is 4.5 MB and growing.  But 100 KB is probably OK
      // for regular production cases.
View Full Code Here

TOP

Related Classes of com.linkedin.databus.core.data_model.LogicalSource

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.