This repository was archived by the owner on Jun 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 150
[TRAFODION-3248]provide more dcscheck option #1761
Open
CoderSong2015
wants to merge
5
commits into
apache:master
Choose a base branch
from
CoderSong2015:forDcsStatus2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
b20451c
[TRAFODION-3248]provide more dcscheck option
d569ea1
modify the way to get zkshell when in cluster environment
b09c697
move null option to default section of case statement
17e27d0
make the related code more clear
2919c96
[TRAFODION-3248]remove debug info
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
dcs/src/main/java/org/trafodion/dcs/zookeeper/ZKShellTool.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| /** | ||
| * @@@ START COPYRIGHT @@@ | ||
|
|
||
| Licensed to the Apache Software Foundation (ASF) under one | ||
| or more contributor license agreements. See the NOTICE file | ||
| distributed with this work for additional information | ||
| regarding copyright ownership. The ASF licenses this file | ||
| to you under the Apache License, Version 2.0 (the | ||
| "License"); you may not use this file except in compliance | ||
| with the License. You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, | ||
| software distributed under the License is distributed on an | ||
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| KIND, either express or implied. See the License for the | ||
| specific language governing permissions and limitations | ||
| under the License. | ||
|
|
||
| * @@@ END COPYRIGHT @@@ | ||
| */ | ||
| package org.trafodion.dcs.zookeeper; | ||
|
|
||
| import java.util.Properties; | ||
| import java.util.Map.Entry; | ||
| import java.util.List; | ||
| import org.apache.hadoop.conf.Configuration; | ||
| import org.trafodion.dcs.util.DcsConfiguration; | ||
| import java.sql.Timestamp; | ||
| /** | ||
| * Tool for reading ZooKeeper servers from dcs XML configuration and producing | ||
| * a line-by-line list for use by bash scripts. | ||
| */ | ||
| public class ZKShellTool { | ||
| /** | ||
| * Run the tool. | ||
| * @param args Command line arguments. | ||
| */ | ||
| public static void main(String args[]) throws Exception{ | ||
| String username = System.getProperty("user.name"); | ||
| System.out.println("User: " + username); | ||
| ZkClient zkc = new ZkClient(); | ||
| zkc.connect(); | ||
|
|
||
| String registeredPath = new String("/"+username + "/dcs/servers/registered"); | ||
| List<String> zks = zkc.getChildren(registeredPath, null); | ||
|
|
||
| System.out.println("State\t\tNode\tProcessId\tProcessName\tIpAddress\tPort\tClientName\tClientApp\tClientIp\tClientPort"); | ||
| for (String nodeName: zks){ | ||
| String nodePath = registeredPath + "/" + nodeName; | ||
| String currentData = new String(zkc.getData(nodePath, false, null)); | ||
| String[] node_status = currentData.split(":"); | ||
| for(int i = 0; i < node_status.length; i++){ | ||
| if (i != 1 && i != 2) | ||
| System.out.print(node_status[i]+"\t"); | ||
| } | ||
| System.out.println(); | ||
| } | ||
| } | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Would be good to expand the title headers as indicated before EC , OC and so on... Please delete the debug lines
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.
I think there is no need to expand the title headers because jdk command 'jstat' behaves as the same way.