org.apache.hadoop.mapreduce.RecordReader.close()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(99)

本文整理了Java中org.apache.hadoop.mapreduce.RecordReader.close方法的一些代码示例,展示了RecordReader.close的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RecordReader.close方法的具体详情如下:
包路径:org.apache.hadoop.mapreduce.RecordReader
类名称:RecordReader
方法名:close

RecordReader.close介绍

[英]Close the record reader.
[中]关闭读录器。

代码示例

代码示例来源:origin: apache/flink

  1. @Override
  2. public void close() throws IOException {
  3. if (this.recordReader != null) {
  4. // enforce sequential close() calls
  5. synchronized (CLOSE_MUTEX) {
  6. this.recordReader.close();
  7. }
  8. }
  9. }

代码示例来源:origin: apache/flink

  1. @Override
  2. public void close() throws IOException {
  3. this.recordReader.close();
  4. }

代码示例来源:origin: apache/hive

  1. @Override
  2. public void close() throws IOException {
  3. if (realReader != null) {
  4. realReader.close();
  5. }
  6. }

代码示例来源:origin: apache/incubator-gobblin

  1. @Override
  2. public void close() throws IOException {
  3. this.recordReader.close();
  4. }
  5. }

代码示例来源:origin: apache/drill

  1. @Override
  2. public void close() throws IOException {
  3. if (realReader != null) {
  4. realReader.close();
  5. }
  6. }

代码示例来源:origin: thinkaurelius/titan

  1. @Override
  2. public void close() throws IOException {
  3. try {
  4. deser = null;
  5. countedDeser.release();
  6. } catch (Exception e) {
  7. throw new IOException(e);
  8. }
  9. reader.close();
  10. }

代码示例来源:origin: apache/hive

  1. @Override public void close() throws IOException {
  2. synchronized (HBASE_TABLE_MONITOR) {
  3. recordReader.close();
  4. closeTable();
  5. conn.close();
  6. }
  7. }

代码示例来源:origin: apache/hive

  1. @Override
  2. public boolean hasNext() {
  3. try {
  4. boolean retVal = curRecReader.nextKeyValue();
  5. if (retVal) {
  6. return true;
  7. }
  8. // if its false, we need to close recordReader.
  9. curRecReader.close();
  10. return false;
  11. } catch (IOException e) {
  12. throw new RuntimeException(e);
  13. } catch (InterruptedException e) {
  14. throw new RuntimeException(e);
  15. }
  16. }

代码示例来源:origin: apache/avro

  1. /**
  2. * Verifies that a non-null record reader can be created, and the key/value types are
  3. * as expected.
  4. */
  5. @Test
  6. public void testCreateRecordReader() throws IOException, InterruptedException {
  7. // Set up the job configuration.
  8. Job job = new Job();
  9. AvroJob.setInputKeySchema(job, Schema.create(Schema.Type.STRING));
  10. Configuration conf = job.getConfiguration();
  11. FileSplit inputSplit = createMock(FileSplit.class);
  12. TaskAttemptContext context = createMock(TaskAttemptContext.class);
  13. expect(context.getConfiguration()).andReturn(conf).anyTimes();
  14. replay(inputSplit);
  15. replay(context);
  16. AvroKeyInputFormat inputFormat = new AvroKeyInputFormat();
  17. @SuppressWarnings("unchecked")
  18. RecordReader<AvroKey<Object>, NullWritable> recordReader = inputFormat.createRecordReader(
  19. inputSplit, context);
  20. assertNotNull(inputFormat);
  21. recordReader.close();
  22. verify(inputSplit);
  23. verify(context);
  24. }
  25. }

代码示例来源:origin: apache/tinkerpop

  1. @Override
  2. public void close() throws IOException {
  3. this.recordReader.close();
  4. }
  5. }

代码示例来源:origin: apache/tinkerpop

  1. @Override
  2. public void close() {
  3. try {
  4. for (final RecordReader reader : this.readers) {
  5. reader.close();
  6. }
  7. } catch (final IOException e) {
  8. throw new IllegalStateException(e.getMessage(), e);
  9. }
  10. }
  11. }

代码示例来源:origin: apache/avro

  1. recordReader.close();

代码示例来源:origin: apache/avro

  1. recordReader.close();

代码示例来源:origin: apache/hbase

  1. rr.close();

代码示例来源:origin: apache/tinkerpop

  1. @Override
  2. public boolean hasNext() {
  3. try {
  4. while (true) {
  5. if (this.edgeIterator.hasNext())
  6. return true;
  7. if (this.readers.isEmpty())
  8. return false;
  9. if (this.readers.peek().nextKeyValue()) {
  10. this.edgeIterator = this.readers.peek().getCurrentValue().get().edges(Direction.OUT);
  11. } else {
  12. this.readers.remove().close();
  13. }
  14. }
  15. } catch (final Exception e) {
  16. throw new IllegalStateException(e.getMessage(), e);
  17. }
  18. }
  19. }

代码示例来源:origin: apache/tinkerpop

  1. @Override
  2. public boolean hasNext() {
  3. try {
  4. if (null != this.nextVertex) return true;
  5. else {
  6. while (!this.readers.isEmpty()) {
  7. if (this.readers.peek().nextKeyValue()) {
  8. this.nextVertex = new HadoopVertex(this.readers.peek().getCurrentValue().get(), this.graph);
  9. return true;
  10. } else
  11. this.readers.remove().close();
  12. }
  13. }
  14. } catch (final Exception e) {
  15. throw new IllegalStateException(e.getMessage(), e);
  16. }
  17. return false;
  18. }
  19. }

代码示例来源:origin: apache/tinkerpop

  1. @Override
  2. public Edge next() {
  3. try {
  4. while (true) {
  5. if (this.edgeIterator.hasNext())
  6. return new HadoopEdge(this.edgeIterator.next(), this.graph);
  7. if (this.readers.isEmpty())
  8. throw FastNoSuchElementException.instance();
  9. if (this.readers.peek().nextKeyValue()) {
  10. this.edgeIterator = this.readers.peek().getCurrentValue().get().edges(Direction.OUT);
  11. } else {
  12. this.readers.remove().close();
  13. }
  14. }
  15. } catch (final Exception e) {
  16. throw new IllegalStateException(e.getMessage(), e);
  17. }
  18. }

代码示例来源:origin: apache/tinkerpop

  1. @Override
  2. public Vertex next() {
  3. try {
  4. if (this.nextVertex != null) {
  5. final Vertex temp = this.nextVertex;
  6. this.nextVertex = null;
  7. return temp;
  8. } else {
  9. while (!this.readers.isEmpty()) {
  10. if (this.readers.peek().nextKeyValue())
  11. return new HadoopVertex(this.readers.peek().getCurrentValue().get(), this.graph);
  12. else
  13. this.readers.remove().close();
  14. }
  15. }
  16. throw FastNoSuchElementException.instance();
  17. } catch (final Exception e) {
  18. throw new IllegalStateException(e.getMessage(), e);
  19. }
  20. }

代码示例来源:origin: larsgeorge/hbase-book

  1. reader.close();

代码示例来源:origin: kite-sdk/kite

  1. @Override
  2. public void close() throws IOException {
  3. unfiltered.close();
  4. }
  5. }

相关文章