diff --git a/src/main/java/io/stargate/sgv2/jsonapi/service/cqldriver/executor/KeyspaceSchemaObject.java b/src/main/java/io/stargate/sgv2/jsonapi/service/cqldriver/executor/KeyspaceSchemaObject.java index 45ff57c2fd..e0eccb7482 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/service/cqldriver/executor/KeyspaceSchemaObject.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/service/cqldriver/executor/KeyspaceSchemaObject.java @@ -9,13 +9,33 @@ public class KeyspaceSchemaObject extends SchemaObject { new KeyspaceSchemaObject(SchemaObjectName.MISSING); public KeyspaceSchemaObject(String keyspace) { - this(new SchemaObjectName(keyspace, SchemaObjectName.MISSING_NAME)); + this(newObjectName(keyspace)); } public KeyspaceSchemaObject(SchemaObjectName name) { super(TYPE, name); } + /** + * Construct a {@link KeyspaceSchemaObject} that represents the keyspace the collection is in. + * + * @param collection + * @return + */ + public static KeyspaceSchemaObject fromSchemaObject(CollectionSchemaObject collection) { + return new KeyspaceSchemaObject(newObjectName(collection.name.keyspace())); + } + + /** + * Construct a {@link KeyspaceSchemaObject} that represents the keyspace the collection is in. + * + * @param table + * @return + */ + public static KeyspaceSchemaObject fromSchemaObject(TableSchemaObject table) { + return new KeyspaceSchemaObject(newObjectName(table.name.keyspace())); + } + @Override public VectorConfig vectorConfig() { return VectorConfig.notEnabledVectorConfig(); @@ -25,4 +45,15 @@ public VectorConfig vectorConfig() { public IndexUsage newIndexUsage() { return IndexUsage.NO_OP; } + + /** + * Centralised creation of the name for a Keyspace so we always use the correct marker object for + * collection name + * + * @param keyspaceName + * @return + */ + private static SchemaObjectName newObjectName(String keyspaceName) { + return new SchemaObjectName(keyspaceName, SchemaObjectName.MISSING_NAME); + } } diff --git a/src/main/java/io/stargate/sgv2/jsonapi/service/operation/model/collections/CreateCollectionOperation.java b/src/main/java/io/stargate/sgv2/jsonapi/service/operation/model/collections/CreateCollectionOperation.java index cd58050e1d..2e9998279d 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/service/operation/model/collections/CreateCollectionOperation.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/service/operation/model/collections/CreateCollectionOperation.java @@ -17,6 +17,7 @@ import io.stargate.sgv2.jsonapi.exception.JsonApiException; import io.stargate.sgv2.jsonapi.service.cqldriver.CQLSessionCache; import io.stargate.sgv2.jsonapi.service.cqldriver.executor.CollectionSchemaObject; +import io.stargate.sgv2.jsonapi.service.cqldriver.executor.KeyspaceSchemaObject; import io.stargate.sgv2.jsonapi.service.cqldriver.executor.QueryExecutor; import io.stargate.sgv2.jsonapi.service.operation.model.Operation; import io.stargate.sgv2.jsonapi.service.schema.model.JsonapiTableMatcher; @@ -31,7 +32,7 @@ import org.slf4j.LoggerFactory; public record CreateCollectionOperation( - CommandContext commandContext, + CommandContext commandContext, DatabaseLimitsConfig dbLimitsConfig, ObjectMapper objectMapper, CQLSessionCache cqlSessionCache, @@ -51,7 +52,7 @@ public record CreateCollectionOperation( private static final JsonapiTableMatcher COLLECTION_MATCHER = new JsonapiTableMatcher(); public static CreateCollectionOperation withVectorSearch( - CommandContext commandContext, + CommandContext commandContext, DatabaseLimitsConfig dbLimitsConfig, ObjectMapper objectMapper, CQLSessionCache cqlSessionCache, @@ -78,7 +79,7 @@ public static CreateCollectionOperation withVectorSearch( } public static CreateCollectionOperation withoutVectorSearch( - CommandContext commandContext, + CommandContext commandContext, DatabaseLimitsConfig dbLimitsConfig, ObjectMapper objectMapper, CQLSessionCache cqlSessionCache, @@ -308,6 +309,7 @@ private Multi createIndexParallel( public Uni cleanUpCollectionFailedWithTooManyIndex( DataApiRequestInfo dataApiRequestInfo, QueryExecutor queryExecutor) { + DeleteCollectionOperation deleteCollectionOperation = new DeleteCollectionOperation(commandContext, name); return deleteCollectionOperation diff --git a/src/main/java/io/stargate/sgv2/jsonapi/service/operation/model/collections/DeleteCollectionOperation.java b/src/main/java/io/stargate/sgv2/jsonapi/service/operation/model/collections/DeleteCollectionOperation.java index 72c10cf625..dbfd71f7d9 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/service/operation/model/collections/DeleteCollectionOperation.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/service/operation/model/collections/DeleteCollectionOperation.java @@ -5,7 +5,7 @@ import io.stargate.sgv2.jsonapi.api.model.command.CommandContext; import io.stargate.sgv2.jsonapi.api.model.command.CommandResult; import io.stargate.sgv2.jsonapi.api.request.DataApiRequestInfo; -import io.stargate.sgv2.jsonapi.service.cqldriver.executor.CollectionSchemaObject; +import io.stargate.sgv2.jsonapi.service.cqldriver.executor.KeyspaceSchemaObject; import io.stargate.sgv2.jsonapi.service.cqldriver.executor.QueryExecutor; import io.stargate.sgv2.jsonapi.service.operation.model.Operation; import java.util.function.Supplier; @@ -18,7 +18,7 @@ * @param context Command context, carries namespace of the collection. * @param name Collection name. */ -public record DeleteCollectionOperation(CommandContext context, String name) +public record DeleteCollectionOperation(CommandContext context, String name) implements Operation { private static final Logger logger = LoggerFactory.getLogger(DeleteCollectionOperation.class); diff --git a/src/main/java/io/stargate/sgv2/jsonapi/service/operation/model/collections/FindCollectionsOperation.java b/src/main/java/io/stargate/sgv2/jsonapi/service/operation/model/collections/FindCollectionsOperation.java index 5e2f80abd7..b1f1674d8a 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/service/operation/model/collections/FindCollectionsOperation.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/service/operation/model/collections/FindCollectionsOperation.java @@ -13,6 +13,7 @@ import io.stargate.sgv2.jsonapi.exception.JsonApiException; import io.stargate.sgv2.jsonapi.service.cqldriver.CQLSessionCache; import io.stargate.sgv2.jsonapi.service.cqldriver.executor.CollectionSchemaObject; +import io.stargate.sgv2.jsonapi.service.cqldriver.executor.KeyspaceSchemaObject; import io.stargate.sgv2.jsonapi.service.cqldriver.executor.QueryExecutor; import io.stargate.sgv2.jsonapi.service.operation.model.Operation; import io.stargate.sgv2.jsonapi.service.schema.model.JsonapiTableMatcher; @@ -35,17 +36,19 @@ public record FindCollectionsOperation( ObjectMapper objectMapper, CQLSessionCache cqlSessionCache, JsonapiTableMatcher tableMatcher, - CommandContext commandContext) + CommandContext commandContext) implements Operation { // shared table matcher instance + // TODO: if this is static why does the record that have an instance variable passed by the ctor + // below ? private static final JsonapiTableMatcher TABLE_MATCHER = new JsonapiTableMatcher(); public FindCollectionsOperation( boolean explain, ObjectMapper objectMapper, CQLSessionCache cqlSessionCache, - CommandContext commandContext) { + CommandContext commandContext) { this(explain, objectMapper, cqlSessionCache, TABLE_MATCHER, commandContext); } diff --git a/src/main/java/io/stargate/sgv2/jsonapi/service/resolver/model/CommandResolver.java b/src/main/java/io/stargate/sgv2/jsonapi/service/resolver/model/CommandResolver.java index 36224eedcf..9bf276f094 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/service/resolver/model/CommandResolver.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/service/resolver/model/CommandResolver.java @@ -80,7 +80,7 @@ default Operation resolveCollectionCommand( // commands are tested well throw new UnsupportedOperationException( String.format( - "%s Command does not support operating on Collectons, target was %s", + "%s Command does not support operating on Collections, target was %s", command.getClass().getSimpleName(), ctx.schemaObject().name)); } ; diff --git a/src/main/java/io/stargate/sgv2/jsonapi/service/resolver/model/impl/CreateCollectionCommandResolver.java b/src/main/java/io/stargate/sgv2/jsonapi/service/resolver/model/impl/CreateCollectionCommandResolver.java index 91ba4ff3ea..2cb4e17fd3 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/service/resolver/model/impl/CreateCollectionCommandResolver.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/service/resolver/model/impl/CreateCollectionCommandResolver.java @@ -12,7 +12,7 @@ import io.stargate.sgv2.jsonapi.exception.ErrorCode; import io.stargate.sgv2.jsonapi.exception.JsonApiException; import io.stargate.sgv2.jsonapi.service.cqldriver.CQLSessionCache; -import io.stargate.sgv2.jsonapi.service.cqldriver.executor.CollectionSchemaObject; +import io.stargate.sgv2.jsonapi.service.cqldriver.executor.KeyspaceSchemaObject; import io.stargate.sgv2.jsonapi.service.embedding.configuration.EmbeddingProvidersConfig; import io.stargate.sgv2.jsonapi.service.embedding.configuration.ProviderConstants; import io.stargate.sgv2.jsonapi.service.operation.model.Operation; @@ -65,8 +65,8 @@ public Class getCommandClass() { } @Override - public Operation resolveCollectionCommand( - CommandContext ctx, CreateCollectionCommand command) { + public Operation resolveKeyspaceCommand( + CommandContext ctx, CreateCollectionCommand command) { if (command.options() == null) { return CreateCollectionOperation.withoutVectorSearch( ctx, diff --git a/src/main/java/io/stargate/sgv2/jsonapi/service/resolver/model/impl/DeleteCollectionCommandResolver.java b/src/main/java/io/stargate/sgv2/jsonapi/service/resolver/model/impl/DeleteCollectionCommandResolver.java index 6b08bb9f17..25b67df1df 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/service/resolver/model/impl/DeleteCollectionCommandResolver.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/service/resolver/model/impl/DeleteCollectionCommandResolver.java @@ -2,7 +2,7 @@ import io.stargate.sgv2.jsonapi.api.model.command.CommandContext; import io.stargate.sgv2.jsonapi.api.model.command.impl.DeleteCollectionCommand; -import io.stargate.sgv2.jsonapi.service.cqldriver.executor.CollectionSchemaObject; +import io.stargate.sgv2.jsonapi.service.cqldriver.executor.KeyspaceSchemaObject; import io.stargate.sgv2.jsonapi.service.operation.model.Operation; import io.stargate.sgv2.jsonapi.service.operation.model.collections.DeleteCollectionOperation; import io.stargate.sgv2.jsonapi.service.resolver.model.CommandResolver; @@ -17,8 +17,8 @@ public Class getCommandClass() { } @Override - public Operation resolveCollectionCommand( - CommandContext ctx, DeleteCollectionCommand command) { + public Operation resolveKeyspaceCommand( + CommandContext ctx, DeleteCollectionCommand command) { return new DeleteCollectionOperation(ctx, command.name()); } } diff --git a/src/main/java/io/stargate/sgv2/jsonapi/service/resolver/model/impl/FindCollectionsCommandResolver.java b/src/main/java/io/stargate/sgv2/jsonapi/service/resolver/model/impl/FindCollectionsCommandResolver.java index d568594567..c24e2ffb0e 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/service/resolver/model/impl/FindCollectionsCommandResolver.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/service/resolver/model/impl/FindCollectionsCommandResolver.java @@ -4,7 +4,7 @@ import io.stargate.sgv2.jsonapi.api.model.command.CommandContext; import io.stargate.sgv2.jsonapi.api.model.command.impl.FindCollectionsCommand; import io.stargate.sgv2.jsonapi.service.cqldriver.CQLSessionCache; -import io.stargate.sgv2.jsonapi.service.cqldriver.executor.CollectionSchemaObject; +import io.stargate.sgv2.jsonapi.service.cqldriver.executor.KeyspaceSchemaObject; import io.stargate.sgv2.jsonapi.service.operation.model.Operation; import io.stargate.sgv2.jsonapi.service.operation.model.collections.FindCollectionsOperation; import io.stargate.sgv2.jsonapi.service.resolver.model.CommandResolver; @@ -32,8 +32,9 @@ public Class getCommandClass() { /** {@inheritDoc} */ @Override - public Operation resolveCollectionCommand( - CommandContext ctx, FindCollectionsCommand command) { + public Operation resolveKeyspaceCommand( + CommandContext ctx, FindCollectionsCommand command) { + boolean explain = command.options() != null ? command.options().explain() : false; return new FindCollectionsOperation(explain, objectMapper, cqlSessionCache, ctx); } diff --git a/src/main/offline/io/stargate/sgv2/jsonapi/api/model/command/impl/BeginOfflineSessionCommand.java b/src/main/offline/io/stargate/sgv2/jsonapi/api/model/command/impl/BeginOfflineSessionCommand.java index eeb42212ae..0a2b4216cf 100644 --- a/src/main/offline/io/stargate/sgv2/jsonapi/api/model/command/impl/BeginOfflineSessionCommand.java +++ b/src/main/offline/io/stargate/sgv2/jsonapi/api/model/command/impl/BeginOfflineSessionCommand.java @@ -9,6 +9,7 @@ import io.stargate.sgv2.jsonapi.api.model.command.CommandContext; import io.stargate.sgv2.jsonapi.api.request.FileWriterParams; import io.stargate.sgv2.jsonapi.service.cqldriver.executor.CollectionSchemaObject; +import io.stargate.sgv2.jsonapi.service.cqldriver.executor.KeyspaceSchemaObject; import io.stargate.sgv2.jsonapi.service.cqldriver.executor.VectorConfig; import io.stargate.sgv2.jsonapi.service.operation.model.collections.CreateCollectionOperation; import io.stargate.sgv2.jsonapi.service.operation.model.collections.InsertOperation; @@ -153,9 +154,16 @@ private FileWriterParams buildFileWriterParams(CollectionSchemaObject collection boolean hasIndexing = indexingConfig != null; boolean hasVector = vectorSearchConfig != null; - var commandContext = + var tableCommandContext = CommandContext.forSchemaObject(collectionObject, null, this.createCollection.name(), null); + var keyspaceCommandContext = + CommandContext.forSchemaObject( + KeyspaceSchemaObject.fromSchemaObject(collectionObject), + null, + this.createCollection.name(), + null); + String comment = CreateCollectionCommandResolver.generateComment( new ObjectMapper(), @@ -168,7 +176,7 @@ private FileWriterParams buildFileWriterParams(CollectionSchemaObject collection CreateCollectionOperation createCollectionOperation = hasVector ? CreateCollectionOperation.withVectorSearch( - commandContext, + keyspaceCommandContext, null, new ObjectMapper(), null, @@ -182,7 +190,7 @@ private FileWriterParams buildFileWriterParams(CollectionSchemaObject collection false, false) : CreateCollectionOperation.withoutVectorSearch( - commandContext, + keyspaceCommandContext, null, new ObjectMapper(), null, @@ -202,7 +210,7 @@ private FileWriterParams buildFileWriterParams(CollectionSchemaObject collection .map(SimpleStatement::getQuery) .toList(); InsertOperation insertOperation = - InsertOperation.create(commandContext, List.of(), true, true, false); + InsertOperation.create(tableCommandContext, List.of(), true, true, false); String insertStatementCQL = insertOperation.buildInsertQuery(hasVector); return new FileWriterParams( this.namespace, diff --git a/src/test/java/io/stargate/sgv2/jsonapi/service/operation/model/impl/CountOperationTest.java b/src/test/java/io/stargate/sgv2/jsonapi/service/operation/model/impl/CountOperationTest.java index 06dca14c75..61344e3615 100644 --- a/src/test/java/io/stargate/sgv2/jsonapi/service/operation/model/impl/CountOperationTest.java +++ b/src/test/java/io/stargate/sgv2/jsonapi/service/operation/model/impl/CountOperationTest.java @@ -64,7 +64,8 @@ public void countWithNoFilter() { return CompletableFuture.supplyAsync(() -> mockResults).minimalCompletionStage(); }); - CountOperation countOperation = new CountOperation(CONTEXT, LogicalExpression.and(), 100, -1); + CountOperation countOperation = + new CountOperation(COLLECTION_CONTEXT, LogicalExpression.and(), 100, -1); Supplier execute = countOperation .execute(dataApiRequestInfo, queryExecutor) @@ -113,7 +114,7 @@ public void countWithDynamic() { .setDBFilters( List.of( new TextCollectionFilter("username", MapCollectionFilter.Operator.EQ, "user1"))); - CountOperation countOperation = new CountOperation(CONTEXT, implicitAnd, 100, -1); + CountOperation countOperation = new CountOperation(COLLECTION_CONTEXT, implicitAnd, 100, -1); Supplier execute = countOperation .execute(dataApiRequestInfo, queryExecutor) @@ -164,7 +165,7 @@ public void countWithDynamicNoMatch() { new TextCollectionFilter( "username", MapCollectionFilter.Operator.EQ, "user_all"))); - CountOperation countOperation = new CountOperation(CONTEXT, implicitAnd, 100, -1); + CountOperation countOperation = new CountOperation(COLLECTION_CONTEXT, implicitAnd, 100, -1); Supplier execute = countOperation .execute(dataApiRequestInfo, queryExecutor) @@ -203,7 +204,7 @@ public void error() { }); LogicalExpression implicitAnd = LogicalExpression.and(); - CountOperation countOperation = new CountOperation(CONTEXT, implicitAnd, 100, -1); + CountOperation countOperation = new CountOperation(COLLECTION_CONTEXT, implicitAnd, 100, -1); Throwable result = countOperation .execute(dataApiRequestInfo, queryExecutor) @@ -247,7 +248,8 @@ public void countWithNoFilter() { return CompletableFuture.supplyAsync(() -> mockResults).minimalCompletionStage(); }); - CountOperation countOperation = new CountOperation(CONTEXT, LogicalExpression.and(), 100, 10); + CountOperation countOperation = + new CountOperation(COLLECTION_CONTEXT, LogicalExpression.and(), 100, 10); Supplier execute = countOperation .execute(dataApiRequestInfo, queryExecutor) @@ -295,7 +297,7 @@ public void countWithDynamic() { .setDBFilters( List.of( new TextCollectionFilter("username", MapCollectionFilter.Operator.EQ, "user2"))); - CountOperation countOperation = new CountOperation(CONTEXT, implicitAnd, 100, 10); + CountOperation countOperation = new CountOperation(COLLECTION_CONTEXT, implicitAnd, 100, 10); Supplier execute = countOperation .execute(dataApiRequestInfo, queryExecutor) @@ -345,7 +347,7 @@ public void countWithDynamicNoMatch() { new TextCollectionFilter( "username", MapCollectionFilter.Operator.EQ, "user_all"))); - CountOperation countOperation = new CountOperation(CONTEXT, implicitAnd, 100, 10); + CountOperation countOperation = new CountOperation(COLLECTION_CONTEXT, implicitAnd, 100, 10); Supplier execute = countOperation .execute(dataApiRequestInfo, queryExecutor) @@ -384,7 +386,7 @@ public void error() { }); LogicalExpression implicitAnd = LogicalExpression.and(); - CountOperation countOperation = new CountOperation(CONTEXT, implicitAnd, 100, 10); + CountOperation countOperation = new CountOperation(COLLECTION_CONTEXT, implicitAnd, 100, 10); Throwable result = countOperation .execute(dataApiRequestInfo, queryExecutor) diff --git a/src/test/java/io/stargate/sgv2/jsonapi/service/operation/model/impl/CreateCollectionOperationTest.java b/src/test/java/io/stargate/sgv2/jsonapi/service/operation/model/impl/CreateCollectionOperationTest.java index df95052cb0..30e1183e09 100644 --- a/src/test/java/io/stargate/sgv2/jsonapi/service/operation/model/impl/CreateCollectionOperationTest.java +++ b/src/test/java/io/stargate/sgv2/jsonapi/service/operation/model/impl/CreateCollectionOperationTest.java @@ -103,7 +103,7 @@ public void createCollectionNoVector() { CreateCollectionOperation operation = CreateCollectionOperation.withoutVectorSearch( - COMMAND_CONTEXT, + KEYSPACE_CONTEXT, databaseLimitsConfig, objectMapper, sessionCache, @@ -161,7 +161,7 @@ public void createCollectionVector() { CreateCollectionOperation operation = CreateCollectionOperation.withVectorSearch( - COMMAND_CONTEXT, + KEYSPACE_CONTEXT, databaseLimitsConfig, objectMapper, sessionCache, @@ -221,7 +221,7 @@ public void denyAllCollectionNoVector() { CreateCollectionOperation operation = CreateCollectionOperation.withoutVectorSearch( - COMMAND_CONTEXT, + KEYSPACE_CONTEXT, databaseLimitsConfig, objectMapper, sessionCache, @@ -279,7 +279,7 @@ public void denyAllCollectionVector() { CreateCollectionOperation operation = CreateCollectionOperation.withVectorSearch( - COMMAND_CONTEXT, + KEYSPACE_CONTEXT, databaseLimitsConfig, objectMapper, sessionCache, @@ -364,7 +364,7 @@ public void indexAlreadyDropTable() { CreateCollectionOperation operation = CreateCollectionOperation.withoutVectorSearch( - COMMAND_CONTEXT, + KEYSPACE_CONTEXT, databaseLimitsConfig, objectMapper, sessionCache, diff --git a/src/test/java/io/stargate/sgv2/jsonapi/service/operation/model/impl/OperationTestBase.java b/src/test/java/io/stargate/sgv2/jsonapi/service/operation/model/impl/OperationTestBase.java index 9aa823bbfb..bd5dcdeabb 100644 --- a/src/test/java/io/stargate/sgv2/jsonapi/service/operation/model/impl/OperationTestBase.java +++ b/src/test/java/io/stargate/sgv2/jsonapi/service/operation/model/impl/OperationTestBase.java @@ -20,6 +20,7 @@ import io.stargate.sgv2.jsonapi.api.v1.metrics.JsonProcessingMetricsReporter; import io.stargate.sgv2.jsonapi.config.constants.DocumentConstants; import io.stargate.sgv2.jsonapi.service.cqldriver.executor.CollectionSchemaObject; +import io.stargate.sgv2.jsonapi.service.cqldriver.executor.KeyspaceSchemaObject; import io.stargate.sgv2.jsonapi.service.cqldriver.executor.SchemaObjectName; import io.stargate.sgv2.jsonapi.service.cqldriver.executor.VectorConfig; import io.stargate.sgv2.jsonapi.service.cqldriver.serializer.CQLBindValues; @@ -36,17 +37,24 @@ public class OperationTestBase { protected final String COLLECTION_NAME = RandomStringUtils.randomAlphanumeric(16); protected final SchemaObjectName SCHEMA_OBJECT_NAME = new SchemaObjectName(KEYSPACE_NAME, COLLECTION_NAME); + protected final CollectionSchemaObject COLLECTION_SCHEMA_OBJECT = new CollectionSchemaObject( SCHEMA_OBJECT_NAME, CollectionSchemaObject.IdConfig.defaultIdConfig(), VectorConfig.notEnabledVectorConfig(), null); + protected final KeyspaceSchemaObject KEYSPACE_SCHEMA_OBJECT = + KeyspaceSchemaObject.fromSchemaObject(COLLECTION_SCHEMA_OBJECT); + protected final String COMMAND_NAME = "testCommand"; - protected final CommandContext CONTEXT = + protected final CommandContext COLLECTION_CONTEXT = new CommandContext<>( COLLECTION_SCHEMA_OBJECT, null, COMMAND_NAME, jsonProcessingMetricsReporter); + protected final CommandContext KEYSPACE_CONTEXT = + new CommandContext<>( + KEYSPACE_SCHEMA_OBJECT, null, COMMAND_NAME, jsonProcessingMetricsReporter); @InjectMock protected DataApiRequestInfo dataApiRequestInfo;