public static void main(String[] args) throws IOException { String url = "http://politics.people.com.cn/n/2014/0801/c1024-25380603.html"; hiveRedis redis = new hiveRedis("Junco"); hiveVertical hv = new hiveVertical(); hiveBloomFilter filter = new hiveBloomFilter(); redis.connectRedis(); redis.putURL(url); while (redis.getLength() != 0) { Document doc = hv.getText(url); hv.saveText2File(doc); hv.getAllURL(doc, hv.getHost(url), redis, filter); redis.remove(url); url = redis.getURL(); if (url == null) { System.out.println("Done"); break; } } redis.destory(); System.gc(); }