test_class.declarator: RECORD_COUNT = 50
test_class.modifier: private static final
test_class.original_string: private static final int RECORD_COUNT = 50;
test_class.type: int
test_class.var_name: RECORD_COUNT
test_class.declarator: AUTO_SYNC_INTERVAL = 32
test_class.modifier: private static final
test_class.original_string: private static final int AUTO_SYNC_INTERVAL = 32;
test_class.type: int
test_class.var_name: AUTO_SYNC_INTERVAL
test_class.declarator: temporaryFolder = new TemporaryFolder()
test_class.modifier: @Rule
    public
test_class.original_string: @Rule
    public TemporaryFolder temporaryFolder = new TemporaryFolder();
test_class.type: TemporaryFolder
test_class.var_name: temporaryFolder
test_class.declarator: testAvroFile
test_class.modifier: private
test_class.original_string: private File testAvroFile;
test_class.type: File
test_class.var_name: testAvroFile
test_class.declarator: allAddedKeys
test_class.modifier: private
test_class.original_string: private List<String> allAddedKeys;
test_class.type: List<String>
test_class.var_name: allAddedKeys
test_class.file: bigquery/src/test/java/com/google/cloud/hadoop/io/bigquery/AvroRecordReaderTest.java
test_class.identifier: AvroRecordReaderTest
test_case.body: @Test
    public void testMultipleSplits() throws IOException {
      long fileLength = testAvroFile.length();
      List<FileSplit> splits = new ArrayList<>();
      Path hadoopPath = new Path("file", null,  testAvroFile.getAbsolutePath());
  
      for (int blockStart = 0; blockStart < fileLength; blockStart += AUTO_SYNC_INTERVAL) {
        splits.add(new FileSplit(hadoopPath, blockStart, AUTO_SYNC_INTERVAL, new String[0]));
      }
  
      List<String> allRecordKeys = new ArrayList<>();
      long totalFileRecords = 0;
      for (FileSplit split : splits) {
        try (AvroRecordReader reader = new AvroRecordReader()) {
          reader.initializeInternal(split, new Configuration());
          List<String> keysInSplit = collectRecordKeys(reader);
          allRecordKeys.addAll(keysInSplit);
          int recordsInSplit = keysInSplit.size();
          totalFileRecords += recordsInSplit;
          // Not all 'blocks' contain records, but none should have all records
          Truth.assertThat(recordsInSplit)
              .isLessThan(RECORD_COUNT);
        }
      }
  
      Truth.assertThat(allRecordKeys).containsExactlyElementsIn(allAddedKeys);
      Truth.assertThat(totalFileRecords).isEqualTo(RECORD_COUNT);
    }
test_case.class_method_signature: AvroRecordReaderTest.testMultipleSplits()
test_case.full_signature: @Test public void testMultipleSplits()
test_case.identifier: testMultipleSplits
test_case.invocations: length getAbsolutePath add initializeInternal collectRecordKeys addAll size isLessThan assertThat containsExactlyElementsIn assertThat isEqualTo assertThat
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testMultipleSplits()
focal_class.declarator: currentKey = new LongWritable()
focal_class.modifier: final
focal_class.original_string: final LongWritable currentKey = new LongWritable();
focal_class.type: LongWritable
focal_class.var_name: currentKey
focal_class.declarator: dataFileReader
focal_class.original_string: FileReader<GenericData.Record> dataFileReader;
focal_class.type: FileReader<GenericData.Record>
focal_class.var_name: dataFileReader
focal_class.declarator: schema
focal_class.original_string: Schema schema;
focal_class.type: Schema
focal_class.var_name: schema
focal_class.declarator: currentRecord
focal_class.original_string: GenericData.Record currentRecord;
focal_class.type: GenericData.Record
focal_class.var_name: currentRecord
focal_class.declarator: inputFileLength
focal_class.original_string: long inputFileLength;
focal_class.type: long
focal_class.var_name: inputFileLength
focal_class.declarator: splitStart
focal_class.original_string: long splitStart;
focal_class.type: long
focal_class.var_name: splitStart
focal_class.declarator: splitLength
focal_class.original_string: long splitLength;
focal_class.type: long
focal_class.var_name: splitLength
focal_class.file: bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/AvroRecordReader.java
focal_class.identifier: AvroRecordReader
focal_class.class_method_signature: AvroRecordReader.initialize(InputSplit inputSplit, TaskAttemptContext taskAttemptContext)
focal_class.full_signature: @Override public void initialize(InputSplit inputSplit, TaskAttemptContext taskAttemptContext)
focal_class.identifier: initialize
focal_class.modifiers: @Override public
focal_class.parameters: (InputSplit inputSplit, TaskAttemptContext taskAttemptContext)
focal_class.return: void
focal_class.signature: void initialize(InputSplit inputSplit, TaskAttemptContext taskAttemptContext)
focal_class.class_method_signature: AvroRecordReader.initializeInternal(InputSplit inputSplit, Configuration conf)
focal_class.full_signature: protected void initializeInternal(InputSplit inputSplit, Configuration conf)
focal_class.identifier: initializeInternal
focal_class.modifiers: protected
focal_class.parameters: (InputSplit inputSplit, Configuration conf)
focal_class.return: void
focal_class.signature: void initializeInternal(InputSplit inputSplit, Configuration conf)
focal_class.class_method_signature: AvroRecordReader.nextKeyValue()
focal_class.full_signature: @Override public boolean nextKeyValue()
focal_class.identifier: nextKeyValue
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean nextKeyValue()
focal_class.class_method_signature: AvroRecordReader.getCurrentKey()
focal_class.full_signature: @Override public LongWritable getCurrentKey()
focal_class.identifier: getCurrentKey
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: LongWritable
focal_class.signature: LongWritable getCurrentKey()
focal_class.class_method_signature: AvroRecordReader.getCurrentValue()
focal_class.full_signature: @Override public GenericData.Record getCurrentValue()
focal_class.identifier: getCurrentValue
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: GenericData.Record
focal_class.signature: GenericData.Record getCurrentValue()
focal_class.class_method_signature: AvroRecordReader.getProgress()
focal_class.full_signature: @Override public float getProgress()
focal_class.identifier: getProgress
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: float
focal_class.signature: float getProgress()
focal_class.class_method_signature: AvroRecordReader.close()
focal_class.full_signature: @Override public void close()
focal_class.identifier: close
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void close()
focal_class.superclass: extends RecordReader<LongWritable, GenericData.Record>
focal_method.body: protected void initializeInternal(InputSplit inputSplit, Configuration conf) throws IOException {
      Preconditions.checkState(
          inputSplit instanceof FileSplit, "AvroRecordReader requires FileSplit input splits.");
      FileSplit fileSplit = (FileSplit) inputSplit;
      splitStart = fileSplit.getStart();
      splitLength = fileSplit.getLength();
  
      Path filePath = fileSplit.getPath();
      FileSystem fs = filePath.getFileSystem(conf);
      FileStatus status = fs.getFileStatus(filePath);
      inputFileLength = status.getLen();
  
      final FSDataInputStream stream = fs.open(filePath);
      dataFileReader =
          DataFileReader.openReader(
              new SeekableInput() {
                @Override
                public void seek(long offset) throws IOException {
                  stream.seek(offset);
                }
  
                @Override
                public long tell() throws IOException {
                  return stream.getPos();
                }
  
                @Override
                public long length() {
                  return inputFileLength;
                }
  
                @Override
                public int read(byte[] bytes, int offset, int length) throws IOException {
                  return stream.read(bytes, offset, length);
                }
  
                @Override
                public void close() throws IOException {
                  stream.close();
                }
              },
              new GenericDatumReader<GenericData.Record>());
      // Sync to the first sync point after the start of the split:
      dataFileReader.sync(fileSplit.getStart());
      schema = dataFileReader.getSchema();
      currentRecord = new GenericData.Record(schema);
    }
focal_method.class_method_signature: AvroRecordReader.initializeInternal(InputSplit inputSplit, Configuration conf)
focal_method.full_signature: protected void initializeInternal(InputSplit inputSplit, Configuration conf)
focal_method.identifier: initializeInternal
focal_method.invocations: checkState getStart getLength getPath getFileSystem getFileStatus getLen open openReader seek getPos read close sync getStart getSchema
focal_method.modifiers: protected
focal_method.parameters: (InputSplit inputSplit, Configuration conf)
focal_method.return: void
focal_method.signature: void initializeInternal(InputSplit inputSplit, Configuration conf)