Skip to content

Commit 8ec513c

Browse files
Hean ChhinlingHean Chhinling
Hean Chhinling
authored and
Hean Chhinling
committed
Adding licenses and replace using sys.stdout.write with print
1 parent 4f18edd commit 8ec513c

File tree

2 files changed

+35
-2
lines changed

2 files changed

+35
-2
lines changed

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/DiagnosticJStackService.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/** * Licensed to the Apache Software Foundation (ASF) under one
2+
* or more contributor license agreements. See the NOTICE file
3+
* distributed with this work for additional information
4+
* regarding copyright ownership. The ASF licenses this file
5+
* to you under the Apache License, Version 2.0 (the
6+
* "License"); you may not use this file except in compliance
7+
* with the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
118
package org.apache.hadoop.yarn.server.nodemanager;
219

320
import org.apache.hadoop.util.Shell;

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/resources/diagnostics/jstack_collector.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
117
import subprocess
218
import sys
319

@@ -67,11 +83,11 @@ def main():
6783
pids = get_nodemanager_pid()
6884

6985
if not pids:
70-
sys.stdout.write("No active process id in this NodeManager.")
86+
print("No active process id in this NodeManager.")
7187
sys.exit(0)
7288

7389
jstacks = execute_jstack(pids)
74-
sys.stdout.write(jstacks) # The Initiated java processBuilder will read this stdout
90+
print(jstacks) # The Initiated java processBuilder will read this stdout
7591

7692

7793
if __name__ == "__main__":

0 commit comments

Comments
 (0)