Skip to content

Commit

Permalink
Remove java string templates, bump google java format dep (#1019)
Browse files Browse the repository at this point in the history
Co-authored-by: Bryan Burkholder <[email protected]>
  • Loading branch information
bryanlb and bryanlb authored Aug 9, 2024
1 parent f203207 commit 5ee1e99
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion astra/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@
<dependency>
<groupId>com.google.googlejavaformat</groupId>
<artifactId>google-java-format</artifactId>
<version>1.22.0</version>
<version>1.23.0</version>
</dependency>
</dependencies>
<executions>
Expand Down
8 changes: 4 additions & 4 deletions astra/src/main/java/com/slack/astra/writer/SpanFormatter.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public static Trace.KeyValue makeTraceKV(String key, Object value, Schema.Schema
}
return tagBuilder.build();
} catch (Exception e) {
tagBuilder.setKey(STR."failed_\{key}");
tagBuilder.setKey(String.format("failed_%s", key));
tagBuilder.setFieldType(Schema.SchemaFieldType.KEYWORD);
tagBuilder.setVStr(value.toString());
return tagBuilder.build();
Expand All @@ -133,7 +133,7 @@ public static List<Trace.KeyValue> convertKVtoProto(
}
Trace.KeyValue additionalKV =
makeTraceKV(
STR."\{key}.\{additionalField.getKey()}",
String.format("%s.%s", key, additionalField.getKey()),
value,
additionalField.getValue().getType());
tags.add(additionalKV);
Expand All @@ -155,7 +155,7 @@ public static List<Trace.KeyValue> convertKVtoProtoDefault(
.forEach(
(key1, value1) -> {
List<Trace.KeyValue> nestedValues =
convertKVtoProtoDefault(STR."\{key}.\{key1}", value1, schema);
convertKVtoProtoDefault(String.format("%s.%s", key, key1), value1, schema);
tags.addAll(nestedValues);
});
} else if (value instanceof String || value instanceof List) {
Expand All @@ -176,7 +176,7 @@ public static List<Trace.KeyValue> convertKVtoProtoDefault(
}
Trace.KeyValue additionalKV =
makeTraceKV(
STR."\{key}.\{additionalField.getKey()}",
String.format("%s.%s", key, additionalField.getKey()),
value,
additionalField.getValue().getType());
tags.add(additionalKV);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ public void shouldParseIdFieldSearch() throws Exception {
IndexSearcher indexSearcher = logStoreAndSearcherRule.logStore.getSearcherManager().acquire();
Query idQuery =
openSearchAdapter.buildQuery(
"foo", STR."\{idField}:\{idValue}", null, null, indexSearcher, null);
"foo", String.format("%s:%s", idField, idValue), null, null, indexSearcher, null);
BytesRef queryStrBytes = new BytesRef(Uid.encodeId("1").bytes);
// idQuery.toString="#_id:([fe 1f])"
// queryStrBytes.toString="[fe 1f]"
Expand Down

0 comments on commit 5ee1e99

Please sign in to comment.