Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
searchhotcrawler
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhiwei
searchhotcrawler
Commits
0c026d84
Commit
0c026d84
authored
Mar 18, 2019
by
[zhangzhiwei]
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加分库操作
parent
267df575
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
7 deletions
+16
-7
src/main/java/com/zhiwei/searchhotcrawler/dao/WeiboHotSearchDAO.java
+10
-1
src/main/java/com/zhiwei/searchhotcrawler/run/HotSearchRun.java
+4
-4
src/main/resources/db.properties
+2
-2
No files found.
src/main/java/com/zhiwei/searchhotcrawler/dao/WeiboHotSearchDAO.java
View file @
0c026d84
...
...
@@ -2,6 +2,7 @@ package com.zhiwei.searchhotcrawler.dao;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -12,6 +13,7 @@ import com.zhiwei.searchhotcrawler.bean.WeiboHotSearch;
import
com.zhiwei.searchhotcrawler.cache.CacheManager
;
import
com.zhiwei.searchhotcrawler.config.Config
;
import
com.zhiwei.searchhotcrawler.dbtemplate.MongoDBTemplate
;
import
com.zhiwei.tools.timeparse.TimeParse
;
import
com.zhiwei.tools.tools.ZhiWeiTools
;
public
class
WeiboHotSearchDAO
extends
MongoDBTemplate
{
...
...
@@ -19,10 +21,17 @@ public class WeiboHotSearchDAO extends MongoDBTemplate{
public
WeiboHotSearchDAO
()
{
super
();
super
.
setDbName
(
Config
.
dbName
);
// Date date = new Date();
// String time = TimeParse.dateFormartString(date, "yyyy");
// if(Calendar.MONTH<6){
// collWeiboName = Config.collWeiboName + time+"_01";
// }else{
// collWeiboName = Config.collWeiboName + time+"_06";
// }
// System.out.println("collWeiboName========="+collWeiboName);
super
.
setCollName
(
Config
.
collWeiboName
);
}
/**
* @Title: addWeiboHotSearch
* @author hero
...
...
src/main/java/com/zhiwei/searchhotcrawler/run/HotSearchRun.java
View file @
0c026d84
...
...
@@ -23,15 +23,15 @@ public class HotSearchRun {
public
void
showTimer
()
{
scheduExec
.
scheduleAtFixedRate
(
new
WeiboHotSearchRun
(),
0
,
1
,
TimeUnit
.
MINUTES
);
scheduExec
.
scheduleAtFixedRate
(
new
ZhihuHotSearchRun
(),
0
,
1
,
TimeUnit
.
MINUTES
);
//
scheduExec.scheduleAtFixedRate(new ZhihuHotSearchRun(), 0, 1 , TimeUnit.MINUTES);
}
public
static
void
main
(
String
[]
args
)
{
new
UpdateWechatUserRun
().
start
();
ZhiWeiTools
.
sleep
(
10000
);
new
HotSearchRun
().
showTimer
();
new
CacheListener
().
startListen
();
new
SendWeiboHotSearchRun
().
start
();
new
SendZhihuHotSearchRun
().
start
();
//
new CacheListener().startListen();
//
new SendWeiboHotSearchRun().start();
//
new SendZhihuHotSearchRun().start();
}
}
src/main/resources/db.properties
View file @
0c026d84
mongoIp
=
202.107.192.94
#
mongoIp=192.168.0.101
#
mongoIp=202.107.192.94
mongoIp
=
192.168.0.101
mongoPort
=
30000
db.username
=
zzwno
db.paasword
=
zzwno1q2w3e4r
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment