Skip to content

Commit

Permalink
javadoc and spotless
Browse files Browse the repository at this point in the history
Signed-off-by: garyschulte <garyschulte@gmail.com>
  • Loading branch information
garyschulte committed Jul 23, 2023
1 parent 8ad4d07 commit 1dc6218
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,15 @@ private static Map<SegmentIdentifier, Map<Bytes, Optional<byte[]>>> asSegmentMap
/** protected access to the rw lock. */
protected final ReadWriteLock rwLock;

/**
* Instantiates a new In memory key value storage.
*/
/** Instantiates a new In memory key value storage. */
public InMemoryKeyValueStorage() {
this(SEGMENT_IDENTIFIER);
}

/**
* Instantiates a new In memory key value storage with an initial map.
* @param initialMap the initial map
*
* @param initialMap the initial map
*/
public InMemoryKeyValueStorage(final Map<Bytes, Optional<byte[]>> initialMap) {
super(SEGMENT_IDENTIFIER, new SegmentedInMemoryKeyValueStorage(asSegmentMap(initialMap)));
Expand All @@ -79,6 +78,7 @@ public InMemoryKeyValueStorage(final Map<Bytes, Optional<byte[]>> initialMap) {

/**
* Instantiates a new In memory key value storage with a single segment identifier.
*
* @param segmentIdentifier the segment identifier
*/
public InMemoryKeyValueStorage(final SegmentIdentifier segmentIdentifier) {
Expand All @@ -88,6 +88,7 @@ public InMemoryKeyValueStorage(final SegmentIdentifier segmentIdentifier) {

/**
* Dump the contents of the storage to the print stream.
*
* @param ps the print stream.
*/
public void dump(final PrintStream ps) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import org.apache.commons.lang3.tuple.Pair;
import org.apache.tuweni.bytes.Bytes;

/** Segmented in memory key value storage. */
public class SegmentedInMemoryKeyValueStorage
implements SnappedKeyValueStorage, SnappableKeyValueStorage, SegmentedKeyValueStorage {
/** protected access for the backing hash map. */
Expand Down Expand Up @@ -69,7 +70,7 @@ public SegmentedInMemoryKeyValueStorage() {
* Instantiates a new In memory key value storage with specific set of segments.
*
* @param segments the segments to be used
* */
*/
public SegmentedInMemoryKeyValueStorage(final List<SegmentIdentifier> segments) {
this(
segments.stream()
Expand Down Expand Up @@ -267,6 +268,7 @@ public void rollback() {

/**
* Dump the content of the store to the provided PrintStream.
*
* @param ps the PrintStream to dump the content to.
*/
public void dump(final PrintStream ps) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public class SegmentedKeyValueStorageAdapter implements KeyValueStorage {

private static final Logger LOG = LoggerFactory.getLogger(SegmentedKeyValueStorageAdapter.class);
private final SegmentIdentifier segmentIdentifier;
/** The storage to wrap. */
protected final SegmentedKeyValueStorage storage;

/**
Expand Down Expand Up @@ -125,12 +126,14 @@ private void throwIfClosed() {
}
}

/** This class will adapt a SegmentedKeyValueStorageTransaction to a KeyValueStorageTransaction */
public static class KeyValueStorageTransactionAdapter implements KeyValueStorageTransaction {
private final SegmentedKeyValueStorageTransaction segmentedTransaction;
private final SegmentIdentifier segmentIdentifier;

/**
* Instantiates a new Key value storage transaction adapter.
*
* @param segmentIdentifier the segmentIdentifier to use for the wrapped transaction
* @param storage the storage
*/
Expand Down

0 comments on commit 1dc6218

Please sign in to comment.