// Path: src/main/java/com/wizecommerce/hecuba/util/ClientManagerUtils.java
// public class ClientManagerUtils {
// 	private static final ClientManagerUtils instance = new ClientManagerUtils();
// 
// 	private ClientManagerUtils() {
// 	}
// 
// 	public static ClientManagerUtils getInstance() {
// 		return instance;
// 	}
// 
// 	public String convertValueForStorage(Object input) {
// 		if (input == null) {
// 			return "null";
// 		}
// 
// 		if (input instanceof Date) {
// 			return HecubaConstants.DATE_FORMATTER.print(((Date) input).getTime());
// 		}
// 
// 		return input.toString();
// 	}
// }
// 
// Path: src/main/java/com/wizecommerce/hecuba/util/ConfigUtils.java
// public class ConfigUtils {
// 	private static ConfigUtils ourInstance = new ConfigUtils();
// 
// 	private static Configuration mainConfiguration = new CompositeConfiguration();
// 
// 	public static ConfigUtils getInstance() {
// 		return ourInstance;
// 	}
// 
// 	public static ConfigUtils getInstance(Configuration configuration) {
// 		mainConfiguration = configuration;
// 		return ourInstance;
// 	}
// 
// 	private ConfigUtils() {
// 	}
// 
// 	public Configuration getConfiguration() {
// 		return mainConfiguration;
// 	}
// }


import java.nio.ByteBuffer;
import java.util.*;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.configuration.Configuration;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.math.NumberUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.joda.time.format.DateTimeFormatter;
import org.joda.time.format.ISODateTimeFormat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.datastax.driver.core.*;
import com.datastax.driver.core.Cluster.Builder;
import com.datastax.driver.core.DataType.Name;
import com.datastax.driver.core.ProtocolOptions.Compression;
import com.datastax.driver.core.policies.*;
import com.google.common.base.Splitter;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Iterables;
import com.wizecommerce.hecuba.*;
import com.wizecommerce.hecuba.util.ClientManagerUtils;
import com.wizecommerce.hecuba.util.ConfigUtils;
		KeyspaceMetadata keyspaceMetadata = cluster.getMetadata().getKeyspace(keyspace);
		TableMetadata tableMetadata = keyspaceMetadata.getTable(columnFamily);

		if (tableMetadata == null) {
			return null;
		}

		for (String key : new String[] { "\"KEY\"", "key" }) {
			if (tableMetadata.getColumn(key) != null) {
				return key;
			}
		}

		return null;
	}

	private ConsistencyLevel getConsistencyLevel(CassandraParamsBean parameters, String operation) {
		Configuration configuration = ConfigUtils.getInstance().getConfiguration();

		String consistencyLevel = "ONE";
		String[] consistencyPolicyProperties = HecubaConstants.getConsistencyPolicyProperties(parameters.getColumnFamily(), operation);

		for (String property : consistencyPolicyProperties) {
			consistencyLevel = configuration.getString(property, consistencyLevel);
		}

		return ConsistencyLevel.valueOf(consistencyLevel);
	}

	private String getSecondaryIndexColumnFamily(CassandraParamsBean parameters) {
// Path: src/main/java/com/wizecommerce/hecuba/util/ClientManagerUtils.java
// public class ClientManagerUtils {
// 	private static final ClientManagerUtils instance = new ClientManagerUtils();
// 
// 	private ClientManagerUtils() {
// 	}
// 
// 	public static ClientManagerUtils getInstance() {
// 		return instance;
// 	}
// 
// 	public String convertValueForStorage(Object input) {
// 		if (input == null) {
// 			return "null";
// 		}
// 
// 		if (input instanceof Date) {
// 			return HecubaConstants.DATE_FORMATTER.print(((Date) input).getTime());
// 		}
// 
// 		return input.toString();
// 	}
// }
// 
// Path: src/main/java/com/wizecommerce/hecuba/util/ConfigUtils.java
// public class ConfigUtils {
// 	private static ConfigUtils ourInstance = new ConfigUtils();
// 
// 	private static Configuration mainConfiguration = new CompositeConfiguration();
// 
// 	public static ConfigUtils getInstance() {
// 		return ourInstance;
// 	}
// 
// 	public static ConfigUtils getInstance(Configuration configuration) {
// 		mainConfiguration = configuration;
// 		return ourInstance;
// 	}
// 
// 	private ConfigUtils() {
// 	}
// 
// 	public Configuration getConfiguration() {
// 		return mainConfiguration;
// 	}
// }


// Path: src/main/java/com/wizecommerce/hecuba/datastax/DataStaxBasedHecubaClientManager.java
import java.nio.ByteBuffer;
import java.util.*;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.configuration.Configuration;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.math.NumberUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.joda.time.format.DateTimeFormatter;
import org.joda.time.format.ISODateTimeFormat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.datastax.driver.core.*;
import com.datastax.driver.core.Cluster.Builder;
import com.datastax.driver.core.DataType.Name;
import com.datastax.driver.core.ProtocolOptions.Compression;
import com.datastax.driver.core.policies.*;
import com.google.common.base.Splitter;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Iterables;
import com.wizecommerce.hecuba.*;
import com.wizecommerce.hecuba.util.ClientManagerUtils;
import com.wizecommerce.hecuba.util.ConfigUtils;

		KeyspaceMetadata keyspaceMetadata = cluster.getMetadata().getKeyspace(keyspace);
		TableMetadata tableMetadata = keyspaceMetadata.getTable(columnFamily);

		if (tableMetadata == null) {
			return null;
		}

		for (String key : new String[] { "\"KEY\"", "key" }) {
			if (tableMetadata.getColumn(key) != null) {
				return key;
			}
		}

		return null;
	}

	private ConsistencyLevel getConsistencyLevel(CassandraParamsBean parameters, String operation) {
		Configuration configuration = ConfigUtils.getInstance().getConfiguration();

		String consistencyLevel = "ONE";
		String[] consistencyPolicyProperties = HecubaConstants.getConsistencyPolicyProperties(parameters.getColumnFamily(), operation);

		for (String property : consistencyPolicyProperties) {
			consistencyLevel = configuration.getString(property, consistencyLevel);
		}

		return ConsistencyLevel.valueOf(consistencyLevel);
	}

	private String getSecondaryIndexColumnFamily(CassandraParamsBean parameters) {
		Configuration configuration = ConfigUtils.getInstance().getConfiguration();