Skip to content

Commit

Permalink
Merge pull request #408 from Zelldon/ck-fix-cf-names
Browse files Browse the repository at this point in the history
Convert given CF names
  • Loading branch information
Zelldon authored Jun 16, 2024
2 parents 407ee05 + cf0dbf3 commit 42cb5b8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cli/src/main/java/io/zell/zdb/state/StateCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class StateCommand implements Callable<Integer> {

@Override
public Integer call() {
final var jsonString = new ZeebeDbReader(partitionPath).stateStatisticsAsJsonString();
final var jsonString = new ZeebeDbReader(this.partitionPath).stateStatisticsAsJsonString();
System.out.println(jsonString);
return 0;
}
Expand All @@ -64,7 +64,7 @@ public int list(
new JsonPrinter()
.surround(
(printer) -> {
final var zeebeDbReader = new ZeebeDbReader(partitionPath);
final var zeebeDbReader = new ZeebeDbReader(this.partitionPath);
// we print incrementally in order to avoid to build up big state in the application
if (noColumnFamilyGiven(columnFamilyName)) {
zeebeDbReader.visitDBWithJsonValues(
Expand All @@ -78,7 +78,7 @@ public int list(
valueJson));
}));
} else {
final var cf = ZbColumnFamilies.valueOf(columnFamilyName);
final var cf = ZbColumnFamilies.valueOf(columnFamilyName.toUpperCase());
zeebeDbReader.visitDBWithPrefix(
cf,
((key, valueJson) ->
Expand All @@ -93,7 +93,7 @@ public int list(
return 0;
}

private KeyFormatters chooseKeyFormatters(String keyFormat) {
private KeyFormatters chooseKeyFormatters(final String keyFormat) {
return switch (keyFormat) {
case "default", "" -> KeyFormatters.ofDefault();
case null -> KeyFormatters.ofDefault();
Expand All @@ -102,7 +102,7 @@ private KeyFormatters chooseKeyFormatters(String keyFormat) {
};
}

private static boolean noColumnFamilyGiven(String columnFamilyName) {
private static boolean noColumnFamilyGiven(final String columnFamilyName) {
return columnFamilyName == null || columnFamilyName.isEmpty();
}
}

0 comments on commit 42cb5b8

Please sign in to comment.