Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ protected Flux<SO> internalInvocationStream(I request, Class<SO> clazz) {
.builder()
.onChunk(chunk -> {
try {
logger.debug("Received chunk: " + chunk.bytes().asString(StandardCharsets.UTF_8));
logger.debug("Received chunk: {}", chunk.bytes().asString(StandardCharsets.UTF_8));
SO response = this.objectMapper.readValue(chunk.bytes().asByteArray(), clazz);
eventSink.emitNext(response, DEFAULT_EMIT_FAILURE_HANDLER);
}
Expand All @@ -297,7 +297,7 @@ protected Flux<SO> internalInvocationStream(I request, Class<SO> clazz) {
}
})
.onDefault(event -> {
logger.error("Unknown or unhandled event: " + event.toString());
logger.error("Unknown or unhandled event: {}", event.toString());
eventSink.emitError(new Throwable("Unknown or unhandled event: " + event.toString()), DEFAULT_EMIT_FAILURE_HANDLER);
})
.build();
Expand All @@ -310,7 +310,7 @@ protected Flux<SO> internalInvocationStream(I request, Class<SO> clazz) {
logger.info("Completed streaming response.");
})
.onError(error -> {
logger.error("\n\nError streaming response: " + error.getMessage());
logger.error("\n\nError streaming response: {}", error.getMessage());
eventSink.emitError(error, DEFAULT_EMIT_FAILURE_HANDLER);
})
.onEventStream(stream -> stream.subscribe(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private List<Document> createDocuments(List<String> texts, List<ContentFormatter
Map<String, Object> metadata = metadataList.get(i);
List<String> chunks = splitText(text);
if (chunks.size() > 1) {
logger.info("Splitting up document into " + chunks.size() + " chunks.");
logger.info("Splitting up document into {} chunks.", chunks.size());
}
for (String chunk : chunks) {
// only primitive values are in here -
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void handleError(@NonNull ClientHttpResponse response) throws IOException
@Override
public <T extends Object, E extends Throwable> void onError(RetryContext context,
RetryCallback<T, E> callback, Throwable throwable) {
logger.warn("Retry error. Retry count:" + context.getRetryCount(), throwable);
logger.warn("Retry error. Retry count:{}", context.getRetryCount(), throwable);
}
})
.build();
Expand All @@ -107,7 +107,7 @@ public <T extends Object, E extends Throwable> void onError(RetryContext context
@Override
public <T extends Object, E extends Throwable> void onError(RetryContext context,
RetryCallback<T, E> callback, Throwable throwable) {
logger.warn("Retry error. Retry count:" + context.getRetryCount());
logger.warn("Retry error. Retry count:{}", context.getRetryCount());
}
})
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ public void afterPropertiesSet() throws Exception {

SearchIndex index = this.searchIndexClient.createOrUpdateIndex(searchIndex);

logger.info("Created search index: " + index.getName());
logger.info("Created search index: {}", index.getName());

this.searchClient = this.searchIndexClient.getSearchClient(this.indexName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ protected void doDelete(Filter.Expression expression) {

Map<String, Object> whereClause = this.chromaApi.where(whereClauseStr);

logger.debug("Deleting with where clause: " + whereClause);
logger.debug("Deleting with where clause: {}", whereClause);

DeleteEmbeddingsRequest deleteRequest = new DeleteEmbeddingsRequest(null, whereClause);
this.chromaApi.deleteEmbeddings(this.tenantName, this.databaseName, this.collectionId, deleteRequest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void validateTableSchema(String schemaName, String tableName, String idFieldName
schemaName, tableName);
}
catch (DataAccessException e) {
logger.error("Error while validating database vector support " + e.getMessage());
logger.error("Error while validating database vector support {}", e.getMessage());
logger.error("Failed to validate that database supports VECTOR.\n" + "Run the following SQL commands:\n"
+ " SELECT @@version; \nAnd ensure that version is >= 11.7.1");
throw new IllegalStateException(e);
Expand Down Expand Up @@ -118,7 +118,7 @@ void validateTableSchema(String schemaName, String tableName, String idFieldName

}
catch (DataAccessException | IllegalStateException e) {
logger.error("Error while validating table schema" + e.getMessage());
logger.error("Error while validating table schema{}", e.getMessage());
logger.error("Failed to operate with the specified table in the database. To resolve this issue,"
+ " please ensure the following steps are completed:\n"
+ "1. Verify that the table exists with the appropriate structure. If it does not"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ public List<Document> doSimilaritySearch(SearchRequest request) {
this.idFieldName, this.contentFieldName, this.metadataFieldName, distanceType, this.embeddingFieldName,
getFullyQualifiedTableName(), jsonPathFilter);

logger.debug("SQL query: " + sql);
logger.debug("SQL query: {}", sql);

return this.jdbcTemplate.query(sql, new DocumentRowMapper(this.objectMapper), embedding, distance,
request.getTopK());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ public void doDelete(List<String> idList) {

long deleteCount = status.getData().getDeleteCnt();
if (deleteCount != idList.size()) {
logger.warn(String.format("Deleted only %s entries from requested %s ", deleteCount, idList.size()));
logger.warn("Deleted only {} entries from requested {} ", deleteCount, idList.size());
}
}

Expand Down Expand Up @@ -544,8 +544,9 @@ int embeddingDimensions() {
}
}
catch (Exception e) {
logger.warn("Failed to obtain the embedding dimensions from the embedding model and fall backs to default:"
+ this.embeddingDimension, e);
logger.warn(
"Failed to obtain the embedding dimensions from the embedding model and fall backs to default:{}",
this.embeddingDimension, e);
}
return OPENAI_EMBEDDING_DIMENSION_SIZE;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ protected void doDelete(Filter.Expression filterExpression) {
BasicQuery query = new BasicQuery(nativeFilterExpression);
DeleteResult deleteResult = this.mongoTemplate.remove(query, this.collectionName);

logger.debug("Deleted " + deleteResult.getDeletedCount() + " documents matching filter expression");
logger.debug("Deleted {} documents matching filter expression", deleteResult.getDeletedCount());
}
catch (Exception e) {
throw new IllegalStateException("Failed to delete documents by filter", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ protected void doDelete(Filter.Expression filterExpression) {
.build();

DeleteByQueryResponse response = this.openSearchClient.deleteByQuery(request);
logger.debug("Deleted " + response.deleted() + " documents matching filter expression");
logger.debug("Deleted {} documents matching filter expression", response.deleted());

if (!response.failures().isEmpty()) {
throw new IllegalStateException("Failed to delete some documents: " + response.failures());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,10 @@ protected void doDelete(Filter.Expression filterExpression) {
String jsonPath = this.filterExpressionConverter.convertExpression(filterExpression);
String sql = String.format("DELETE FROM %s WHERE JSON_EXISTS(metadata, '%s')", this.tableName, jsonPath);

logger.debug("Executing delete with filter: " + sql);
logger.debug("Executing delete with filter: {}", sql);

int deletedCount = this.jdbcTemplate.update(sql);
logger.debug("Deleted " + deletedCount + " documents matching filter expression");
logger.debug("Deleted {} documents matching filter expression", deletedCount);
}
catch (Exception e) {
logger.error("Failed to delete documents by filter: {}", e.getMessage(), e);
Expand Down Expand Up @@ -378,7 +378,7 @@ public int getBatchSize() {
this.distanceType == OracleVectorStore.OracleVectorStoreDistanceType.DOT ? ")/2" : "",
this.tableName, jsonPathFilter, request.getTopK(), this.searchAccuracy);

logger.debug("SQL query: " + sql);
logger.debug("SQL query: {}", sql);

return this.jdbcTemplate.query(sql, new DocumentRowMapper(), embeddingVector);
}
Expand All @@ -397,7 +397,7 @@ else if (request.getSimilarityThreshold() == SIMILARITY_THRESHOLD_EXACT_MATCH) {
this.distanceType == OracleVectorStore.OracleVectorStoreDistanceType.DOT ? ")/2" : "",
this.tableName, jsonPathFilter, request.getTopK());

logger.debug("SQL query: " + sql);
logger.debug("SQL query: {}", sql);

return this.jdbcTemplate.query(sql, new DocumentRowMapper(), embeddingVector);
}
Expand Down Expand Up @@ -453,7 +453,7 @@ where VECTOR_DISTANCE(embedding, ?, COSINE) <= ?%s
fetch APPROXIMATE first %d rows only WITH TARGET ACCURACY %d""",
this.tableName, jsonPathFilter, request.getTopK(), this.searchAccuracy));

logger.debug("SQL query: " + sql);
logger.debug("SQL query: {}", sql);

return this.jdbcTemplate.query(sql, new DocumentRowMapper(), embeddingVector, embeddingVector,
distance);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ void validateTableSchema(String schemaName, String tableName) {

}
catch (DataAccessException | IllegalStateException e) {
logger.error("Error while validating table schema" + e.getMessage());
logger.error("Error while validating table schema{}", e.getMessage());
logger
.error("Failed to operate with the specified table in the database. To resolve this issue, please ensure the following steps are completed:\n"
+ "1. Ensure the necessary PostgreSQL extensions are enabled. Run the following SQL commands:\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,9 @@ int embeddingDimensions() {
}
}
catch (Exception e) {
logger.warn("Failed to obtain the embedding dimensions from the embedding model and fall backs to default:"
+ this.embeddingDimension, e);
logger.warn(
"Failed to obtain the embedding dimensions from the embedding model and fall backs to default:{}",
this.embeddingDimension, e);
}
return OPENAI_EMBEDDING_DIMENSION_SIZE;
}
Expand Down