Package com.linkedin.databus2.schemas

Examples of com.linkedin.databus2.schemas.VersionedSchemaSet


    // Get the event buffer
    DbusEventBufferAppendable dbusEventBuffer = getEventBuffer()
        .getDbusEventBufferAppendable(pPartition);

    // Get the schema registry service
    SchemaRegistryService schemaRegistryService = getSchemaRegistryService();

    // Get a stats collector per physical source
    addPhysicalPartitionCollectors(pPartition);
    String statsCollectorName = pPartition.toSimpleString();
    /*
 
View Full Code Here


{
  private final SourceIdNameRegistry _sourcesIdNameRegistry;

  public AbstractRelayFactory()
  {
    this(new SourceIdNameRegistry());
  }
View Full Code Here

  }

  public AbstractRelayFactory(SourceIdNameRegistry sourcesIdNameRegistry)
  {
    if(sourcesIdNameRegistry == null)
      sourcesIdNameRegistry = new SourceIdNameRegistry();
    _sourcesIdNameRegistry = sourcesIdNameRegistry;
  }
View Full Code Here

                     srcidCounts.get((short)2).intValue());

        //check metadata schemas

        EventCountingConsumer myCons = (EventCountingConsumer) mockConsumer;
        VersionedSchema metadataSchema = myCons.getMetadataSchema();
        Assert.assertTrue(null != metadataSchema);

        log.info("Metadata VersionedSchema = " + metadataSchema);
        Assert.assertEquals(metadataSchema.getVersion(),2);
        Assert.assertEquals(metadataSchema.getSchemaBaseName(), SchemaRegistryService.DEFAULT_METADATA_SCHEMA_SOURCE);

        verifyNoLocks(log, eventsBuf);
        log.info("end\n");
    }
View Full Code Here

    LOG.info("Schema = " + schemaRegistry.fetchLatestSchemaBySourceName(_queryStaticConfig.getSourceName()));

    _schema = Schema.parse(schemaRegistry.fetchLatestSchemaBySourceName(_queryStaticConfig.getSourceName()));
    VersionedSchema vs = new VersionedSchema(_schema.getFullName(), (short)1, _schema, null);

    VersionedSchemaSet schemaSet = new VersionedSchemaSet();
    schemaSet.add(vs);
    _decoder = new DbusEventAvroDecoder(schemaSet);
  }
View Full Code Here

        SchemaRegistryService schemaRegistry = FileSystemSchemaRegistryService
            .build(staticConfig.getSchemaRegistry().getFileSystem());
        Map<Short, String> schemaSet = schemaRegistry
            .fetchAllSchemaVersionsBySourceName(source.getSourceName());
        VersionedSchemaSet vSchemaSet = new VersionedSchemaSet();
        Iterator<Map.Entry<Short, String>> it = schemaSet.entrySet().iterator();
        while (it.hasNext())
        {
          Map.Entry<Short, String> pairs = it.next();
          Schema s = Schema.parse(pairs.getValue());
          VersionedSchema vs = new VersionedSchema(s.getFullName(),
              pairs.getKey(), s, null);
          vSchemaSet.add(vs);
        }

        /* Try and identify the schema key */
        VersionedSchema vschema = schemaRegistry
            .fetchLatestVersionedSchemaBySourceName(source.getSourceName());
View Full Code Here

    EasyMock.replay(mockSrcIdReg);

    Map<Short, String> srcSchemaVersions = new HashMap<Short, String>();
    srcSchemaVersions.put(docSchemaV1, docSchema1);
    srcSchemaVersions.put(docSchemaV2, docSchema2);
    VersionedSchemaSet metadataSchemaSet = new VersionedSchemaSet();
    metadataSchemaSet.add(SchemaRegistryService.DEFAULT_METADATA_SCHEMA_SOURCE,
                          metaSchemaV1,
                          new SchemaId(metaSchemaDigest1),
                          metadataSchema1,
                          true);
    metadataSchemaSet.add(SchemaRegistryService.DEFAULT_METADATA_SCHEMA_SOURCE,
                          metaSchemaV2,
                          new SchemaId(metaSchemaDigest2),
                          metadataSchema2,
                          true);
View Full Code Here

  throws RequestProcessingException
  {
    Map<SchemaId, VersionedSchema> versionedSchemas = null;
    try
    {
      VersionedSchemaSet schemaSet = schemaRegistry.fetchAllMetadataSchemaVersions();
      if (schemaSet != null)
      {
        versionedSchemas = schemaSet.getAllVersionsWithSchemaId(SchemaRegistryService.DEFAULT_METADATA_SCHEMA_SOURCE);
      }
    }
    catch (DatabusException ie)
    {
      HttpStatisticsCollector relayStatsCollector = _relay.getHttpStatisticsCollector();
View Full Code Here

    return eventFactory.createReadOnlyDbusEventFromBuffer(serialBuf, 0);
  }

  private DbusEventAvroDecoder createDecoder(VersionedSchemaSet metadataSchemaSet)
  {
    VersionedSchemaSet sourceSchemaSet = new VersionedSchemaSet()// empty is OK for our purposes
    return new DbusEventAvroDecoder(sourceSchemaSet, metadataSchemaSet);
  }
View Full Code Here

    // build the event's metadata and then the event
    DbusEventPart metadataPart = createMetadataPart();
    DbusEvent event = createEvent(metadataPart);

    // create a metadata schema set that correctly corresponds to the metadata
    VersionedSchemaSet metadataSchemaSet = new VersionedSchemaSet();
    metadataSchemaSet.add(SchemaRegistryService.DEFAULT_METADATA_SCHEMA_SOURCE,
                          metadataPart.getSchemaVersion(),              // METADATA_SCHEMA_VERSION
                          new SchemaId(metadataPart.getSchemaDigest()), // METADATA_SCHEMA_CHECKSUM
                          CORRECT_METADATA_SCHEMA,
                          true)// preserve original string
View Full Code Here

TOP

Related Classes of com.linkedin.databus2.schemas.VersionedSchemaSet

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.