@Override
        public void run() {
        	KVMessage req = null;
            KVMessage resp = null;
            
            try {
            	req = new KVMessage(client);
            	if (req.getMsgType().equals(KVConstants.PUT_REQ)) {
            		tpcMaster.handleTPCRequest(req , true);
            		resp = new KVMessage(KVConstants.RESP , KVConstants.SUCCESS);
            	}
            	else if (req.getMsgType().equals(KVConstants.GET_REQ)) {
            		String value = tpcMaster.handleGet(req);
            		resp = new KVMessage(KVConstants.RESP);
            		resp.setKey(req.getKey());
            		resp.setValue(value);
            	}
            	else if (req.getMsgType().equals(KVConstants.DEL_REQ)) {
            		tpcMaster.handleTPCRequest(req , false);
            		resp = new KVMessage(KVConstants.RESP , KVConstants.SUCCESS);
            	}
            }
            catch (KVException ex) {
            	resp = ex.getKVMessage();
            }
            
            if (resp != null) {
            	try {
            		resp.sendMessage(client);
            	}
            	catch (KVException ex) {
            	}
            }
        }