THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
Table of Contents |
---|
Status
Current state: Under Discussion
...
Expand | ||
---|---|---|
| ||
|
Expand | ||
---|---|---|
| ||
|
File changes
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
public <T> T store(final String storeName, final QueryableStoreType<T> queryableStoreType) { validateIsRunning(); return queryableStoreProvider.getStore(storeName, queryableStoreType); } |
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
void validateStoreOpen(public KeyValueIterator<K, V> range(final K from, final K to) { if (!innerState.isOpen()Objects.requireNonNull(from); Objects.requireNonNull(to); final NextIteratorFunction<K, V, ReadOnlyKeyValueStore<K, V>> nextIteratorFunction = new NextIteratorFunction<K, V, ReadOnlyKeyValueStore<K, V>>() { throw new InvalidStateStoreException("Store " + innerState.name() + " is currently closed."@Override public KeyValueIterator<K, V> apply(final ReadOnlyKeyValueStore<K, V> store) { try { return store.range(from, to); } } | ||||||
Code Block | ||||||
| ||||||
private void validateStoreOpen( } catch (InvalidStateStoreException e) { if (!open) { throw new InvalidStateStoreException("Store " + this.name + " is currently closedState store is not available anymore and may have been migrated to another instance; please re-discover its location from the state metadata."); } } }; final List<ReadOnlyKeyValueStore<K, V>> stores = storeProvider.stores(storeName, storeType); return new DelegatingPeekingKeyValueIterator<>(storeName, new CompositeKeyValueIterator<>(stores.iterator(), nextIteratorFunction)); } |
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
public KeyValueIterator<K, V> range(final K from, final K toall() { Objects.requireNonNull(from); Objects.requireNonNull(to); final NextIteratorFunction<K, V, ReadOnlyKeyValueStore<K, V>> nextIteratorFunction = new NextIteratorFunction<K, V, ReadOnlyKeyValueStore<K, V>>() { @Override public KeyValueIterator<K, V> apply(final ReadOnlyKeyValueStore<K, V> store) { try { return store.rangeall(from, to); } catch (InvalidStateStoreException e) { throw new InvalidStateStoreException("State store is not available anymore and may have been migrated to another instance; please re-discover its location from the state metadata."); } } }; final List<ReadOnlyKeyValueStore<K, V>> stores = storeProvider.stores(storeName, storeType); return new DelegatingPeekingKeyValueIterator<>(storeName, new CompositeKeyValueIterator<>(stores.iterator(), nextIteratorFunction)); } |
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
void validateStoreOpen() {
if (!innerState.isOpen()) {
throw new InvalidStateStoreException("Store " + innerState.name() + " is currently closed.");
}
} |
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
private void validateStoreOpen() { if (!open) { throw new InvalidStateStoreException("Store " + this.name + " is currently closed"); } } |
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
public synchronized boolean hasNext() { if (!open) { throw new InvalidStateStoreException(String.format("RocksDB store %s has closed", storeName)); } return iter.isValid(); } |
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
public synchronized boolean hasNext() {
if (!open) {
throw new InvalidStateStoreException(String.format("Store %s has closed", storeName));
}
if (next != null) {
return true;
}
if (!underlying.hasNext()) {
return false;
}
next = underlying.next();
return true;
} |
...