public void recoveryFromLog(String logPath)
            throws IOException{
        File file = new File(logPath);
        if(file.exists()){
            BufferedReader reader = new BufferedReader(new FileReader(file));
            String line = null;
            ObjectMapper mapper = new ObjectMapper();
            while((line = reader.readLine()) != null){
                EditOperation operation = mapper.readValue(line, EditOperation.class);
                Object[] arguments = operation.getArguments();
                switch(operation.getType()){
                    case EditOperation.UPDATE_DATA_NODE:
                        updateDataNode((String)arguments[0], (String)arguments[1], (Integer)arguments[2],
                                       (Integer)arguments[3], System.currentTimeMillis(), false);
                        break;
                    case EditOperation.REMOVE_DATA_NODE:
                        removeDataNode((String)arguments[0], false);
                    case EditOperation.DFS_CREATE_FILE:
                        createFile((String)arguments[0], (Integer)arguments[1], false);
                        break;
                    case EditOperation.DFS_DELETE_FILE:
                        deleteFile(Long.parseLong(arguments[0].toString()), false);
                        break;
                    case EditOperation.DFS_CREATE_CHUNK:
                        createChunk(Long.parseLong(arguments[0].toString()), Long.parseLong(arguments[1].toString()),
                                    (Integer)arguments[2], false);
                        break;
                    default:
                        break;
                }
            }
            reader.close();
        }
    }