havret / rocksdb.extensions Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Add HasKey method to the RocksDbStore<TKey, TValue> class. This method would provide a quick and efficient way to check if a given key exists in the RocksDB store without retrieving the associated value.
/// <summary>
/// Determines whether the store contains a value for a specific key.
/// </summary>
/// <param name="key">The key to check in the store for an associated value.</param>
/// <returns><c>true</c> if there is a value associated with the specified key in the store; otherwise, <c>false</c>.</returns>
public bool HasKey(TKey key);
This enhancement to the RocksDbStore API would allow users to put a range of values by calculating the corresponding keys with a provided function. This feature would be particularly useful when keys can be computed from the values. The benefit of this enhancement is that there would be no need to allocate an array to store the list of keys.
The proposed API is as follows:
public void PutRange(ReadOnlySpan<TValue> values, Func<TValue, TKey> keySelector)
Here's an example usage of the proposed API:
// Put a range of values using a lambda function to calculate the keys
var values = new int[] { 10, 20, 30 };
store.PutRange(values, value => $"key_{value}");
Currently, the RocksDB.Extensions library does not have an option to automatically delete an existing database when it is started. This can be problematic when testing and debugging, as it requires manually deleting the database before running the code again.
The proposed option could be added as a boolean parameter to the RocksDbOptions class, with a default value of false to preserve current behavior. If the option is set to true, the library would automatically delete the existing database on startup and create a new one.
The current implementation of PutRange
allocates memory for each element, which can lead to performance issues in high-throughput scenarios or on systems with limited memory resources. A zero-allocation version would improve performance and reduce memory pressure.
Bump RocksDB to 8.x version.
It should be possible to use RepeatedField as top level value for RocksDbStore
rocksDbBuilder.AddStore<string, RepeatedField<User>, UsersStore>("users-store");
public class UsersStore : RocksDbStore<string, RepeatedField<User>>
{
public UsersStore(IRocksDbAccessor<string, RepeatedField<User>> rocksDbAccessor) : base(rocksDbAccessor)
{
}
}
It should be possible to register bool
as value for RocksDbStore.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.