<commit_before>package org.apache.cassandra.http;

import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;

import org.apache.cassandra.http.ext.PATCH;
import org.apache.cassandra.thrift.ConsistencyLevel;
import org.json.simple.JSONObject;
import org.json.simple.JSONValue;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Path("/virgil/")
public class CassandraRestService {
	private static Logger logger = LoggerFactory.getLogger(CassandraRestService.class);
	private CassandraStorage cassandraStorage = null;

	public CassandraRestService(CassandraStorage cassandraStorage) {
		this.cassandraStorage = cassandraStorage;
	}

	// ================================================================================================================
	// Key Space Operations
	// ================================================================================================================
	@GET
	@Path("/data/")
	@Produces({ "application/json" })
	public String getKeyspaces(@PathParam("keyspace") String keyspace) throws Exception {
		if (logger.isDebugEnabled())
			logger.debug("Listing keyspaces.");
		return cassandraStorage.getKeyspaces();
	}
<commit_msg>Added health check url. Fix for Issue 9.<commit_after>package org.apache.cassandra.http;

import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;

import org.apache.cassandra.http.ext.PATCH;
import org.apache.cassandra.thrift.ConsistencyLevel;
import org.json.simple.JSONObject;
import org.json.simple.JSONValue;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Path("/virgil/")
public class CassandraRestService {
	private static Logger logger = LoggerFactory.getLogger(CassandraRestService.class);
	private CassandraStorage cassandraStorage = null;

	public CassandraRestService(CassandraStorage cassandraStorage) {
		this.cassandraStorage = cassandraStorage;
	}

	// ================================================================================================================
	// Key Space Operations
	// ================================================================================================================
	@GET
	@Path("/ping")
	@Produces({ "text/plain" })
	public String healthCheck() throws Exception {
		if (logger.isDebugEnabled())
			logger.debug("Ping.");
		cassandraStorage.setKeyspace("system");
		cassandraStorage.getSlice("system", "Versions", "build", ConsistencyLevel.ONE);
		return "OK";
	}
	
	// ================================================================================================================
	// Key Space Operations
	// ================================================================================================================
	@GET
	@Path("/data/")
	@Produces({ "application/json" })
	public String getKeyspaces(@PathParam("keyspace") String keyspace) throws Exception {
		if (logger.isDebugEnabled())
			logger.debug("Listing keyspaces.");
		return cassandraStorage.getKeyspaces();
	}

{'fraction_non_alphanumeric': 0.31159874608150473, 'fraction_numerical': 0.001567398119122257, 'mean_word_length': 6.801955990220049, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5395947', 'n_tokens_mistral': 906, 'n_tokens_neox': 833, 'n_words': 161}