@Test public void shouldThrowNoSuchElementOnNextWhenIteratorExhausted() throws Exception { advanceIteratorToEnd(); try { serializedKeyValueIterator.next(); fail("Expected NoSuchElementException on exhausted iterator"); } catch (final NoSuchElementException nse) { } }
@Override public KeyValue<K, V> next() { if (!hasNext()) { throw new NoSuchElementException(); } final KeyValue<Bytes, byte[]> next = bytesIterator.next(); return KeyValue.pair(serdes.keyFrom(next.key.get()), serdes.valueFrom(next.value)); }
SerializedKeyValueIterator implements KeyValueIterator<K, V> { @Override public KeyValue<K, V> next() { if (!hasNext()) { throw new NoSuchElementException(); } final KeyValue<Bytes, byte[]> next = bytesIterator.next(); return KeyValue.pair(serdes.keyFrom(next.key.get()), serdes.valueFrom(next.value)); } }
SerializedKeyValueIterator implements KeyValueIterator<K, V> { @Override public KeyValue<K, V> next() { if (!hasNext()) { throw new NoSuchElementException(); } final KeyValue<Bytes, byte[]> next = bytesIterator.next(); return KeyValue.pair(serdes.keyFrom(next.key.get()), serdes.valueFrom(next.value)); } SerializedKeyValueIterator(final KeyValueIterator<Bytes, byte[]> bytesIterator,
                               final StateSerdes<K, V> serdes); }
SerializedKeyValueIterator implements KeyValueIterator<K, V> { @Override public KeyValue<K, V> next() { if (!hasNext()) { throw new NoSuchElementException(); } final KeyValue<Bytes, byte[]> next = bytesIterator.next(); return KeyValue.pair(serdes.keyFrom(next.key.get()), serdes.valueFrom(next.value)); } SerializedKeyValueIterator(final KeyValueIterator<Bytes, byte[]> bytesIterator,
                               final StateSerdes<K, V> serdes); @Override void close(); @Override K peekNextKey(); @Override boolean hasNext(); @Override KeyValue<K, V> next(); @Override void remove(); }
SerializedKeyValueIterator implements KeyValueIterator<K, V> { @Override public KeyValue<K, V> next() { if (!hasNext()) { throw new NoSuchElementException(); } final KeyValue<Bytes, byte[]> next = bytesIterator.next(); return KeyValue.pair(serdes.keyFrom(next.key.get()), serdes.valueFrom(next.value)); } SerializedKeyValueIterator(final KeyValueIterator<Bytes, byte[]> bytesIterator,
                               final StateSerdes<K, V> serdes); @Override void close(); @Override K peekNextKey(); @Override boolean hasNext(); @Override KeyValue<K, V> next(); @Override void remove();  }