Package com.cloudera.flume.conf.avro

Examples of com.cloudera.flume.conf.avro.AvroFlumeConfigDataMap


          .getValue());

      map.put(new Utf8(e.getKey()), avroConfig);
    }

    AvroFlumeConfigDataMap avromap = new AvroFlumeConfigDataMap();
    avromap.configs = map;

    DatumWriter<AvroFlumeConfigDataMap> datumWriter = new SpecificDatumWriter<AvroFlumeConfigDataMap>();
    datumWriter.setSchema(avromap.getSchema());
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    DataFileWriter<AvroFlumeConfigDataMap> fileWriter = new DataFileWriter<AvroFlumeConfigDataMap>(
        datumWriter);
    fileWriter.create(avromap.getSchema(), baos);
    fileWriter.append(avromap);
    fileWriter.close();
    return baos.toByteArray();
  }
View Full Code Here


      throws IOException {
    DatumReader<AvroFlumeConfigDataMap> reader = new SpecificDatumReader<AvroFlumeConfigDataMap>();
    reader.setSchema(AvroFlumeConfigDataMap.SCHEMA$);
    DataFileStream<AvroFlumeConfigDataMap> fileStream = new DataFileStream<AvroFlumeConfigDataMap>(
        new ByteArrayInputStream(cfg), reader);
    AvroFlumeConfigDataMap cfgmap = fileStream.next();
    fileStream.close();
    Map<String, FlumeConfigData> ret = new HashMap<String, FlumeConfigData>();
    for (Entry<CharSequence, AvroFlumeConfigData> e : cfgmap.configs.entrySet()) {
      ret.put(e.getKey().toString(), MasterClientServerAvro.configFromAvro(e
          .getValue()));
View Full Code Here

          .getValue());

      map.put(new Utf8(e.getKey()), avroConfig);
    }

    AvroFlumeConfigDataMap avromap = new AvroFlumeConfigDataMap();
    avromap.configs = map;

    DatumWriter<AvroFlumeConfigDataMap> datumWriter = new SpecificDatumWriter<AvroFlumeConfigDataMap>();
    datumWriter.setSchema(avromap.getSchema());
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    DataFileWriter<AvroFlumeConfigDataMap> fileWriter = new DataFileWriter<AvroFlumeConfigDataMap>(
        datumWriter);
    fileWriter.create(avromap.getSchema(), baos);
    fileWriter.append(avromap);
    fileWriter.close();
    return baos.toByteArray();
  }
View Full Code Here

      throws IOException {
    DatumReader<AvroFlumeConfigDataMap> reader = new SpecificDatumReader<AvroFlumeConfigDataMap>();
    reader.setSchema(AvroFlumeConfigDataMap.SCHEMA$);
    DataFileStream<AvroFlumeConfigDataMap> fileStream = new DataFileStream<AvroFlumeConfigDataMap>(
        new ByteArrayInputStream(cfg), reader);
    AvroFlumeConfigDataMap cfgmap = fileStream.next();
    fileStream.close();
    Map<String, FlumeConfigData> ret = new HashMap<String, FlumeConfigData>();
    for (Entry<CharSequence, AvroFlumeConfigData> e : cfgmap.configs.entrySet()) {
      ret.put(e.getKey().toString(), MasterClientServerAvro.configFromAvro(e
          .getValue()));
View Full Code Here

TOP

Related Classes of com.cloudera.flume.conf.avro.AvroFlumeConfigDataMap

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.