Skip to content

Commit

Permalink
remove unneeded isPersistent
Browse files Browse the repository at this point in the history
Signed-off-by: garyschulte <[email protected]>
  • Loading branch information
garyschulte committed Dec 18, 2024
1 parent 12fecea commit 22a92af
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 45 deletions.
2 changes: 1 addition & 1 deletion plugin-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Calculated : ${currentHash}
tasks.register('checkAPIChanges', FileStateChecker) {
description = "Checks that the API for the Plugin-API project does not change without deliberate thought"
files = sourceSets.main.allJava.files
knownHash = '383yMOZRiNz6gXhjXhKXtNxZhVGzNXtnEcFUPDSNrY0='
knownHash = 'rV5/+XT2itQKN6+IG8CHX4a1DKH83FuyAo9N96Q73jc='
}
check.dependsOn('checkAPIChanges')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,4 @@ public interface KeyValueStorage extends Closeable {
* @return boolean indicating whether the storage is closed.
*/
boolean isClosed();

/**
* Is this storage persistent or ephemeral.
*
* @return whether this storage type is persistent or not.
*/
boolean isPersistent();
}
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,4 @@ public Optional<Bytes> wrapBytes() {
return value.map(Bytes::wrap);
}
}

/**
* Whether this storage is persistent or ephemeral.
*
* @return if storage is persistent.
*/
boolean isPersistent();
}
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,6 @@ public boolean isClosed() {
return closed.get();
}

@Override
public boolean isPersistent() {
return false;
}

@Override
public void clear(final SegmentIdentifier segment) {
throw new UnsupportedOperationException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -482,9 +482,4 @@ public String forDisplay() {
return String.format("'%s'(%s)", name, Bytes.of(id).toHexString());
}
}

@Override
public boolean isPersistent() {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,4 @@ public InMemoryKeyValueStorage(final SegmentIdentifier segmentIdentifier) {
public void dump(final PrintStream ps) {
((SegmentedInMemoryKeyValueStorage) storage).dump(ps);
}

@Override
public boolean isPersistent() {
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,6 @@ public boolean isClosed() {
return false;
}

@Override
public boolean isPersistent() {
return false;
}

private class MemoryTransaction implements KeyValueStorageTransaction {

private Map<Bytes, byte[]> updatedValues = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,11 +310,6 @@ public boolean isClosed() {
return false;
}

@Override
public boolean isPersistent() {
return false;
}

@Override
public SegmentedInMemoryKeyValueStorage takeSnapshot() {
// need to clone the submaps also:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,6 @@ public boolean isClosed() {
return storage.isClosed();
}

@Override
public boolean isPersistent() {
return storage.isPersistent();
}

private void throwIfClosed() {
if (storage.isClosed()) {
LOG.error("Attempting to use a closed Storage instance.");
Expand Down

0 comments on commit 22a92af

Please sign in to comment.