Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
themeEclipse
titleAdditional methods to ReadOnlyWindowStore
    /**
     * Gets all the key-value pairs in the existing windows.
     * 
     * @returns an iterator over windowed key-value pairs {@code <Windowed<K>, value>}
     * @throws InvalidStateStoreException if the store is not initialized
     * @throws NullPointerException if null is used for any key
     */
    KeyValueIterator<Windowed<K>, V> keysall();

    /**
     * Gets all windows for a specific time range
     * 
    	 * @returns@param antimeFrom iteratorthe over windowed key-value pairs {@code <Windowed<K>, value>}
     * @throws InvalidStateStoreException if the store is not initialized
     * @throws NullPointerException if null is used for any key
     */
    KeyValueIterator<Windowed<K>, V> all(long timeFrom, long timeTo);

    /**
     * Gets the latest window for each distinctive key.
     * 
     beginning of the time slot from which to search
	 * @param timeTo   the end of the time slot from which to search
     * @returns an iterator over windowed key-value pairs {@code <Windowed<K>, value>}
     	 * @throws InvalidStateStoreException if the store is not initialized
     * @throws NullPointerException if null is used for any key
     */
    KeyValueIterator<Windowed<K>, V> allLatest();

    /**
     * Returns the minimum key in existing windows.
     * 
     * @returns a {@code Windowed<K>} value
     * @throws InvalidStateStoreException if the store is not initialized
     * @throws NullPointerException if null is used for any key
     */
    Windowed<K> minKey();

    /**
     * Returns the maximum key in existing windows
     * 
     * @returns a {@code Windowed<K>} value
     * @throws InvalidStateStoreException if the store is not initialized
     * @throws NullPointerException if null is used for any key
     */
    Windowed<K> maxKey(range(long timeFrom, long timeTo);

 

Proposed Changes

With the need to test the implementation of these methods in mind, the ReadOnlyWindowStoreStub class will implement these additions (i.e. @Override public Collection<Windowed<K>> range(long timeFrom, long timeTo){...}). The corresponding test will also be modified. (e.g. @Test public void testRange(){...}) 

...

RocksDBWindowStore, having to serve a vastly different purpose from CachingWindowStore has to implement different key and value structures. 

Hence the implementations, as well as the corresponding tests, will be vastly different for each WindowStore implementationEach of these structures appear to be only different on the surface. However, the underlying principles on which both operate are basically the same. So in effect, the implementation should be relatively similar.

Compatibility, Deprecation, and Migration Plan

...