GithubHelp home page GithubHelp logo

rocksdb.extensions's Issues

Add HasKey Method to RocksDbStore API

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);

Add API for putting range of values with key calculation function

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}");

Add option to delete RocksDB database on start if it already exists

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.

Zero Allocation PutRange

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.

Add RepeatedField<T> support for RocksDbStore

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)
    {
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.