public static void main()

in core/src/main/java/org/apache/rocketmq/streams/core/state/RocksDBStore.java [193:227]


    public static void main(String[] args) throws Throwable {
        RocksDBStore rocksDBStore = new RocksDBStore("test");

        String key = "time@1668249210000@1668249195000";
        String key2 = "time@1668249210001@1668249195001";
        Object value = "3";
        Object value2 = "2";

        byte[] keyBytes = Utils.object2Byte(key);
        byte[] valueBytes = Utils.object2Byte(value);

        byte[] keyBytes2 = Utils.object2Byte(key2);
        byte[] valueBytes2 = Utils.object2Byte(value2);

        rocksDBStore.put(keyBytes2, valueBytes2);
        rocksDBStore.put(keyBytes, valueBytes);


        byte[] bytes = rocksDBStore.get(keyBytes);
        Object result = Utils.byte2Object(bytes, Object.class);
        System.out.println(result);

        byte[] bytes2 = rocksDBStore.get(keyBytes2);
        Object result2 = Utils.byte2Object(bytes2, Object.class);
        System.out.println(result2);

        String keyPrefix = "time@1668249210000";


        List<Pair<String, byte[]>> pairs = rocksDBStore.searchByKeyPrefix(keyPrefix, Utils::object2Byte, data -> Utils.byte2Object(data, String.class));
        for (Pair<String, byte[]> pair : pairs) {
            assert pair.getKey().startsWith(keyPrefix);
        }

    }