Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Y
YCSB
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Adnan Ahmad
YCSB
Commits
79bb3819
Commit
79bb3819
authored
9 years ago
by
Connor McCoy
Browse files
Options
Downloads
Plain Diff
Merge pull request #526 from cmccoy/err-no-java
[scripts] Improve errors in bin/ycsb
parents
454f88f8
13176e3c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/ycsb
+26
-9
26 additions, 9 deletions
bin/ycsb
with
26 additions
and
9 deletions
bin/ycsb
+
26
−
9
View file @
79bb3819
...
...
@@ -16,13 +16,18 @@
# LICENSE file.
#
import
argparse
import
errno
import
fnmatch
import
io
import
os
import
shlex
import
sys
import
subprocess
try
:
import
argparse
except
ImportError
:
print
>>
sys
.
stderr
,
'
[ERROR] argparse not found. Try installing it via
"
pip
"
.
'
raise
BASE_URL
=
"
https://github.com/brianfrankcooper/YCSB/tree/master/
"
COMMANDS
=
{
...
...
@@ -111,6 +116,13 @@ def usage():
return
output
.
getvalue
()
def
check_output
(
cmd
):
p
=
subprocess
.
Popen
(
cmd
,
stdout
=
subprocess
.
PIPE
)
stdout
,
_
=
p
.
communicate
()
if
p
.
returncode
:
raise
subprocess
.
CalledProcessError
(
p
.
returncode
,
cmd
)
return
stdout
def
debug
(
message
):
print
>>
sys
.
stderr
,
"
[DEBUG]
"
,
message
...
...
@@ -127,7 +139,6 @@ def find_jars(dir, glob='*.jar'):
jars
.
append
(
os
.
path
.
join
(
dirpath
,
filename
))
return
jars
def
get_ycsb_home
():
dir
=
os
.
path
.
abspath
(
os
.
path
.
dirname
(
sys
.
argv
[
0
]))
while
"
LICENSE.txt
"
not
in
os
.
listdir
(
dir
):
...
...
@@ -147,11 +158,11 @@ def get_classpath_from_maven(module):
try
:
debug
(
"
Running
'
mvn -pl com.yahoo.ycsb:
"
+
module
+
"
-am package -DskipTests
"
"
dependency:build-classpath -DincludeScope=compile -Dmdep.outputFilterFile=true
'"
)
mvn_output
=
subprocess
.
check_output
([
"
mvn
"
,
"
-pl
"
,
"
com.yahoo.ycsb:
"
+
module
,
"
-am
"
,
"
package
"
,
"
-DskipTests
"
,
"
dependency:build-classpath
"
,
"
-DincludeScope=compile
"
,
"
-Dmdep.outputFilterFile=true
"
])
mvn_output
=
check_output
([
"
mvn
"
,
"
-pl
"
,
"
com.yahoo.ycsb:
"
+
module
,
"
-am
"
,
"
package
"
,
"
-DskipTests
"
,
"
dependency:build-classpath
"
,
"
-DincludeScope=compile
"
,
"
-Dmdep.outputFilterFile=true
"
])
# the above outputs a "classpath=/path/tojar:/path/to/other/jar" for each module
# the last module will be the datastore binding
line
=
[
x
for
x
in
mvn_output
.
splitlines
()
if
x
.
startswith
(
"
classpath=
"
)][
-
1
:]
...
...
@@ -226,8 +237,14 @@ def main():
if
command
:
ycsb_command
.
append
(
command
)
print
>>
sys
.
stderr
,
"
"
.
join
(
ycsb_command
)
return
subprocess
.
call
(
ycsb_command
)
try
:
return
subprocess
.
call
(
ycsb_command
)
except
OSError
as
e
:
if
e
.
errno
==
errno
.
ENOENT
:
error
(
'
Command failed. Is java installed and on your PATH?
'
)
return
1
else
:
raise
if
__name__
==
'
__main__
'
:
sys
.
exit
(
main
())
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment