public void fetchAll() throws Exception {

        running = true;
        lastRequestStart = new AtomicLong(System.currentTimeMillis());

        activeThreads = new AtomicInteger(0);
        spinWaiting = new AtomicInteger(0);
        fetchQueue = new FetchQueue();
        configQueue = new ConfigQueue();

        ArrayList<String> weiboUid=ConfigReader.readWeiboID();
        for (String uid : weiboUid) {
            CrawlDatum crawldatum = new CrawlDatum();
            crawldatum.setUrl("http://weibo.cn/u/" + uid + "?page=1");
            crawldatum.setFetchTime(CrawlDatum.FETCHTIME_UNDEFINED);
            crawldatum.setStatus(CrawlDatum.STATUS_DB_UNFETCHED);
            fetchQueue.add(crawldatum);
        }

        for (int i = 0; i < Config.CRAWLER_THREAD; i++) {
            ThreadConfig threadConfig = new ThreadConfig();
            threadConfig.setUsername(Config.WEIBO_USERNAME[i]);
            threadConfig.setPassword(Config.WEIBO_PASSWD[i]);
            String proxy[]=Config.PROXY[i].split(":");
            Proxy threadProxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxy[0], Integer.valueOf(proxy[1])));
            threadConfig.setProxy(threadProxy);
            configQueue.add(threadConfig);
        }

        for (int i = 0; i < Config.CRAWLER_THREAD; i++) {
            FetcherThread fetcherThread = new FetcherThread();
            fetcherThread.start();
        }

        do {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException ex) {
            }
            LogUtils.getLogger().info("-activeThreads=" + activeThreads.get() + ", spinWaiting=" + spinWaiting.get()
                                              + ", fetchQueue.size=" + fetchQueue.getSize());

            if (fetchQueue.getSize() < 5) {
                fetchQueue.dump();
            }

            if ((System.currentTimeMillis() - lastRequestStart.get()) > Config.roundRequestInterval) {
                LogUtils.getLogger().info("Aborting with " + activeThreads + " hung threads.");
                return;
            }

        } while (activeThreads.get() > 0 && running);

        running = false;
        fetchQueue.clear();

    }