mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2024-11-25 18:20:33 -06:00
add cql workload generator endpoint
This commit is contained in:
parent
2694af32c8
commit
b15ddd6709
@ -0,0 +1,28 @@
|
||||
package io.nosqlbench.activitytype.cql.endpoints;
|
||||
|
||||
import io.nosqlbench.generators.cql.lang.CqlWorkloadGen;
|
||||
import io.nosqlbench.docsys.api.WebServiceObject;
|
||||
import io.nosqlbench.nb.annotations.Service;
|
||||
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.Response;
|
||||
|
||||
@Service(WebServiceObject.class)
|
||||
@Path("/services/cql/")
|
||||
public class CqlWorkloadGeneratorEndpoint implements WebServiceObject {
|
||||
|
||||
@POST
|
||||
@Path("generate")
|
||||
public Response generate(String cqlSchema) {
|
||||
try {
|
||||
CqlWorkloadGen generator = new CqlWorkloadGen();
|
||||
String generated = generator.generate(cqlSchema);
|
||||
return Response.ok(generated).type(MediaType.TEXT_PLAIN).build();
|
||||
} catch (Exception e) {
|
||||
return Response.serverError().entity(e).build();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package io.nosqlbench.generators.cql.lang;
|
||||
|
||||
public class CqlWorkloadGen {
|
||||
|
||||
public String generate(String cqlSchema) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user