mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
cosmetic changes and updated copyright
This commit is contained in:
parent
9b52ec7944
commit
c67bcd9b3f
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2022 nosqlbench
|
||||
* Copyright (c) 2023 nosqlbench
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2022 nosqlbench
|
||||
* Copyright (c) 2023 nosqlbench
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -31,7 +31,7 @@ import org.apache.logging.log4j.Logger;
|
||||
import java.util.function.LongFunction;
|
||||
|
||||
public class PineconeOpMapper implements OpMapper<PineconeOp> {
|
||||
private static final Logger LOGGER = LogManager.getLogger(PineconeOpMapper.class);
|
||||
private static final Logger logger = LogManager.getLogger(PineconeOpMapper.class);
|
||||
private final PineconeDriverAdapter adapter;
|
||||
private final DriverSpaceCache<? extends PineconeSpace> spaceCache;
|
||||
private final NBConfiguration cfg;
|
||||
@ -64,7 +64,7 @@ public class PineconeOpMapper implements OpMapper<PineconeOp> {
|
||||
|
||||
TypeAndTarget<PineconeOpTypes, String> opType = op.getTypeAndTarget(PineconeOpTypes.class, String.class, "type", "index");
|
||||
|
||||
LOGGER.info(() -> "Using " + opType.enumId + " statement form for '" + op.getName());
|
||||
logger.info(() -> "Using " + opType.enumId + " statement form for '" + op.getName());
|
||||
|
||||
return switch (opType.enumId) {
|
||||
case query ->
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2022 nosqlbench
|
||||
* Copyright (c) 2023 nosqlbench
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -32,7 +32,7 @@ import java.util.Map;
|
||||
|
||||
public class PineconeSpace {
|
||||
|
||||
private final static Logger LOGGER = LogManager.getLogger(PineconeSpace.class);
|
||||
private final static Logger logger = LogManager.getLogger(PineconeSpace.class);
|
||||
private final String apiKey;
|
||||
private final String environment;
|
||||
private final String projectName;
|
||||
@ -59,7 +59,7 @@ public class PineconeSpace {
|
||||
.withApiKey(apiKey)
|
||||
.withEnvironment(environment)
|
||||
.withProjectName(projectName);
|
||||
LOGGER.info(this.name + ": Creating new Pinecone Client with api key " + apiKey + ", environment "
|
||||
logger.info(this.name + ": Creating new Pinecone Client with api key " + apiKey + ", environment "
|
||||
+ environment + " and project name " + projectName);
|
||||
this.client = new PineconeClient(config);
|
||||
}
|
||||
@ -74,7 +74,7 @@ public class PineconeSpace {
|
||||
public synchronized PineconeConnection getConnection(String index) {
|
||||
PineconeConnection connection = connections.get(index);
|
||||
if (connection == null) {
|
||||
LOGGER.info("Creating new Pinecone Connection to Index " + index);
|
||||
logger.info("Creating new Pinecone Connection to Index " + index);
|
||||
PineconeConnectionConfig connectionConfig = new PineconeConnectionConfig().withIndexName(index);
|
||||
connection = client.connect(connectionConfig);
|
||||
connections.put(index, connection);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2022 nosqlbench
|
||||
* Copyright (c) 2023 nosqlbench
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -32,7 +32,7 @@ import java.util.function.LongFunction;
|
||||
|
||||
|
||||
public class PineconeDeleteOpDispenser extends PineconeOpDispenser {
|
||||
private static final Logger LOGGER = LogManager.getLogger(PineconeDeleteOpDispenser.class);
|
||||
private static final Logger logger = LogManager.getLogger(PineconeDeleteOpDispenser.class);
|
||||
private final LongFunction<DeleteRequest> deleteRequestFunc;
|
||||
|
||||
/**
|
||||
@ -53,7 +53,9 @@ public class PineconeDeleteOpDispenser extends PineconeOpDispenser {
|
||||
|
||||
@Override
|
||||
public PineconeOp apply(long value) {
|
||||
return new PineconeDeleteOp(pcFunction.apply(value).getConnection(targetFunction.apply(value)),
|
||||
return new PineconeDeleteOp(pcFunction
|
||||
.apply(value)
|
||||
.getConnection(targetFunction.apply(value)),
|
||||
deleteRequestFunc.apply(value));
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2022 nosqlbench
|
||||
* Copyright (c) 2023 nosqlbench
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -31,7 +31,7 @@ import java.util.Optional;
|
||||
import java.util.function.LongFunction;
|
||||
|
||||
public class PineconeDescribeIndexStatsOpDispenser extends PineconeOpDispenser {
|
||||
private static final Logger LOGGER = LogManager.getLogger(PineconeDescribeIndexStatsOpDispenser.class);
|
||||
private static final Logger logger = LogManager.getLogger(PineconeDescribeIndexStatsOpDispenser.class);
|
||||
private final LongFunction<DescribeIndexStatsRequest> indexStatsRequestFunc;
|
||||
|
||||
/**
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2022 nosqlbench
|
||||
* Copyright (c) 2023 nosqlbench
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -31,7 +31,7 @@ import java.util.Optional;
|
||||
import java.util.function.LongFunction;
|
||||
|
||||
public class PineconeFetchOpDispenser extends PineconeOpDispenser {
|
||||
private static final Logger LOGGER = LogManager.getLogger(PineconeFetchOpDispenser.class);
|
||||
private static final Logger logger = LogManager.getLogger(PineconeFetchOpDispenser.class);
|
||||
private final LongFunction<FetchRequest> fetchRequestFunc;
|
||||
|
||||
/**
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2022 nosqlbench
|
||||
* Copyright (c) 2023 nosqlbench
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -33,7 +33,7 @@ import java.util.*;
|
||||
import java.util.function.LongFunction;
|
||||
|
||||
public class PineconeQueryOpDispenser extends PineconeOpDispenser {
|
||||
private static final Logger LOGGER = LogManager.getLogger(PineconeQueryOpDispenser.class);
|
||||
private static final Logger logger = LogManager.getLogger(PineconeQueryOpDispenser.class);
|
||||
private final LongFunction<QueryRequest.Builder> queryRequestFunc;
|
||||
private final LongFunction<Collection<QueryVector>> queryVectorFunc;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2022 nosqlbench
|
||||
* Copyright (c) 2023 nosqlbench
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -33,7 +33,7 @@ import java.util.function.BiConsumer;
|
||||
import java.util.function.LongFunction;
|
||||
|
||||
public class PineconeUpdateOpDispenser extends PineconeOpDispenser {
|
||||
private static final Logger LOGGER = LogManager.getLogger(PineconeUpdateOpDispenser.class);
|
||||
private static final Logger logger = LogManager.getLogger(PineconeUpdateOpDispenser.class);
|
||||
private final LongFunction<UpdateRequest.Builder> updateRequestFunc;
|
||||
private final LongFunction<Struct> updateMetadataFunc;
|
||||
private final LongFunction<SparseValues> sparseValuesFunc;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2022 nosqlbench
|
||||
* Copyright (c) 2023 nosqlbench
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -34,7 +34,7 @@ import java.util.function.BiConsumer;
|
||||
import java.util.function.LongFunction;
|
||||
|
||||
public class PineconeUpsertOpDispenser extends PineconeOpDispenser {
|
||||
private static final Logger LOGGER = LogManager.getLogger(PineconeUpsertOpDispenser.class);
|
||||
private static final Logger logger = LogManager.getLogger(PineconeUpsertOpDispenser.class);
|
||||
private final LongFunction<UpsertRequest.Builder> upsertRequestFunc;
|
||||
private final LongFunction<Collection<Vector>> upsertVectorFunc;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2022 nosqlbench
|
||||
* Copyright (c) 2023 nosqlbench
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -25,7 +25,7 @@ import org.apache.logging.log4j.Logger;
|
||||
|
||||
public class PineconeDeleteOp extends PineconeOp {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger(PineconeDeleteOp.class);
|
||||
private static final Logger logger = LogManager.getLogger(PineconeDeleteOp.class);
|
||||
|
||||
private final DeleteRequest request;
|
||||
|
||||
@ -44,10 +44,10 @@ public class PineconeDeleteOp extends PineconeOp {
|
||||
public void run() {
|
||||
try {
|
||||
DeleteResponse response = connection.getBlockingStub().delete(request);
|
||||
LOGGER.info(response.toString());
|
||||
logger.info(response.toString());
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("Exception %s caught trying to do delete", e.getMessage());
|
||||
LOGGER.error(e.getStackTrace());
|
||||
logger.error("Exception %s caught trying to do delete", e.getMessage());
|
||||
logger.error(e.getStackTrace());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2022 nosqlbench
|
||||
* Copyright (c) 2023 nosqlbench
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -25,7 +25,7 @@ import org.apache.logging.log4j.Logger;
|
||||
|
||||
public class PineconeDescribeIndexStatsOp extends PineconeOp {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger(PineconeDescribeIndexStatsOp.class);
|
||||
private static final Logger logger = LogManager.getLogger(PineconeDescribeIndexStatsOp.class);
|
||||
|
||||
private final DescribeIndexStatsRequest request;
|
||||
|
||||
@ -46,8 +46,8 @@ public class PineconeDescribeIndexStatsOp extends PineconeOp {
|
||||
DescribeIndexStatsResponse response = connection.getBlockingStub().describeIndexStats(request);
|
||||
// Do soemething with the response...
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("Exception %s caught trying to do DescribeIndexStats", e.getMessage());
|
||||
LOGGER.error(e.getStackTrace());
|
||||
logger.error("Exception %s caught trying to do DescribeIndexStats", e.getMessage());
|
||||
logger.error(e.getStackTrace());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2022 nosqlbench
|
||||
* Copyright (c) 2023 nosqlbench
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -25,7 +25,7 @@ import org.apache.logging.log4j.Logger;
|
||||
|
||||
public class PineconeFetchOp extends PineconeOp {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger(PineconeFetchOp.class);
|
||||
private static final Logger logger = LogManager.getLogger(PineconeFetchOp.class);
|
||||
|
||||
private final FetchRequest request;
|
||||
|
||||
@ -46,8 +46,8 @@ public class PineconeFetchOp extends PineconeOp {
|
||||
FetchResponse response = connection.getBlockingStub().fetch(request);
|
||||
// Do soemething with the response...
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("Exception %s caught trying to do Fetch", e.getMessage());
|
||||
LOGGER.error(e.getStackTrace());
|
||||
logger.error("Exception %s caught trying to do Fetch", e.getMessage());
|
||||
logger.error(e.getStackTrace());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2022 nosqlbench
|
||||
* Copyright (c) 2023 nosqlbench
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2022 nosqlbench
|
||||
* Copyright (c) 2023 nosqlbench
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -25,7 +25,7 @@ import org.apache.logging.log4j.Logger;
|
||||
|
||||
public class PineconeQueryOp extends PineconeOp {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger(PineconeQueryOp.class);
|
||||
private static final Logger logger = LogManager.getLogger(PineconeQueryOp.class);
|
||||
|
||||
private final QueryRequest request;
|
||||
|
||||
@ -44,11 +44,11 @@ public class PineconeQueryOp extends PineconeOp {
|
||||
public void run() {
|
||||
try {
|
||||
QueryResponse response = connection.getBlockingStub().query(request);
|
||||
LOGGER.info("got query result ids: "
|
||||
logger.info("got query result ids: "
|
||||
+ response.getResultsList().get(0).getMatchesList());
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("Exception %s caught trying to do Query", e.getMessage());
|
||||
LOGGER.error(e.getStackTrace());
|
||||
logger.error("Exception %s caught trying to do Query", e.getMessage());
|
||||
logger.error(e.getStackTrace());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2022 nosqlbench
|
||||
* Copyright (c) 2023 nosqlbench
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -25,7 +25,7 @@ import org.apache.logging.log4j.Logger;
|
||||
|
||||
public class PineconeUpdateOp extends PineconeOp {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger(PineconeUpdateOp.class);
|
||||
private static final Logger logger = LogManager.getLogger(PineconeUpdateOp.class);
|
||||
|
||||
private final UpdateRequest request;
|
||||
|
||||
@ -46,8 +46,8 @@ public class PineconeUpdateOp extends PineconeOp {
|
||||
UpdateResponse response = connection.getBlockingStub().update(request);
|
||||
// Do soemething with the response...
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("Exception %s caught trying to do Update", e.getMessage());
|
||||
LOGGER.error(e.getStackTrace());
|
||||
logger.error("Exception %s caught trying to do Update", e.getMessage());
|
||||
logger.error(e.getStackTrace());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2022 nosqlbench
|
||||
* Copyright (c) 2023 nosqlbench
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -25,7 +25,7 @@ import org.apache.logging.log4j.Logger;
|
||||
|
||||
public class PineconeUpsertOp extends PineconeOp {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger(PineconeUpsertOp.class);
|
||||
private static final Logger logger = LogManager.getLogger(PineconeUpsertOp.class);
|
||||
|
||||
private final UpsertRequest request;
|
||||
|
||||
@ -44,10 +44,10 @@ public class PineconeUpsertOp extends PineconeOp {
|
||||
public void run() {
|
||||
try {
|
||||
UpsertResponse response = connection.getBlockingStub().upsert(request);
|
||||
LOGGER.info("Put " + response.getUpsertedCount() + " vectors into the index");
|
||||
logger.info("Put " + response.getUpsertedCount() + " vectors into the index");
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("Exception %s caught trying to do upsert", e.getMessage());
|
||||
LOGGER.error(e.getStackTrace());
|
||||
logger.error("Exception %s caught trying to do upsert", e.getMessage());
|
||||
logger.error(e.getStackTrace());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user