@Override
    public void removeFile(String fileName) throws RemoteException
    {
        HDFSFile file = this.fileList.get(fileName);
        if (file == null) {
            System.out.println("[Error**] " + fileName + "not found");
            return;
        }
   		
        ConcurrentHashMap<Integer, HDFSChunk> chunkTable = file.getChunkTable();
        for (Entry<Integer, HDFSChunk> row : chunkTable.entrySet()) {
            HDFSChunk chunk = row.getValue();
            try {
                file.removeChunk(chunk.getChunkNum());
                FileIO.deleteFile(this.dataNodePath + chunk.getChunkName());
            }
            catch (IOException e) {
                e.printStackTrace();
                System.out.println("[Error**] Cannot remove " + chunk.getChunkName());
                return;
            }
        }
        
        this.fileList.remove(fileName);
        System.out.println("[LOG] " + fileName + " successfully deleted");
        
        // TODO: remove replicas in other dataNodes?
        return;
    }