test_class.declarator: MEMORY_CAPACITY = 3 * 128 * 1024
test_class.modifier: private static final
test_class.original_string: private static final int MEMORY_CAPACITY = 3 * 128 * 1024;
test_class.type: int
test_class.var_name: MEMORY_CAPACITY
test_class.declarator: NUM_VALUES = 20000
test_class.modifier: private static final
test_class.original_string: private static final int NUM_VALUES = 20000;
test_class.type: int
test_class.var_name: NUM_VALUES
test_class.declarator: memman
test_class.modifier: private
test_class.original_string: private MemoryManager memman;
test_class.type: MemoryManager
test_class.var_name: memman
test_class.declarator: reader
test_class.modifier: private
test_class.original_string: private Iterator<Record> reader;
test_class.type: Iterator<Record>
test_class.var_name: reader
test_class.declarator: objects
test_class.modifier: private
test_class.original_string: private List<Record> objects;
test_class.type: List<Record>
test_class.var_name: objects
test_class.declarator: serializer = RecordSerializer.get()
test_class.modifier: private final
test_class.original_string: private final TypeSerializer<Record> serializer = RecordSerializer.get();
test_class.type: TypeSerializer<Record>
test_class.var_name: serializer
test_class.file: flink-runtime/src/test/java/org/apache/flink/runtime/operators/resettable/ReusingBlockResettableIteratorTest.java
test_class.identifier: ReusingBlockResettableIteratorTest
test_case.body: @Test
  	public void testDoubleBufferedBlockResettableIterator() throws Exception
  	{
  		final AbstractInvokable memOwner = new DummyInvokable();
  		// create the resettable Iterator
  		final ReusingBlockResettableIterator<Record> iterator = new ReusingBlockResettableIterator<Record>(
  				this.memman, this.reader, this.serializer, 2, memOwner);
  		// open the iterator
  		iterator.open();
  		
  		// now test walking through the iterator
  		int lower = 0;
  		int upper = 0;
  		do {
  			lower = upper;
  			upper = lower;
  			// find the upper bound
  			while (iterator.hasNext()) {
  				Record target = iterator.next();
  				int val = target.getField(0, IntValue.class).getValue();
  				Assert.assertEquals(upper++, val);
  			}
  			// now reset the buffer a few times
  			for (int i = 0; i < 5; ++i) {
  				iterator.reset();
  				int count = 0;
  				while (iterator.hasNext()) {
  					Record target = iterator.next();
  					int val = target.getField(0, IntValue.class).getValue();
  					Assert.assertEquals(lower + (count++), val);
  				}
  				Assert.assertEquals(upper - lower, count);
  			}
  		} while (iterator.nextBlock());
  		Assert.assertEquals(NUM_VALUES, upper);
  		
  		// close the iterator
  		iterator.close();
  	}
test_case.class_method_signature: ReusingBlockResettableIteratorTest.testDoubleBufferedBlockResettableIterator()
test_case.full_signature: @Test public void testDoubleBufferedBlockResettableIterator()
test_case.identifier: testDoubleBufferedBlockResettableIterator
test_case.invocations: open hasNext next getValue getField assertEquals reset hasNext next getValue getField assertEquals assertEquals nextBlock assertEquals close
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testDoubleBufferedBlockResettableIterator()
focal_class.declarator: LOG = LoggerFactory.getLogger(ReusingBlockResettableIterator.class)
focal_class.modifier: public static final
focal_class.original_string: public static final Logger LOG = LoggerFactory.getLogger(ReusingBlockResettableIterator.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: reuseElement
focal_class.modifier: private final
focal_class.original_string: private final T reuseElement;
focal_class.type: T
focal_class.var_name: reuseElement
focal_class.file: flink-runtime/src/main/java/org/apache/flink/runtime/operators/resettable/ReusingBlockResettableIterator.java
focal_class.identifier: ReusingBlockResettableIterator
focal_class.class_method_signature: ReusingBlockResettableIterator.ReusingBlockResettableIterator(MemoryManager memoryManager, Iterator<T> input,
  			TypeSerializer<T> serializer, int numPages,
  			AbstractInvokable ownerTask)
focal_class.full_signature: public  ReusingBlockResettableIterator(MemoryManager memoryManager, Iterator<T> input,
  			TypeSerializer<T> serializer, int numPages,
  			AbstractInvokable ownerTask)
focal_class.identifier: ReusingBlockResettableIterator
focal_class.modifiers: public
focal_class.parameters: (MemoryManager memoryManager, Iterator<T> input,
  			TypeSerializer<T> serializer, int numPages,
  			AbstractInvokable ownerTask)
focal_class.signature:  ReusingBlockResettableIterator(MemoryManager memoryManager, Iterator<T> input,
  			TypeSerializer<T> serializer, int numPages,
  			AbstractInvokable ownerTask)
focal_class.class_method_signature: ReusingBlockResettableIterator.ReusingBlockResettableIterator(MemoryManager memoryManager, TypeSerializer<T>
  			serializer, int numPages, AbstractInvokable ownerTask)
focal_class.full_signature: public  ReusingBlockResettableIterator(MemoryManager memoryManager, TypeSerializer<T>
  			serializer, int numPages, AbstractInvokable ownerTask)
focal_class.identifier: ReusingBlockResettableIterator
focal_class.modifiers: public
focal_class.parameters: (MemoryManager memoryManager, TypeSerializer<T>
  			serializer, int numPages, AbstractInvokable ownerTask)
focal_class.signature:  ReusingBlockResettableIterator(MemoryManager memoryManager, TypeSerializer<T>
  			serializer, int numPages, AbstractInvokable ownerTask)
focal_class.class_method_signature: ReusingBlockResettableIterator.hasNext()
focal_class.full_signature: @Override public boolean hasNext()
focal_class.identifier: hasNext
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean hasNext()
focal_class.superclass: extends NonReusingBlockResettableIterator<T>
focal_method.body: @Override
  	public boolean hasNext() {
  		try {
  			if (this.nextElement == null) {
  				if (this.readPhase) {
  					// read phase, get next element from buffer
  					T tmp = getNextRecord(this.reuseElement);
  					if (tmp != null) {
  						this.nextElement = tmp;
  						return true;
  					} else {
  						return false;
  					}
  				} else {
  					if (this.input.hasNext()) {
  						final T next = this.input.next();
  						if (writeNextRecord(next)) {
  							this.nextElement = next;
  							return true;
  						} else {
  							this.leftOverElement = next;
  							return false;
  						}
  					} else {
  						this.noMoreBlocks = true;
  						return false;
  					}
  				}
  			} else {
  				return true;
  			}
  		} catch (IOException ioex) {
  			throw new RuntimeException("Error (de)serializing record in block resettable iterator.", ioex);
  		}
  	}
focal_method.class_method_signature: ReusingBlockResettableIterator.hasNext()
focal_method.full_signature: @Override public boolean hasNext()
focal_method.identifier: hasNext
focal_method.invocations: getNextRecord hasNext next writeNextRecord
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: boolean
focal_method.signature: boolean hasNext()