Codota Logo
DataFileReader.getBlockCount
Code IndexAdd Codota to your IDE (free)

How to use
getBlockCount
method
in
org.apache.avro.file.DataFileReader

Best Java code snippets using org.apache.avro.file.DataFileReader.getBlockCount (Showing top 9 results out of 315)

  • Common ways to obtain DataFileReader
private void myMethod () {
DataFileReader d =
  • Codota IconFile file;DatumReader reader;new DataFileReader<>(file, reader)
  • Codota IconSeekableInput sin;DatumReader reader;new DataFileReader<>(sin, reader)
  • Codota IconSeekableInput sin;new DataFileReader<>(sin, new GenericDatumReader<Void>())
  • Smart code suggestions by Codota
}
origin: h2oai/h2o-3

static <T> T runOnPreview(byte[] bits, AvroPreviewProcessor<T> processor) throws IOException {
 DatumReader<GenericRecord> datumReader = new GenericDatumReader<GenericRecord>();
 SeekableByteArrayInput sbai = new SeekableByteArrayInput(bits);
 DataFileReader<GenericRecord> dataFileReader = null;
 try {
  dataFileReader = new DataFileReader<>(sbai, datumReader);
  int headerLen = (int) dataFileReader.previousSync();
  byte[] header = Arrays.copyOf(bits, headerLen);
  if (dataFileReader.hasNext()) {
   GenericRecord gr = dataFileReader.next();
   return processor.process(header, gr, dataFileReader.getBlockCount(), dataFileReader.getBlockSize());
  } else {
   throw new RuntimeException("Empty Avro file - cannot run preview! ");
  }
 } finally {
  try { if (dataFileReader!=null) dataFileReader.close(); } catch (IOException safeToIgnore) {}
 }
}
origin: apache/avro

public boolean next(TetherData data, NullWritable ignore)
 throws IOException {
 if (!reader.hasNext() || reader.pastSync(end))
  return false;
 data.buffer(reader.nextBlock());
 data.count((int)reader.getBlockCount());
 return true;
}
origin: apache/avro

blockCount = fileReader.getBlockCount();
blockSize = fileReader.getBlockSize();
numRecords += blockCount;
origin: h2oai/h2o-3

Log.trace(String.format("Avro: ChunkIdx: %d read %d records, start at %d off, block count: %d, block size: %d", cidx, cnt, din.getChunkDataStart(cidx), dataFileReader.getBlockCount(), dataFileReader.getBlockSize()));
origin: org.apache.avro/avro-mapred

public boolean next(TetherData data, NullWritable ignore)
 throws IOException {
 if (!reader.hasNext() || reader.pastSync(end))
  return false;
 data.buffer(reader.nextBlock());
 data.count((int)reader.getBlockCount());
 return true;
}
origin: ai.h2o/h2o-avro-parser

static <T> T runOnPreview(byte[] bits, AvroPreviewProcessor<T> processor) throws IOException {
 DatumReader<GenericRecord> datumReader = new GenericDatumReader<GenericRecord>();
 SeekableByteArrayInput sbai = new SeekableByteArrayInput(bits);
 DataFileReader<GenericRecord> dataFileReader = null;
 try {
  dataFileReader = new DataFileReader<>(sbai, datumReader);
  int headerLen = (int) dataFileReader.previousSync();
  byte[] header = Arrays.copyOf(bits, headerLen);
  if (dataFileReader.hasNext()) {
   GenericRecord gr = dataFileReader.next();
   return processor.process(header, gr, dataFileReader.getBlockCount(), dataFileReader.getBlockSize());
  } else {
   throw new RuntimeException("Empty Avro file - cannot run preview! ");
  }
 } finally {
  try { if (dataFileReader!=null) dataFileReader.close(); } catch (IOException safeToIgnore) {}
 }
}
origin: org.apache.cassandra.deps/avro

public boolean next(TetherData data, NullWritable ignore)
 throws IOException {
 if (!reader.hasNext() || reader.pastSync(end))
  return false;
 data.buffer(reader.nextBlock());
 data.count((int)reader.getBlockCount());
 return true;
}

origin: org.apache.avro/avro-tools

blockCount = fileReader.getBlockCount();
blockSize = fileReader.getBlockSize();
numRecords += blockCount;
origin: ai.h2o/h2o-avro-parser

Log.trace(String.format("Avro: ChunkIdx: %d read %d records, start at %d off, block count: %d, block size: %d", cidx, cnt, din.getChunkDataStart(cidx), dataFileReader.getBlockCount(), dataFileReader.getBlockSize()));
org.apache.avro.fileDataFileReadergetBlockCount

Popular methods of DataFileReader

  • <init>
    Construct using a DataFileStream.Header. Does not call #sync(long) or #seek(long).
  • next
  • hasNext
  • close
  • openReader
    Construct a reader for a file at the current position of the input, without reading the header.
  • getSchema
  • sync
    Move to the next synchronization point after a position. To process a range of file entires, call th
  • previousSync
    Return the last synchronization point before our current position.
  • seek
    Move to a specific, known synchronization point, one returned from DataFileWriter#sync() while writi
  • pastSync
    Return true if past the next synchronization point after a position.
  • getMeta
  • getMetaString
  • getMeta,
  • getMetaString,
  • getHeader,
  • initialize,
  • iterator,
  • blockFinished,
  • getBlockSize,
  • getMetaKeys,
  • nextBlock

Popular in Java

  • Finding current android device location
  • getApplicationContext (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getContentResolver (Context)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • FileOutputStream (java.io)
    A file output stream is an output stream for writing data to aFile or to a FileDescriptor. Whether
  • MessageFormat (java.text)
    MessageFormat provides a means to produce concatenated messages in language-neutral way. Use this to
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Vector (java.util)
    The Vector class implements a growable array of objects. Like an array, it contains components that
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now