Package org.apache.avro.generic

Examples of org.apache.avro.generic.GenericRecordBuilder


    
     Schema ofpActionSchema = protocol.getType("of12.ofp_action");
     GenericRecord ofpActionRecord = new GenericData.Record(ofpActionSchema);
    
     Schema actionPushMplsHeaderSchema = protocol.getType("of12.action_push_mpls_header");
     GenericRecordBuilder headerBuilder = new GenericRecordBuilder(actionPushMplsHeaderSchema);
     GenericRecord actionPushMplsHeaderRecord = headerBuilder.build();
    
     Schema ofpActionPushMplsSchema = protocol.getType("of12.ofp_action_push_mpls");
     GenericRecord ofpActionPushMplsRecord = new GenericData.Record(ofpActionPushMplsSchema);

     ofpActionPushMplsRecord.put("header", actionPushMplsHeaderRecord);
View Full Code Here


    
     Schema ofpActionSchema = protocol.getType("of12.ofp_action");
     GenericRecord ofpActionRecord = new GenericData.Record(ofpActionSchema);
    
     Schema actionPopVlanHeaderSchema = protocol.getType("of12.action_pop_vlan_header");
     GenericRecordBuilder headerBuilder = new GenericRecordBuilder(actionPopVlanHeaderSchema);
     GenericRecord actionPopVlanHeaderRecord = headerBuilder.build();
    
     Schema ofpActionPopVlanSchema = protocol.getType("of12.ofp_action_pop_vlan");
     GenericRecord ofpActionPopVlanRecord = new GenericData.Record(ofpActionPopVlanSchema);
    
     ofpActionPopVlanRecord.put("header", actionPopVlanHeaderRecord);
View Full Code Here

      Schema ofpActionSchema = protocol.getType("of12.ofp_action");
      GenericRecord ofpActionRecord = new GenericData.Record(ofpActionSchema);
      List <GenericRecord> matches = new ArrayList<>();
     
      Schema actionSetFieldHeaderSchema = protocol.getType("of12.action_set_field_header");
      GenericRecordBuilder headerBuilder = new GenericRecordBuilder(actionSetFieldHeaderSchema);
      GenericRecord actionSetFieldHeaderRecord = headerBuilder.build();
   
      Schema ofpActionSetFieldSchema = protocol.getType("of12.ofp_action_set_field");
      GenericRecord ofpActionSetFieldRecord = new GenericData.Record(ofpActionSetFieldSchema);

      n = Pattern.compile("set_field_vlan_vid=(?:((?:0x)?\\d+))").matcher(subaction);
View Full Code Here

     Schema ofpActionSchema = protocol.getType("of12.ofp_action");
     GenericRecord ofpActionRecord = new GenericData.Record(ofpActionSchema);
     List <GenericRecord> matches = new ArrayList<>();
    
     Schema actionSetFieldHeaderSchema = protocol.getType("of12.action_set_field_header");
     GenericRecordBuilder headerBuilder = new GenericRecordBuilder(actionSetFieldHeaderSchema);
     GenericRecord actionSetFieldHeaderRecord = headerBuilder.build();
  
     Schema ofpActionSetFieldSchema = protocol.getType("of12.ofp_action_set_field");
     GenericRecord ofpActionSetFieldRecord = new GenericData.Record(ofpActionSetFieldSchema);

     n = Pattern.compile("set_field_mpls_label=(?:((?:0x)?\\d+))").matcher(subaction);
View Full Code Here

   }
  
   @Override
   public GenericContainer get() {
      if (readyToBinary) {
         GenericRecordBuilder builder = new GenericRecordBuilder(schema);
         Set<String> keys = fields.keySet();
         for (String key : keys) {
            INamedValue<String, GenericContainer> item = fields.get(key);
            GenericContainer val = item.get();
            // TODO Improv. I dislike this NULL verification
            if (val != null)
               builder.set(item.name(), val);
         }
        
         return builder.build();
      } else {
         GenericRecord record = new GenericData.Record (schema);

         Set<String> keys = fields.keySet();
         for (String key : keys) {
View Full Code Here

   }

   public byte[] encodeMessage (Schema headerSchema, Schema bodySchema) {
     
      GenericRecord bodyRecord = new GenericData.Record(bodySchema);
      GenericRecordBuilder builder = new GenericRecordBuilder(headerSchema);

      GenericRecord headerRecord = builder.build();
      bodyRecord.put("header", headerRecord)
     
      ByteArrayOutputStream out = new ByteArrayOutputStream();
     
      DatumWriter<GenericRecord> writer = new GenericDatumWriter<GenericRecord>(bodySchema);
View Full Code Here

TOP

Related Classes of org.apache.avro.generic.GenericRecordBuilder

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.