Skip to content

Commit f7ebc89

Browse files
author
codeba
committed
feat: Add pipeline method for bitmap,generic,geo,hash,hyperloglog
1 parent 639aa7b commit f7ebc89

30 files changed

+3340
-3553
lines changed

redis-keeper-core/src/main/java/org/codeba/redis/keeper/core/CacheTemplate.java

Lines changed: 4 additions & 1200 deletions
Large diffs are not rendered by default.
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
/*
2+
* Copyright (c) 2024-2025, redis-keeper ([email protected])
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.codeba.redis.keeper.core;
18+
19+
import java.util.List;
20+
import java.util.concurrent.CompletableFuture;
21+
22+
/**
23+
* The interface K batch.
24+
*/
25+
public interface KBatch {
26+
/**
27+
* Gets bit map.
28+
*
29+
* @return the bit map
30+
*/
31+
KBitSetAsync getBitMap();
32+
33+
/**
34+
* Gets generic.
35+
*
36+
* @return the generic
37+
*/
38+
KGenericAsync getGeneric();
39+
40+
/**
41+
* Gets geo.
42+
*
43+
* @return the geo
44+
*/
45+
KGeoAsync getGeo();
46+
47+
/**
48+
* Gets hash.
49+
*
50+
* @return the hash
51+
*/
52+
KMapAsync getHash();
53+
54+
/**
55+
* Gets hyper log log.
56+
*
57+
* @return the hyper log log
58+
*/
59+
KHyperLogLogAsync getHyperLogLog();
60+
61+
62+
/**
63+
* Execute.
64+
*/
65+
void execute();
66+
67+
/**
68+
* Execute async completable future.
69+
*
70+
* @return the completable future
71+
*/
72+
CompletableFuture<Void> executeAsync();
73+
74+
/**
75+
* Execute with responses list.
76+
*
77+
* @return the list
78+
*/
79+
List<?> executeWithResponses();
80+
81+
/**
82+
* Execute with responses async completable future.
83+
*
84+
* @return the completable future
85+
*/
86+
CompletableFuture<List<?>> executeWithResponsesAsync();
87+
88+
}
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
/*
2+
* Copyright (c) 2024-2025, redis-keeper ([email protected])
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.codeba.redis.keeper.core;
18+
19+
/**
20+
* The interface K bit map.
21+
*/
22+
public interface KBitSet extends KBitSetAsync {
23+
/**
24+
* Bit count long.
25+
*
26+
* @param key the key
27+
* @return the long
28+
*/
29+
long bitCount(String key);
30+
31+
/**
32+
* Bit field set signed long.
33+
*
34+
* @param key the key
35+
* @param size the size
36+
* @param offset the offset
37+
* @param value the value
38+
* @return the long
39+
*/
40+
long bitFieldSetSigned(String key, int size, long offset, long value);
41+
42+
/**
43+
* Bit field set un signed long.
44+
*
45+
* @param key the key
46+
* @param size the size
47+
* @param offset the offset
48+
* @param value the value
49+
* @return the long
50+
*/
51+
long bitFieldSetUnSigned(String key, int size, long offset, long value);
52+
53+
/**
54+
* Bit field get signed long.
55+
*
56+
* @param key the key
57+
* @param size the size
58+
* @param offset the offset
59+
* @return the long
60+
*/
61+
long bitFieldGetSigned(String key, int size, long offset);
62+
63+
/**
64+
* Bit field get un signed long.
65+
*
66+
* @param key the key
67+
* @param size the size
68+
* @param offset the offset
69+
* @return the long
70+
*/
71+
long bitFieldGetUnSigned(String key, int size, long offset);
72+
73+
/**
74+
* Bit op or.
75+
*
76+
* @param destKey the dest key
77+
* @param keys the keys
78+
*/
79+
void bitOpOr(String destKey, String... keys);
80+
81+
/**
82+
* Gets bit.
83+
*
84+
* @param key the key
85+
* @param bitIndex the bit index
86+
* @return the bit
87+
*/
88+
boolean getBit(String key, long bitIndex);
89+
90+
/**
91+
* Sets bit.
92+
*
93+
* @param key the key
94+
* @param offset the offset
95+
* @param value the value
96+
* @return the bit: the original bit value stored at offset.
97+
*/
98+
boolean setBit(String key, long offset, boolean value);
99+
100+
}
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
/*
2+
* Copyright (c) 2024-2025, redis-keeper ([email protected])
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.codeba.redis.keeper.core;
18+
19+
import java.util.concurrent.CompletableFuture;
20+
21+
/**
22+
* The interface K bit map async.
23+
*/
24+
public interface KBitSetAsync {
25+
/**
26+
* Bit count async completable future.
27+
*
28+
* @param key the key
29+
* @return the completable future
30+
*/
31+
CompletableFuture<Long> bitCountAsync(String key);
32+
33+
/**
34+
* Bit field set signed async completable future.
35+
*
36+
* @param key the key
37+
* @param size the size
38+
* @param offset the offset
39+
* @param value the value
40+
* @return the completable future
41+
*/
42+
CompletableFuture<Long> bitFieldSetSignedAsync(String key, int size, long offset, long value);
43+
44+
/**
45+
* Bit field set un signed async completable future.
46+
*
47+
* @param key the key
48+
* @param size the size
49+
* @param offset the offset
50+
* @param value the value
51+
* @return the completable future
52+
*/
53+
CompletableFuture<Long> bitFieldSetUnSignedAsync(String key, int size, long offset, long value);
54+
55+
/**
56+
* Bit field get signed async completable future.
57+
*
58+
* @param key the key
59+
* @param size the size
60+
* @param offset the offset
61+
* @return the completable future
62+
*/
63+
CompletableFuture<Long> bitFieldGetSignedAsync(String key, int size, long offset);
64+
65+
/**
66+
* Bit field get un signed async completable future.
67+
*
68+
* @param key the key
69+
* @param size the size
70+
* @param offset the offset
71+
* @return the completable future
72+
*/
73+
CompletableFuture<Long> bitFieldGetUnSignedAsync(String key, int size, long offset);
74+
75+
/**
76+
* Bit op or async completable future.
77+
*
78+
* @param destKey the dest key
79+
* @param keys the keys
80+
* @return the completable future
81+
*/
82+
CompletableFuture<Void> bitOpOrAsync(String destKey, String... keys);
83+
84+
/**
85+
* Gets bit async.
86+
*
87+
* @param key the key
88+
* @param bitIndex the bit index
89+
* @return the bit async
90+
*/
91+
CompletableFuture<Boolean> getBitAsync(String key, long bitIndex);
92+
93+
/**
94+
* Sets bit async.
95+
*
96+
* @param key the key
97+
* @param offset the offset
98+
* @param value the value
99+
* @return the bit async
100+
*/
101+
CompletableFuture<Boolean> setBitAsync(String key, long offset, boolean value);
102+
103+
}

0 commit comments

Comments
 (0)