Package org.apache.flume.channel.file

Examples of org.apache.flume.channel.file.LogRecord


    for (File dataFile : files) {
      LogFile.SequentialReader reader =
        new LogFileV3.SequentialReader(dataFile, null, true);
      RandomAccessFile handle = new RandomAccessFile(dataFile, "rw");
      long eventPosition1 = reader.getPosition();
      LogRecord rec = reader.next();
      //No point corrupting commits, so ignore them
      if(rec == null ||
        rec.getEvent().getClass().getName().
          equals("org.apache.flume.channel.file.Commit")) {
        handle.close();
        reader.close();
        continue;
      }
      long eventPosition2 = reader.getPosition();
      rec = reader.next();
      handle.seek(eventPosition1 + 100);
      handle.writeInt(random.nextInt());
      corrupted++;
      corruptFiles.add(dataFile.getName());
      if (rec == null ||
        rec.getEvent().getClass().getName().
          equals("org.apache.flume.channel.file.Commit")) {
        handle.close();
        reader.close();
        continue;
      }
View Full Code Here


              // Type, length, data.
              eventPosition = reader.getPosition();
              // Try to get the record, if the checksums don't match,
              // this will throw a CorruptEventException - so the real logic
              // is in the catch block below.
              LogRecord record = reader.next();
              if (record != null) {
                record.getEvent();
              } else {
                fileDone = true;
              }
            } catch (CorruptEventException e) {
              LOG.warn("Corruption found in " + dataFile.toString() + " at "
View Full Code Here

              // Type, length, data.
              eventPosition = reader.getPosition();
              // Try to get the record, if the checksums don't match,
              // this will throw a CorruptEventException - so the real logic
              // is in the catch block below.
              LogRecord record = reader.next();
              if (record != null) {
                record.getEvent();
              } else {
                fileDone = true;
              }
            } catch (CorruptEventException e) {
              LOG.warn("Corruption found in " + dataFile.toString() + " at "
View Full Code Here

    for (File dataFile : files) {
      LogFile.SequentialReader reader =
        new LogFileV3.SequentialReader(dataFile, null);
      RandomAccessFile handle = new RandomAccessFile(dataFile, "rw");
      long eventPosition1 = reader.getPosition();
      LogRecord rec = reader.next();
      //No point corrupting commits, so ignore them
      if(rec == null ||
        rec.getEvent().getClass().getName().
          equals("org.apache.flume.channel.file.Commit")) {
        handle.close();
        reader.close();
        continue;
      }
      long eventPosition2 = reader.getPosition();
      rec = reader.next();
      handle.seek(eventPosition1 + 100);
      handle.writeInt(random.nextInt());
      corrupted++;
      corruptFiles.add(dataFile.getName());
      if (rec == null ||
        rec.getEvent().getClass().getName().
          equals("org.apache.flume.channel.file.Commit")) {
        handle.close();
        reader.close();
        continue;
      }
View Full Code Here

TOP

Related Classes of org.apache.flume.channel.file.LogRecord

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.