File tree Expand file tree Collapse file tree 2 files changed +21
-10
lines changed
src/main/java/dev/zarr/zarrjava/store Expand file tree Collapse file tree 2 files changed +21
-10
lines changed Original file line number Diff line number Diff line change 1+ package dev .zarr .zarrjava .store ;
2+
3+ import java .util .List ;
4+ import java .util .Map ;
5+ import java .util .concurrent .ConcurrentHashMap ;
6+
7+ public class ConcurrentMemoryStore extends MemoryStore {
8+ @ Override
9+ protected Map <List <String >, byte []> map () {
10+ return new ConcurrentHashMap <>();
11+ }
12+
13+ @ Override
14+ public String toString () {
15+ return String .format ("<ConcurrentMemoryStore {%s}>" , hashCode ());
16+ }
17+ }
Original file line number Diff line number Diff line change 11package dev .zarr .zarrjava .store ;
22
3- import dev .zarr .zarrjava .core .chunkkeyencoding .Separator ;
4-
53import javax .annotation .Nonnull ;
64import javax .annotation .Nullable ;
75import java .nio .ByteBuffer ;
86import java .util .*;
97import java .util .stream .Stream ;
108
119public class MemoryStore implements Store , Store .ListableStore {
12- private final Map <List <String >, byte []> map = new HashMap <>();
13- Separator separator ;
14-
15- public MemoryStore (Separator separator ){
16- this .separator = separator ;
17- }
10+ private final Map <List <String >, byte []> map = map ();
1811
19- public MemoryStore (){
20- this ( Separator . SLASH );
12+ protected Map < List < String >, byte []> map (){
13+ return new HashMap <>( );
2114 }
2215
2316 List <String > resolveKeys (String [] keys ) {
@@ -95,3 +88,4 @@ public String toString() {
9588 return String .format ("<MemoryStore {%s}>" , hashCode ());
9689 }
9790}
91+
You can’t perform that action at this time.
0 commit comments