public List<ClientProtos.WriteResultProto> execInsertPlan(InsertPlan plan)
throws ServiceException {
List<ClientProtos.WriteResultProto> writeResultProtos = new ArrayList<ClientProtos.WriteResultProto>();
List<InsertAction> actions = plan.getActions();
InsertAction action = actions.get(0);
EntityGroupInfo entityGroupInfo = action.getEntityGroupLocation()
.getEntityGroupInfo();
ServerName serverName = new ServerName(action.getEntityGroupLocation()
.getHostname(), action.getEntityGroupLocation().getPort(),
ServerName.NON_STARTCODE);
// if actions > 1. will commit by 2pc
if (actions.size() == 1) {
try {
if (workingOnLocalServer(server, serverName)) {
ClientProtos.InsertResponse response = server.insert(
entityGroupInfo.getEntityGroupName(), action);
writeResultProtos.add(response.getResult());
} else {
ClientProtocol clientProtocol = connection.getClient(
serverName.getHostname(), serverName.getPort());
ClientProtos.InsertResponse response = clientProtocol.insert(null,