Examples of SchemaId


Examples of com.linkedin.databus2.schemas.SchemaId

          break;

        default:
          break;
      }
      SchemaId schemaId = schemaStr != null ? SchemaId.createWithMd5(schemaStr) : null;
      byte[] schemaBytes = schemaId != null? schemaId.getByteArray(): new byte[16];
      initBufferWithEvents(eventsBuf, keyBase, numEvents, srcId,schemaBytes, keyCounts, srcidCounts);
    }
View Full Code Here

Examples of com.linkedin.databus2.schemas.SchemaId

      //Refresh metadata schema map
      if ((metadataSchemaList != null) && !metadataSchemaList.isEmpty())
      {
        for (RegisterResponseMetadataEntry e: metadataSchemaList)
        {
          SchemaId id = new SchemaId(e.getCrc32());
          if (_metadataSchemasSet.add(SchemaRegistryService.DEFAULT_METADATA_SCHEMA_SOURCE,e.getVersion(),id,e.getSchema()))
          {
            LOG.info("Added metadata schema version " + e.getVersion() + ",schemaID=0x" + id);
          }
          else
View Full Code Here

Examples of com.linkedin.databus2.schemas.SchemaId

  @Override
  public GenericRecord getGenericRecord(DbusEvent e, GenericRecord reuse)
  {
    byte[] md5 = new byte[16];
    e.schemaId(md5);
    SchemaId schemaId = new SchemaId(md5);
    VersionedSchema writerSchema = _schemaSet.getById(schemaId);

    if (null == writerSchema)
    {
      LOG.error("Unable to find schema for id " + schemaId + "; event = " + e);
View Full Code Here

Examples of com.linkedin.databus2.schemas.SchemaId

        return null;
      }
    }
    byte[] md5 = new byte[16];
    e.schemaId(md5);
    SchemaId schemaId = new SchemaId(md5);
    VersionedSchema writerSchema = _schemaSet.getById(schemaId);

    if (null == writerSchema)
    {
      LOG.error("Unable to find schema for id " + schemaId + "; event = " + e);
View Full Code Here

Examples of com.linkedin.databus2.schemas.SchemaId

  public void dumpEventValueInJSON(DbusEvent e, OutputStream out)
  {
    byte[] md5 = new byte[16];
    e.schemaId(md5);
    SchemaId schemaId = new SchemaId(md5);
    VersionedSchema sourceSchema = _schemaSet.getById(schemaId);
    ByteBuffer valueBuffer = e.value();
    byte[] valueBytes = new byte[valueBuffer.remaining()];
    valueBuffer.get(valueBytes);
View Full Code Here

Examples of com.linkedin.databus2.schemas.SchemaId

   */
  public VersionedSchema getPayloadSchema(DbusEvent e)
  {
    byte[] md5 = new byte[16];
    e.schemaId(md5);
    SchemaId schemaId = new SchemaId(md5);
    VersionedSchema writerSchema = _schemaSet.getById(schemaId);
    return writerSchema;
  }
View Full Code Here

Examples of com.linkedin.databus2.schemas.SchemaId

  {
    if (null == _metadataSchemaSet)
    {
      return null;
    }
    SchemaId id = new SchemaId(metadataPart.getSchemaDigest());
    return _metadataSchemaSet.getById(id);
  }
View Full Code Here

Examples of com.linkedin.databus2.schemas.SchemaId

              record.getSchema());
          writer.write(record, encoder);
          byte[] serializedValue = bos.toByteArray();

          //Get the md5 for the schema
          SchemaId schemaId = SchemaId.createWithMd5(dbUpdate.getSchema());

          //Determine the operation type and convert to dbus opcode
          DbusOpcode opCode;
          if(dbUpdate.getOpType() == DbUpdateState.DBUpdateImage.OpType.INSERT || dbUpdate.getOpType() == DbUpdateState.DBUpdateImage.OpType.UPDATE)
          {
            opCode = DbusOpcode.UPSERT;
            if(_log.isDebugEnabled())
              _log.debug("The event with scn "+ scn +" is INSERT/UPDATE");
          }
          else if(dbUpdate.getOpType() == DbUpdateState.DBUpdateImage.OpType.DELETE)
          {
            opCode = DbusOpcode.DELETE;
            if(_log.isDebugEnabled())
              _log.debug("The event with scn "+ scn +" is DELETE");
          }
          else
          {
            throw new DatabusException("Unknown opcode from dbUpdate for event with scn:" + scn);
          }


          //Construct the dbusEvent info
          DbusEventInfo dbusEventInfo = new DbusEventInfo(opCode,
                                                          scn,
                                                          (short)_pConfig.getId(),
                                                          lPartitionId,
                                                          timestamp,
                                                          sourceId,
                                                          schemaId.getByteArray(),
                                                          serializedValue,
                                                          false,
                                                          false);
          dbusEventInfo.setReplicated(dbUpdate.isReplicated());
View Full Code Here

Examples of com.linkedin.databus2.schemas.SchemaId

    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);

    SchemaRegistryService mockSchemaReg = EasyMock.createMock(SchemaRegistryService.class);
    EasyMock.expect(mockSchemaReg.fetchAllSchemaVersionsBySourceName(srcName1)).andReturn(srcSchemaVersions).anyTimes();
View Full Code Here

Examples of com.linkedin.databus2.schemas.SchemaId

    DbusEventKey eventKey = new DbusEventKey(keyObj);

    short lPartitionId = _partitionFunction.getPartition(eventKey);

    //Get the md5 for the schema
    SchemaId schemaId = SchemaId.createWithMd5(changeEntry.getSchema());

    byte[] payload = serializeEvent(changeEntry.getRecord());

    DbusEventInfo eventInfo = new DbusEventInfo(changeEntry.getOpCode(),
                                                changeEntry.getScn(),
                                                (short)_pSourceId,
                                                lPartitionId,
                                                changeEntry.getTimestampInNanos(),
                                                (short)_sourceId,
                                                schemaId.getByteArray(),
                                                payload,
                                                enableTracing,
                                                false);

    boolean success = eventBuffer.appendEvent(eventKey, eventInfo, dbusEventsStatisticsCollector);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.