Details
-
Sub-task
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
None
Description
I'm thinking of the following API for the time-series store:
/** * A key-value store that allows entries to be queried and stored based on time ranges. * * Implementations of this interface are expected to be thread-safe. * * @param <K>, the type of key in the store * @param <V>, the type of value in the store */ public interface TimeSeriesStore<K, V> { ClosableIterator<KV<V, Long>> get(K key, Long startTimestamp, Long endTimeStamp); void put(K key, V val, Long timeStamp); void remove(K key, Long startTimestamp, Long endTimeStamp); }
/** * An iterator that can be closed. * * <p> Implement close to free resources assigned to the iterator such as open file handles, persistent state etc. * * @param <V> */ public interface ClosableIterator<V> extends Iterator<V> { /** * Closes this iterator and frees resources assigned to it. * * It is illegal to invoke {@link #next()} and {@link #hasNext()} after an iterator has been closed. */ public void close(); }
Attachments
Issue Links
- links to