New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHOENIX-4817 Fixed Phoenix Tracing Web Application #311
Conversation
…name, webapp path, column names). Fixed traceserver.py
Fixed Phoenix Tracing Web Application, fixed traceserver.py |
@@ -116,8 +116,10 @@ | |||
|
|||
# " -Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n " + \ | |||
# " -XX:+UnlockCommercialFeatures -XX:+FlightRecorder -XX:FlightRecorderOptions=defaultrecording=true,dumponexit=true" + \ | |||
java_cmd = '%(java)s $PHOENIX_OPTS ' + \ | |||
'-cp ' + hbase_config_path + os.pathsep + phoenix_utils.phoenix_traceserver_jar + os.pathsep + phoenix_utils.phoenix_client_jar + \ | |||
java_cmd = '%(java)s ' + \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like $PHOENIX_OPTS
was dropped. Was this not being interpolated correctly? Is this environment variable propagated into the traceserver java process?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://issues.apache.org/jira/browse/PHOENIX-2659
I think it's your comment:
"Josh Elser added a comment - 12/Feb/16 03:23
ok, PHOENIX_OPTS isn't working because subprocess isn't popping a shell like sqlline does. It will automatically get added to PQS's environment already. We can just remove that.
Steve is spot-on for the argument parsing. It's just busted."
So, I just remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All in all, when I remove it, the server successfully starts and works correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is that subprocess doesn't handle shell variable expansion "in the command". Subprocess has API to provide an environment to the process being run.
$PHOENIX_OPTS
and $PHOENIX_TRACESERVER_OPTS
should be placed into the subprocess's environment, not just dropped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do I need to add something like this?
phoenix_opts= os.getenv('PHOENIX_OPTS', '')
......
if hbase_env.has_key('PHOENIX_OPTS'):
phoenix_opts= hbase_env['PHOENIX_OPTS']
.....
java_cmd = '%(java)s ' + phoenix_opts +
....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, looks like queryserver.py doesn't include $PHOENIX_OPTS
so let's just leave that to clients. $PHOENIX_TRACESERVER_OPTS
is inlined, so you're good. Sorry for the confusion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thank you
ProtectionDomain domain = Main.class.getProtectionDomain(); | ||
URL location = domain.getCodeSource().getLocation(); | ||
String webappDirLocation = location.toString().split("target")[0] +"src/main/webapp"; | ||
String webappDirLocation = DEFAULT_WEBAPP_DIR_LOCATION; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest dropping webappDirLocation
and just using DEFAULT_WEBAPP_DIR_LOCATION
since this is not configurable anyways.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
|
||
@Override | ||
public void init() { | ||
org.apache.hadoop.conf.Configuration conf = HBaseConfiguration.create(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import org.apache.hadoop.conf.Configuration
please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
} | ||
if(!logic.equals(LOGIC_AND) || !logic.equals(LOGIC_OR)) { | ||
throw new RuntimeException("Wrong logical operator passed to the query. Only "+ LOGIC_AND+","+LOGIC_OR+" are allowed.") ; | ||
if (logic != null && (!logic.equals(LOGIC_AND) && !logic.equals(LOGIC_OR))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parenthesis around (!logic.equals(LOGIC_AND) && !logic.equals(LOGIC_OR))
are unnecessary, please drop them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
traceserver.py start NO JSP Support for /, did not find org.apache.jasper.servlet.JspServlet |
It's ok, just info message, try to open localhost:8864 |
Tracing List is ok but Trace Count Chart Graph |
Can you show me your trace table? Column “description” is standard column of this table, if you start tracing via hbase-site.xml |
You use version from apache phoenix, I fixed this bug and some others, just compile my sources |
apache-phoenix-4.11.0-HBase-1.1-bin 、hadoop-2.7.1 |
It's ok, clone my branch and compile only web application, then rename jars for your version, then replace it with web application phoenix jars |
Thank you very much for the problem. |
You use version from apache phoenix 、hbase 、hadoop |
Yes |
I have a problem that the data does not into SYSTEM.TRACING_STATS |
Add to hbase-site.xml: |
… trace table name, webapp path, column names) and traceserver.py Closes #311 Signed-off-by: Josh Elser <elserj@apache.org>
… trace table name, webapp path, column names) and traceserver.py Closes #311 Signed-off-by: Josh Elser <elserj@apache.org>
… trace table name, webapp path, column names) and traceserver.py Closes #311 Signed-off-by: Josh Elser <elserj@apache.org>
… trace table name, webapp path, column names) and traceserver.py Closes #311 Signed-off-by: Josh Elser <elserj@apache.org>
… trace table name, webapp path, column names) and traceserver.py Closes #311 Signed-off-by: Josh Elser <elserj@apache.org>
… trace table name, webapp path, column names) and traceserver.py Closes #311 Signed-off-by: Josh Elser <elserj@apache.org>
… trace table name, webapp path, column names) and traceserver.py Closes #311 Signed-off-by: Josh Elser <elserj@apache.org>
… trace table name, webapp path, column names) and traceserver.py Closes #311 Signed-off-by: Josh Elser <elserj@apache.org>
… trace table name, webapp path, column names) and traceserver.py Closes #311 Signed-off-by: Josh Elser <elserj@apache.org>
… trace table name, webapp path, column names) and traceserver.py Closes #311 Signed-off-by: Josh Elser <elserj@apache.org>
… trace table name, webapp path, column names) and traceserver.py Closes #311 Signed-off-by: Josh Elser <elserj@apache.org>
… trace table name, webapp path, column names) and traceserver.py Closes #311 Signed-off-by: Josh Elser <elserj@apache.org>
… trace table name, webapp path, column names) and traceserver.py Closes #311 Signed-off-by: Josh Elser <elserj@apache.org>
… trace table name, webapp path, column names) and traceserver.py Closes #311 Signed-off-by: Josh Elser <elserj@apache.org>
… trace table name, webapp path, column names) and traceserver.py Closes #311 Signed-off-by: Josh Elser <elserj@apache.org>
Fixed check null, trace table name, webapp path, column names. Fixed traceserver.py