// Path: src/main/com/quickserverlab/quickcached/cache/CacheException.java
// public class CacheException extends Exception {
// 	public CacheException() {
// 		super();
// 	}
// 	
// 	public CacheException(String msg) {
// 		super(msg);
// 	}
// }
// 
// Path: src/main/com/quickserverlab/quickcached/cache/CacheInterface.java
// public interface CacheInterface {
// 	
// 	public String getName();
// 	
// 	public void set(String key, Object value, int objectSize, int expInSec) throws CacheException;
// 	public void update(String key, Object value, int objectSize, int expInSec) throws CacheException;
// 	public void update(String key, Object value, int objectSize) throws CacheException;	
// 	
// 	public boolean touch(String key, int expInSec) throws CacheException;	
// 	
// 	public Object get(String key, boolean incrementCount) throws CacheException;
// 	public Object get(String key) throws CacheException;		
// 	public boolean delete(String key) throws CacheException;	
// 
// 	public void flush() throws CacheException;
// 
// 	/**
// 	 *
// 	 * @return Map with key as curr_items, total_items, cmd_get, cmd_set,
// 	 *  get_hits, get_misses, delete_misses, delete_hits, evictions, expired
// 	 */
// 	public void saveStats(Map map);
// 	
// 	public boolean saveToDisk();
// 	
// 	public boolean readFromDisk();
// }


import java.io.IOException;
import java.net.SocketTimeoutException;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.quickserverlab.quickcached.cache.CacheException;
import com.quickserverlab.quickcached.cache.CacheInterface;
import org.quickserver.net.server.ClientHandler;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
		if (cmd.equals("incr")) {
			CommandHandler.incrHits++;
		} else if (cmd.equals("decr")) {
			CommandHandler.decrHits++;
		}

		if (noreplay) {
			return;
		}
		
		sb.append("\r\n");
		sendResponse(handler, sb.toString());
	}

	private void handleStorageCommands(ClientHandler handler, String command)
			throws SocketTimeoutException, IOException {
		Data data = (Data) handler.getClientData();
		/*
		<command name> <key> <flags> <exptime> <bytes> [noreply]\r\n
		cas <key> <flags> <exptime> <bytes> <cas unique> [noreply]\r\n
		 */
		String cmdData[] = command.split(" ");

		String cmd = cmdData[0];
		String key = cmdData[1];
		String flags = cmdData[2];
		int exptime = Integer.parseInt(cmdData[3]);
		long bytes = Integer.parseInt(cmdData[4]);
		String casunique = null;

// Path: src/main/com/quickserverlab/quickcached/cache/CacheException.java
// public class CacheException extends Exception {
// 	public CacheException() {
// 		super();
// 	}
// 	
// 	public CacheException(String msg) {
// 		super(msg);
// 	}
// }
// 
// Path: src/main/com/quickserverlab/quickcached/cache/CacheInterface.java
// public interface CacheInterface {
// 	
// 	public String getName();
// 	
// 	public void set(String key, Object value, int objectSize, int expInSec) throws CacheException;
// 	public void update(String key, Object value, int objectSize, int expInSec) throws CacheException;
// 	public void update(String key, Object value, int objectSize) throws CacheException;	
// 	
// 	public boolean touch(String key, int expInSec) throws CacheException;	
// 	
// 	public Object get(String key, boolean incrementCount) throws CacheException;
// 	public Object get(String key) throws CacheException;		
// 	public boolean delete(String key) throws CacheException;	
// 
// 	public void flush() throws CacheException;
// 
// 	/**
// 	 *
// 	 * @return Map with key as curr_items, total_items, cmd_get, cmd_set,
// 	 *  get_hits, get_misses, delete_misses, delete_hits, evictions, expired
// 	 */
// 	public void saveStats(Map map);
// 	
// 	public boolean saveToDisk();
// 	
// 	public boolean readFromDisk();
// }


// Path: src/main/com/quickserverlab/quickcached/TextCommandProcessor.java
import java.io.IOException;
import java.net.SocketTimeoutException;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.quickserverlab.quickcached.cache.CacheException;
import com.quickserverlab.quickcached.cache.CacheInterface;
import org.quickserver.net.server.ClientHandler;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

		if (cmd.equals("incr")) {
			CommandHandler.incrHits++;
		} else if (cmd.equals("decr")) {
			CommandHandler.decrHits++;
		}

		if (noreplay) {
			return;
		}
		
		sb.append("\r\n");
		sendResponse(handler, sb.toString());
	}

	private void handleStorageCommands(ClientHandler handler, String command)
			throws SocketTimeoutException, IOException {
		Data data = (Data) handler.getClientData();
		/*
		<command name> <key> <flags> <exptime> <bytes> [noreply]\r\n
		cas <key> <flags> <exptime> <bytes> <cas unique> [noreply]\r\n
		 */
		String cmdData[] = command.split(" ");

		String cmd = cmdData[0];
		String key = cmdData[1];
		String flags = cmdData[2];
		int exptime = Integer.parseInt(cmdData[3]);
		long bytes = Integer.parseInt(cmdData[4]);
		String casunique = null;

		boolean noreplay = false;