Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
DuibaTestToolV2.1
Project
Project
Details
Activity
Releases
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
赵然
DuibaTestToolV2.1
Commits
16762587
Commit
16762587
authored
Jan 24, 2019
by
赵然
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zr
parent
07a27783
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
8 deletions
+19
-8
HbaseService.java
src/main/com/atguigu/springmvc/common/HbaseService.java
+8
-2
HbaseModule.java
src/main/com/atguigu/springmvc/handlers/HbaseModule.java
+11
-6
No files found.
src/main/com/atguigu/springmvc/common/HbaseService.java
View file @
16762587
...
@@ -27,7 +27,7 @@ public class HbaseService {
...
@@ -27,7 +27,7 @@ public class HbaseService {
private
static
String
activtyHost
=
"http://activity.m.duibatest.com.cn"
;
private
static
String
activtyHost
=
"http://activity.m.duibatest.com.cn"
;
public
static
Response
getHBASEKey
(
String
key
,
String
reverse
)
{
public
static
Response
getHBASEKey
(
String
key
,
String
reverse
,
String
hashkey
)
{
String
url
=
activtyHost
+
"/aaw/hb/get"
;
String
url
=
activtyHost
+
"/aaw/hb/get"
;
...
@@ -38,12 +38,15 @@ public class HbaseService {
...
@@ -38,12 +38,15 @@ public class HbaseService {
}
else
{
}
else
{
parm
.
put
(
"reverse"
,
reverse
);
parm
.
put
(
"reverse"
,
reverse
);
}
}
if
(
hashkey
.
equals
(
"2"
)){
parm
.
put
(
"hashkey"
,
hashkey
);
}
Response
response
=
given
().
params
(
parm
).
get
(
url
);
Response
response
=
given
().
params
(
parm
).
get
(
url
);
return
response
;
return
response
;
}
}
public
static
Response
reset
(
String
key
,
String
lvalue
,
String
reverse
)
{
public
static
Response
reset
(
String
key
,
String
lvalue
,
String
reverse
,
String
hashkey
)
{
String
url
=
activtyHost
+
"/aaw/hb/reset/lvalue"
;
String
url
=
activtyHost
+
"/aaw/hb/reset/lvalue"
;
...
@@ -55,6 +58,9 @@ public class HbaseService {
...
@@ -55,6 +58,9 @@ public class HbaseService {
}
else
{
}
else
{
parm
.
put
(
"reverse"
,
reverse
);
parm
.
put
(
"reverse"
,
reverse
);
}
}
if
(
hashkey
.
equals
(
"2"
)){
parm
.
put
(
"hashkey"
,
hashkey
);
}
Response
response
=
given
().
params
(
parm
).
get
(
url
);
Response
response
=
given
().
params
(
parm
).
get
(
url
);
return
response
;
return
response
;
}
}
...
...
src/main/com/atguigu/springmvc/handlers/HbaseModule.java
View file @
16762587
...
@@ -23,26 +23,31 @@ public class HbaseModule {
...
@@ -23,26 +23,31 @@ public class HbaseModule {
@ResponseBody
@ResponseBody
public
Map
urlLink
(
HttpServletRequest
request
)
throws
Exception
{
public
Map
urlLink
(
HttpServletRequest
request
)
throws
Exception
{
String
select
=
request
.
getParameter
(
"select"
);
String
select
=
request
.
getParameter
(
"select"
);
String
reverse
=
request
.
getParameter
(
"reverse"
);
String
reverse
=
request
.
getParameter
(
"reverse"
);
if
(
reverse
.
equals
(
null
)
||
reverse
.
equals
(
""
)
||
reverse
.
isEmpty
()){
String
hashkey
=
request
.
getParameter
(
"hashkey"
);
reverse
=
"false"
;
}
// if(reverse.equals(null) || reverse.equals("") || reverse.isEmpty()){
// reverse = "false";
// }
// if(hashkey.equals(null) || hashkey.equals("") || hashkey.isEmpty()){
// hashkey = "false";
// }
String
key
=
request
.
getParameter
(
"key"
);
String
key
=
request
.
getParameter
(
"key"
);
String
value
=
request
.
getParameter
(
"value"
);
String
value
=
request
.
getParameter
(
"value"
);
System
.
out
.
println
(
"select为:"
+
select
);
System
.
out
.
println
(
"select为:"
+
select
);
System
.
out
.
println
(
"reverse为:"
+
reverse
);
System
.
out
.
println
(
"reverse为:"
+
reverse
);
System
.
out
.
println
(
"hashkey为:"
+
hashkey
);
System
.
out
.
println
(
"key为:"
+
key
);
System
.
out
.
println
(
"key为:"
+
key
);
System
.
out
.
println
(
"value为:"
+
value
);
System
.
out
.
println
(
"value为:"
+
value
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
if
(
select
.
equals
(
"search"
)){
if
(
select
.
equals
(
"search"
)){
Response
response
=
HbaseService
.
getHBASEKey
(
key
,
reverse
);
Response
response
=
HbaseService
.
getHBASEKey
(
key
,
reverse
,
hashkey
);
map
.
put
(
"message"
,
response
.
asString
());
map
.
put
(
"message"
,
response
.
asString
());
}
}
if
(
select
.
equals
(
"reset"
)){
if
(
select
.
equals
(
"reset"
)){
Response
response
=
HbaseService
.
reset
(
key
,
value
,
reverse
);
Response
response
=
HbaseService
.
reset
(
key
,
value
,
reverse
,
hashkey
);
map
.
put
(
"message"
,
response
.
asString
());
map
.
put
(
"message"
,
response
.
asString
());
}
}
return
map
;
return
map
;
...
...
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