Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge trunk into HDFS-1073.

Resolved several conflicts due to merge of HDFS-2149 and HDFS-2212.
Changes during resolution were:
- move the writing of the transaction ID out of EditLogOutputStream to
  FSEditLogOp.Writer to match trunk's organization
- remove JSPOOL related FsEditLogOp subclasses, add LogSegmentOp subclasses
- modify TestEditLogJournalFailures to not keep trying to use streams after
  the simulated halt, since newer stricter assertions caused these writes to
  fail


git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/HDFS-1073@1152128 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
commit 254ca2a9fbe9c39a5732f65379b8f54b8df6ab87 1 parent 2caeb69
Todd Lipcon authored July 29, 2011

Showing 129 changed files with 1,920 additions and 8,561 deletions. Show diff stats Hide diff stats

  1. 21  hdfs/CHANGES.txt
  2. 1  hdfs/build.xml
  3. 6  hdfs/src/contrib/build.xml
  4. 47  hdfs/src/contrib/hdfsproxy/README
  5. 170  hdfs/src/contrib/hdfsproxy/bin/hdfsproxy
  6. 67  hdfs/src/contrib/hdfsproxy/bin/hdfsproxy-config.sh
  7. 141  hdfs/src/contrib/hdfsproxy/bin/hdfsproxy-daemon.sh
  8. 34  hdfs/src/contrib/hdfsproxy/bin/hdfsproxy-daemons.sh
  9. 68  hdfs/src/contrib/hdfsproxy/bin/hdfsproxy-slaves.sh
  10. 92  hdfs/src/contrib/hdfsproxy/bin/hdfsproxy-tomcat-server.sh
  11. 34  hdfs/src/contrib/hdfsproxy/bin/hdfsproxy-tomcat-servers.sh
  12. 68  hdfs/src/contrib/hdfsproxy/bin/hdfsproxy-tomcat-slaves.sh
  13. 152  hdfs/src/contrib/hdfsproxy/bin/proxy-util
  14. 36  hdfs/src/contrib/hdfsproxy/bin/start-hdfsproxy-tomcat.sh
  15. 37  hdfs/src/contrib/hdfsproxy/bin/start-hdfsproxy.sh
  16. 28  hdfs/src/contrib/hdfsproxy/bin/stop-hdfsproxy-tomcat.sh
  17. 28  hdfs/src/contrib/hdfsproxy/bin/stop-hdfsproxy.sh
  18. 492  hdfs/src/contrib/hdfsproxy/build.xml
  19. 24  hdfs/src/contrib/hdfsproxy/conf/configuration.xsl
  20. 128  hdfs/src/contrib/hdfsproxy/conf/hdfsproxy-default.xml
  21. 44  hdfs/src/contrib/hdfsproxy/conf/hdfsproxy-env.sh
  22. 44  hdfs/src/contrib/hdfsproxy/conf/hdfsproxy-env.sh.template
  23. 1  hdfs/src/contrib/hdfsproxy/conf/hdfsproxy-hosts
  24. 61  hdfs/src/contrib/hdfsproxy/conf/log4j.properties
  25. 48  hdfs/src/contrib/hdfsproxy/conf/ssl-server.xml
  26. 109  hdfs/src/contrib/hdfsproxy/conf/tomcat-forward-web.xml
  27. 166  hdfs/src/contrib/hdfsproxy/conf/tomcat-web.xml
  28. 32  hdfs/src/contrib/hdfsproxy/conf/user-certs.xml
  29. 26  hdfs/src/contrib/hdfsproxy/conf/user-permissions.xml
  30. 127  hdfs/src/contrib/hdfsproxy/ivy.xml
  31. 18  hdfs/src/contrib/hdfsproxy/ivy/libraries.properties
  32. 166  hdfs/src/contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/AuthorizationFilter.java
  33. 157  hdfs/src/contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/HdfsProxy.java
  34. 83  hdfs/src/contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/KerberosAuthorizationFilter.java
  35. 241  hdfs/src/contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/LdapIpDirFilter.java
  36. 69  hdfs/src/contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/ProxyFileDataServlet.java
  37. 43  hdfs/src/contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/ProxyFileForward.java
  38. 368  hdfs/src/contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/ProxyFilter.java
  39. 110  hdfs/src/contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/ProxyForwardServlet.java
  40. 76  hdfs/src/contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/ProxyHttpServer.java
  41. 39  hdfs/src/contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/ProxyListPathsServlet.java
  42. 67  hdfs/src/contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/ProxyStreamFile.java
  43. 358  hdfs/src/contrib/hdfsproxy/src/java/org/apache/hadoop/hdfsproxy/ProxyUtil.java
  44. 128  hdfs/src/contrib/hdfsproxy/src/test/org/apache/hadoop/hdfsproxy/DummyLdapContext.java
  45. 87  hdfs/src/contrib/hdfsproxy/src/test/org/apache/hadoop/hdfsproxy/FindFreePort.java
  46. 51  hdfs/src/contrib/hdfsproxy/src/test/org/apache/hadoop/hdfsproxy/SimpleServlet.java
  47. 161  hdfs/src/contrib/hdfsproxy/src/test/org/apache/hadoop/hdfsproxy/TestAuthorizationFilter.java
  48. 272  hdfs/src/contrib/hdfsproxy/src/test/org/apache/hadoop/hdfsproxy/TestHdfsProxy.java
  49. 113  hdfs/src/contrib/hdfsproxy/src/test/org/apache/hadoop/hdfsproxy/TestLdapIpDirFilter.java
  50. 120  hdfs/src/contrib/hdfsproxy/src/test/org/apache/hadoop/hdfsproxy/TestProxyFilter.java
  51. 69  hdfs/src/contrib/hdfsproxy/src/test/org/apache/hadoop/hdfsproxy/TestProxyForwardServlet.java
  52. 49  hdfs/src/contrib/hdfsproxy/src/test/org/apache/hadoop/hdfsproxy/TestProxyUtil.java
  53. 77  hdfs/src/contrib/hdfsproxy/src/test/resources/cactus-web.xml
  54. 104  hdfs/src/contrib/hdfsproxy/src/test/resources/proxy-config/hdfsproxy-default.xml
  55. 1  hdfs/src/contrib/hdfsproxy/src/test/resources/proxy-config/hdfsproxy-hosts
  56. 15  hdfs/src/contrib/hdfsproxy/src/test/resources/proxy-config/hdfsproxy-site.xml
  57. 76  hdfs/src/contrib/hdfsproxy/src/test/resources/proxy-config/log4j.properties
  58. 57  hdfs/src/contrib/hdfsproxy/src/test/resources/proxy-config/ssl-client.xml
  59. 47  hdfs/src/contrib/hdfsproxy/src/test/resources/proxy-config/ssl-server.xml
  60. 85  hdfs/src/contrib/hdfsproxy/src/test/resources/proxy-config/user-certs.xml
  61. 78  hdfs/src/contrib/hdfsproxy/src/test/resources/proxy-config/user-permissions.xml
  62. BIN  hdfs/src/contrib/hdfsproxy/src/test/resources/ssl-keys/client.keystore
  63. BIN  hdfs/src/contrib/hdfsproxy/src/test/resources/ssl-keys/proxy.keystore
  64. 21  hdfs/src/contrib/hdfsproxy/src/test/resources/ssl-keys/test.crt
  65. 60  hdfs/src/contrib/hdfsproxy/src/test/resources/tomcat-config/server.xml
  66. 19  hdfs/src/contrib/hdfsproxy/src/test/resources/tomcat-config/tomcat-users.xml
  67. 964  hdfs/src/contrib/hdfsproxy/src/test/resources/tomcat-config/web.xml
  68. 154  hdfs/src/contrib/hdfsproxy/src/test/resources/tomcat-web.xml
  69. 601  hdfs/src/docs/src/documentation/content/xdocs/hdfsproxy.xml
  70. 1  hdfs/src/docs/src/documentation/content/xdocs/site.xml
  71. 51  hdfs/src/java/org/apache/hadoop/hdfs/DFSClient.java
  72. 136  hdfs/src/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java
  73. 5  hdfs/src/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockPlacementPolicy.java
  74. 18  hdfs/src/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockPlacementPolicyDefault.java
  75. 14  hdfs/src/java/org/apache/hadoop/hdfs/server/blockmanagement/DatanodeDescriptor.java
  76. 264  hdfs/src/java/org/apache/hadoop/hdfs/server/blockmanagement/DatanodeManager.java
  77. 4  hdfs/src/java/org/apache/hadoop/hdfs/server/blockmanagement/DecommissionManager.java
  78. 35  hdfs/src/java/org/apache/hadoop/hdfs/server/blockmanagement/PendingReplicationBlocks.java
  79. 3  hdfs/src/java/org/apache/hadoop/hdfs/server/common/JspHelper.java
  80. 169  hdfs/src/java/org/apache/hadoop/hdfs/server/common/Storage.java
  81. 17  hdfs/src/java/org/apache/hadoop/hdfs/server/datanode/BlockPoolSliceStorage.java
  82. 58  hdfs/src/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java
  83. 20  hdfs/src/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java
  84. 3  hdfs/src/java/org/apache/hadoop/hdfs/server/datanode/DirectoryScanner.java
  85. 5  hdfs/src/java/org/apache/hadoop/hdfs/server/namenode/BackupImage.java
  86. 76  hdfs/src/java/org/apache/hadoop/hdfs/server/namenode/EditLogBackupOutputStream.java
  87. 77  hdfs/src/java/org/apache/hadoop/hdfs/server/namenode/EditLogFileOutputStream.java
  88. 43  hdfs/src/java/org/apache/hadoop/hdfs/server/namenode/EditLogOutputStream.java
  89. 150  hdfs/src/java/org/apache/hadoop/hdfs/server/namenode/EditsDoubleBuffer.java
  90. 219  hdfs/src/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java
  91. 793  hdfs/src/java/org/apache/hadoop/hdfs/server/namenode/FSEditLogOp.java
  92. 18  hdfs/src/java/org/apache/hadoop/hdfs/server/namenode/FSImage.java
  93. 350  hdfs/src/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
  94. 17  hdfs/src/java/org/apache/hadoop/hdfs/server/namenode/NNStorage.java
  95. 71  hdfs/src/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java
  96. 41  hdfs/src/java/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java
  97. 2  hdfs/src/test/aop/org/apache/hadoop/hdfs/TestFiPipelines.java
  98. 5  hdfs/src/test/hdfs/org/apache/hadoop/hdfs/TestDFSUpgradeFromImage.java
  99. 3  hdfs/src/test/hdfs/org/apache/hadoop/hdfs/TestDatanodeDeath.java
  100. 4  hdfs/src/test/hdfs/org/apache/hadoop/hdfs/TestDecommission.java
  101. 3  hdfs/src/test/hdfs/org/apache/hadoop/hdfs/TestFileAppend2.java
  102. 3  hdfs/src/test/hdfs/org/apache/hadoop/hdfs/TestFileAppend3.java
  103. 2  hdfs/src/test/hdfs/org/apache/hadoop/hdfs/TestFileAppend4.java
  104. 3  hdfs/src/test/hdfs/org/apache/hadoop/hdfs/TestFileConcurrentReader.java
  105. 3  hdfs/src/test/hdfs/org/apache/hadoop/hdfs/TestFileCorruption.java
  106. 3  hdfs/src/test/hdfs/org/apache/hadoop/hdfs/TestFileCreation.java
  107. 3  hdfs/src/test/hdfs/org/apache/hadoop/hdfs/TestFileCreationClient.java
  108. 3  hdfs/src/test/hdfs/org/apache/hadoop/hdfs/TestFileCreationDelete.java
  109. 4  hdfs/src/test/hdfs/org/apache/hadoop/hdfs/TestFileCreationEmpty.java
  110. 3  hdfs/src/test/hdfs/org/apache/hadoop/hdfs/TestFileStatus.java
  111. 2  hdfs/src/test/hdfs/org/apache/hadoop/hdfs/TestLeaseRecovery2.java
  112. 3  hdfs/src/test/hdfs/org/apache/hadoop/hdfs/TestMultiThreadedHflush.java
  113. 2  hdfs/src/test/hdfs/org/apache/hadoop/hdfs/TestPipelines.java
  114. 3  hdfs/src/test/hdfs/org/apache/hadoop/hdfs/TestReadWhileWriting.java
  115. 3  hdfs/src/test/hdfs/org/apache/hadoop/hdfs/TestRenameWhileOpen.java
  116. 31  hdfs/src/test/hdfs/org/apache/hadoop/hdfs/UpgradeUtilities.java
  117. 3  hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/balancer/TestBalancerWithMultipleNameNodes.java
  118. 21  hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/blockmanagement/BlockManagerTestUtil.java
  119. 33  ...rc/test/hdfs/org/apache/hadoop/hdfs/server/{namenode → blockmanagement}/TestComputeInvalidateWork.java
  120. 12  hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/blockmanagement/TestHeartbeatHandling.java
  121. 4  hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/datanode/TestBlockReport.java
  122. 13  hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/NameNodeAdapter.java
  123. 3  hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestClusterId.java
  124. 10  hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestDeadDatanode.java
  125. 7  hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestEditLogJournalFailures.java
  126. 81  hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestEditsDoubleBuffer.java
  127. 7  hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestSaveNamespace.java
  128. 3  hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestStorageRestore.java
  129. 2  hdfs/src/test/unit/org/apache/hadoop/hdfs/server/datanode/TestBlockRecovery.java
21  hdfs/CHANGES.txt
@@ -9,6 +9,8 @@ Trunk (unreleased changes)
9 9
 
10 10
     HDFS-1536. Improve HDFS WebUI. (hairong)
11 11
 
  12
+    HDFS-2210. Remove hdfsproxy. (eli)
  13
+
12 14
   NEW FEATURES
13 15
 
14 16
     HDFS-1359. Add BlockPoolID to Block. (suresh)
@@ -600,6 +602,22 @@ Trunk (unreleased changes)
600 602
     cause. (Ravi Prakash via atm)
601 603
 
602 604
     HDFS-2180. Refactor NameNode HTTP server into new class. (todd)
  605
+    
  606
+    HDFS-2198. Remove hardcoded configuration keys. (suresh)
  607
+
  608
+    HDFS-2149. Move EditLogOp serialization formats into FsEditLogOp
  609
+    implementations. (Ivan Kelly via todd)
  610
+
  611
+    HDFS-2191. Move datanodeMap from FSNamesystem to DatanodeManager.
  612
+    (szetszwo)
  613
+
  614
+    HDFS-2200. Change FSNamesystem.LOG to package private. (szetszwo)
  615
+
  616
+    HDFS-2195. Refactor StorageDirectory to not be an non-static inner class.
  617
+    (todd via eli)
  618
+
  619
+    HDFS-2212. Refactor double-buffering code out of EditLogOutputStreams.
  620
+    (todd via eli)
603 621
 
604 622
   OPTIMIZATIONS
605 623
 
@@ -1370,6 +1388,9 @@ Release 0.22.0 - Unreleased
1370 1388
     HDFS-2071. Use of isConnected() in DataXceiver is invalid. (Kihwal Lee
1371 1389
     via todd)
1372 1390
 
  1391
+    HDFS-1981. NameNode does not saveNamespace() when editsNew is empty.
  1392
+    (Uma Maheswara Rao G via shv)
  1393
+
1373 1394
 Release 0.21.1 - Unreleased
1374 1395
     HDFS-1466. TestFcHdfsSymlink relies on /tmp/test not existing. (eli)
1375 1396
 
1  hdfs/build.xml
@@ -1397,7 +1397,6 @@
1397 1397
         <exclude name="src/c++/libhdfs/install-sh" />
1398 1398
         <exclude name="src/c++/libhdfs/ltmain.sh" />
1399 1399
         <exclude name="src/c++/libhdfs/missing" />
1400  
-        <exclude name="src/contrib/hdfsproxy/src/test/resources/" />
1401 1400
         <exclude name="src/test/checkstyle-noframes-sorted.xsl" />
1402 1401
         <exclude name="src/test/checkstyle.xml" />
1403 1402
         <exclude name="src/test/findbugsExcludeFile.xml" />
6  hdfs/src/contrib/build.xml
@@ -48,12 +48,6 @@
48 48
     <subant target="test">
49 49
       <fileset dir="." includes="fuse-dfs/build.xml"/>
50 50
     </subant> 
51  
-
52  
-    <!-- hdfsproxy tests failing due to HDFS-1666
53  
-    <subant target="test">
54  
-      <fileset dir="." includes="hdfsproxy/build.xml"/>
55  
-    </subant>
56  
-      -->
57 51
   </target>
58 52
   
59 53
   
47  hdfs/src/contrib/hdfsproxy/README
... ...
@@ -1,47 +0,0 @@
1  
-#
2  
-# Licensed to the Apache Software Foundation (ASF) under one or more
3  
-# contributor license agreements.  See the NOTICE file distributed with
4  
-# this work for additional information regarding copyright ownership.
5  
-# The ASF licenses this file to You under the Apache License, Version 2.0
6  
-# (the "License"); you may not use this file except in compliance with
7  
-# 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  
-
18  
-HDFS Proxy is a proxy server through which a hadoop client (through HSFTP) or a standard
19  
-HTTPS client (wget, curl, etc) can talk to a hadoop server and more importantly pull data
20  
-from the sever. It put an access control layer in front of hadoop namenode server and extends
21  
-its functionalities to allow hadoop cross-version data transfer.
22  
-
23  
-HDFSPROXY can be configured/started via either Jetty or Tomcat with different supporting features.
24  
-
25  
-A) With Jetty-based Installation, supporting features include:
26  
-> Single Hadoop source cluster data transfer
27  
-> Single Hadoop version data transfer
28  
-> Authenticate users via user SSL certificates with ProxyFilter installed
29  
-> Enforce access control based on configuration files.
30  
-
31  
-B) With Tomcat-based Installation, supporting features include:
32  
-> Multiple Hadoop source cluster data transfer
33  
-> Multiple Hadoop version data transfer
34  
-> Authenticate users via user SSL certificates with ProxyFilter installed
35  
-> Authentication and authorization via LDAP with LdapIpDirFilter installed
36  
-> Access control based on configuration files if ProxyFilter is installed.
37  
-> Access control based on LDAP entries if LdapIpDirFilter is installed.
38  
-> Standard HTTPS Get Support for file transfer
39  
-
40  
-The detailed configuration/set-up guide is in the Forrest 
41  
-documentation, which can be found at $HADOOP_PREFIX/docs. In order to build the 
42  
-documentation on your own from source please use the following command in 
43  
-the downloaded source folder:
44  
-
45  
-ant docs -Dforrest.home=path to forrest -Djava5.home= path to jdk5. 
46  
-
47  
-The documentation so built would be under $HADOOP_PREFIX/build/docs
170  hdfs/src/contrib/hdfsproxy/bin/hdfsproxy
... ...
@@ -1,170 +0,0 @@
1  
-#!/usr/bin/env bash
2  
-
3  
-# Licensed to the Apache Software Foundation (ASF) under one or more
4  
-# contributor license agreements.  See the NOTICE file distributed with
5  
-# this work for additional information regarding copyright ownership.
6  
-# The ASF licenses this file to You under the Apache License, Version 2.0
7  
-# (the "License"); you may not use this file except in compliance with
8  
-# the License.  You may obtain a copy of the License at
9  
-#
10  
-#     http://www.apache.org/licenses/LICENSE-2.0
11  
-#
12  
-# Unless required by applicable law or agreed to in writing, software
13  
-# distributed under the License is distributed on an "AS IS" BASIS,
14  
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  
-# See the License for the specific language governing permissions and
16  
-# limitations under the License.
17  
-
18  
-
19  
-# The HdfsProxy command script
20  
-#
21  
-# Environment Variables
22  
-#
23  
-#   JAVA_HOME        The java implementation to use.  Overrides JAVA_HOME.
24  
-#
25  
-#   HDFSPROXY_CLASSPATH Extra Java CLASSPATH entries.
26  
-#
27  
-#   HDFSPROXY_HEAPSIZE  The maximum amount of heap to use, in MB. 
28  
-#                    Default is 1000.
29  
-#
30  
-#   HDFSPROXY_OPTS      Extra Java runtime options.
31  
-#   
32  
-#   HDFSPROXY_NAMENODE_OPTS       These options are added to HDFSPROXY_OPTS 
33  
-#   HDFSPROXY_CLIENT_OPTS         when the respective command is run.
34  
-#   HDFSPROXY_{COMMAND}_OPTS etc  HDFSPROXY_JT_OPTS applies to JobTracker 
35  
-#                              for e.g.  HDFSPROXY_CLIENT_OPTS applies to 
36  
-#                              more than one command (fs, dfs, fsck, 
37  
-#                              dfsadmin etc)  
38  
-#
39  
-#   HDFSPROXY_CONF_DIR  Alternate conf dir. Default is ${HDFSPROXY_HOME}/conf.
40  
-#
41  
-#   HDFSPROXY_ROOT_LOGGER The root appender. Default is INFO,console
42  
-#
43  
-
44  
-bin=`dirname "$0"`
45  
-bin=`cd "$bin"; pwd`
46  
-
47  
-. "$bin"/hdfsproxy-config.sh
48  
-
49  
-cygwin=false
50  
-case "`uname`" in
51  
-CYGWIN*) cygwin=true;;
52  
-esac
53  
-
54  
-if [ -f "${HDFSPROXY_CONF_DIR}/hdfsproxy-env.sh" ]; then
55  
-  . "${HDFSPROXY_CONF_DIR}/hdfsproxy-env.sh"
56  
-fi
57  
-
58  
-# some Java parameters
59  
-if [ "$JAVA_HOME" != "" ]; then
60  
-  #echo "run java in $JAVA_HOME"
61  
-  JAVA_HOME=$JAVA_HOME
62  
-fi
63  
-  
64  
-if [ "$JAVA_HOME" = "" ]; then
65  
-  echo "Error: JAVA_HOME is not set."
66  
-  exit 1
67  
-fi
68  
-
69  
-JAVA=$JAVA_HOME/bin/java
70  
-JAVA_HEAP_MAX=-Xmx1000m 
71  
-
72  
-# check envvars which might override default args
73  
-if [ "$HDFSPROXY_HEAPSIZE" != "" ]; then
74  
-  #echo "run with heapsize $HDFSPROXY_HEAPSIZE"
75  
-  JAVA_HEAP_MAX="-Xmx""$HDFSPROXY_HEAPSIZE""m"
76  
-  #echo $JAVA_HEAP_MAX
77  
-fi
78  
-
79  
-# CLASSPATH initially contains $HDFSPROXY_CONF_DIR
80  
-CLASSPATH="${HDFSPROXY_CONF_DIR}"
81  
-CLASSPATH=${CLASSPATH}:$JAVA_HOME/lib/tools.jar
82  
-
83  
-# for developers, add HdfsProxy classes to CLASSPATH
84  
-if [ -d "$HDFSPROXY_HOME/build/classes" ]; then
85  
-  CLASSPATH=${CLASSPATH}:$HDFSPROXY_HOME/build/classes
86  
-fi
87  
-if [ -d "$HDFSPROXY_HOME/build/web/webapps" ]; then
88  
-  CLASSPATH=${CLASSPATH}:$HDFSPROXY_HOME/build/web
89  
-fi
90  
-if [ -d "$HDFSPROXY_HOME/build/test/hdfs/classes" ]; then
91  
-  CLASSPATH=${CLASSPATH}:$HDFSPROXY_HOME/build/test/hdfs/classes
92  
-fi
93  
-
94  
-# so that filenames w/ spaces are handled correctly in loops below
95  
-IFS=
96  
-
97  
-# for releases, add hdfsproxy jar & webapps to CLASSPATH
98  
-if [ -d "$HDFSPROXY_HOME/webapps" ]; then
99  
-  CLASSPATH=${CLASSPATH}:$HDFSPROXY_HOME
100  
-fi
101  
-for f in $HDFSPROXY_HOME/hdfsproxy-*.jar; do
102  
-  CLASSPATH=${CLASSPATH}:$f;
103  
-done
104  
-
105  
-# add libs to CLASSPATH
106  
-if [ -d "$HDFSPROXY_HOME/lib" ]; then
107  
-	for f in $HDFSPROXY_HOME/lib/*.jar; do
108  
-	  CLASSPATH=${CLASSPATH}:$f;
109  
-	done
110  
-fi
111  
-
112  
-if [ -d "$HDFSPROXY_HOME/../../" ]; then
113  
-	for f in $HDFSPROXY_HOME/../../*.jar; do
114  
-    CLASSPATH=${CLASSPATH}:$f;
115  
-  done
116  
-fi
117  
-if [ -d "$HDFSPROXY_HOME/../../lib" ]; then
118  
-	for f in $HDFSPROXY_HOME/../../lib/*.jar; do
119  
-    CLASSPATH=${CLASSPATH}:$f;
120  
-  done
121  
-fi
122  
-if [ -d "$HDFSPROXY_HOME/../../lib/jsp-2.1" ]; then
123  
-	for f in $HDFSPROXY_HOME/../../lib/jsp-2.1/*.jar; do
124  
-    CLASSPATH=${CLASSPATH}:$f;
125  
-  done
126  
-fi
127  
-
128  
-
129  
-# add user-specified CLASSPATH last
130  
-if [ "$HDFSPROXY_CLASSPATH" != "" ]; then
131  
-  CLASSPATH=${CLASSPATH}:${HDFSPROXY_CLASSPATH}
132  
-fi
133  
-
134  
-# default log directory & file
135  
-if [ "$HDFSPROXY_LOG_DIR" = "" ]; then
136  
-  HDFSPROXY_LOG_DIR="$HDFSPROXY_HOME/logs"
137  
-fi
138  
-if [ "$HDFSPROXY_LOGFILE" = "" ]; then
139  
-  HDFSPROXY_LOGFILE='hdfsproxy.log'
140  
-fi
141  
-
142  
-# restore ordinary behaviour
143  
-unset IFS
144  
-
145  
-# figure out which class to run
146  
-CLASS='org.apache.hadoop.hdfsproxy.HdfsProxy'
147  
-
148  
-# cygwin path translation
149  
-if $cygwin; then
150  
-  CLASSPATH=`cygpath -p -w "$CLASSPATH"`
151  
-  HDFSPROXY_HOME=`cygpath -d "$HDFSPROXY_HOME"`
152  
-  HDFSPROXY_LOG_DIR=`cygpath -d "$HDFSPROXY_LOG_DIR"`
153  
-fi
154  
-
155  
-# cygwin path translation
156  
-if $cygwin; then
157  
-  JAVA_LIBRARY_PATH=`cygpath -p "$JAVA_LIBRARY_PATH"`
158  
-fi
159  
-
160  
-HDFSPROXY_OPTS="$HDFSPROXY_OPTS -Dhdfsproxy.log.dir=$HDFSPROXY_LOG_DIR"
161  
-HDFSPROXY_OPTS="$HDFSPROXY_OPTS -Dhdfsproxy.log.file=$HDFSPROXY_LOGFILE"
162  
-HDFSPROXY_OPTS="$HDFSPROXY_OPTS -Dhdfsproxy.home.dir=$HDFSPROXY_HOME"
163  
-HDFSPROXY_OPTS="$HDFSPROXY_OPTS -Dhdfsproxy.id.str=$HDFSPROXY_IDENT_STRING"
164  
-HDFSPROXY_OPTS="$HDFSPROXY_OPTS -Dhdfsproxy.root.logger=${HDFSPROXY_ROOT_LOGGER:-INFO,console}"
165  
-if [ "x$JAVA_LIBRARY_PATH" != "x" ]; then
166  
-  HDFSPROXY_OPTS="$HDFSPROXY_OPTS -Djava.library.path=$JAVA_LIBRARY_PATH"
167  
-fi  
168  
-
169  
-# run it
170  
-exec "$JAVA" $JAVA_HEAP_MAX $HDFSPROXY_OPTS -classpath "$CLASSPATH" $CLASS "$@"
67  hdfs/src/contrib/hdfsproxy/bin/hdfsproxy-config.sh
... ...
@@ -1,67 +0,0 @@
1  
-# Licensed to the Apache Software Foundation (ASF) under one or more
2  
-# contributor license agreements.  See the NOTICE file distributed with
3  
-# this work for additional information regarding copyright ownership.
4  
-# The ASF licenses this file to You under the Apache License, Version 2.0
5  
-# (the "License"); you may not use this file except in compliance with
6  
-# the License.  You may obtain a copy of the License at
7  
-#
8  
-#     http://www.apache.org/licenses/LICENSE-2.0
9  
-#
10  
-# Unless required by applicable law or agreed to in writing, software
11  
-# distributed under the License is distributed on an "AS IS" BASIS,
12  
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  
-# See the License for the specific language governing permissions and
14  
-# limitations under the License.
15  
-
16  
-# included in all the hadoop scripts with source command
17  
-# should not be executable directly
18  
-# also should not be passed any arguments, since we need original $*
19  
-
20  
-# resolve links - $0 may be a softlink
21  
-
22  
-this="$0"
23  
-while [ -h "$this" ]; do
24  
-  ls=`ls -ld "$this"`
25  
-  link=`expr "$ls" : '.*-> \(.*\)$'`
26  
-  if expr "$link" : '.*/.*' > /dev/null; then
27  
-    this="$link"
28  
-  else
29  
-    this=`dirname "$this"`/"$link"
30  
-  fi
31  
-done
32  
-
33  
-# convert relative path to absolute path
34  
-bin=`dirname "$this"`
35  
-script=`basename "$this"`
36  
-bin=`cd "$bin"; pwd`
37  
-this="$bin/$script"
38  
-
39  
-# the root of the HdfsProxy installation
40  
-export HDFSPROXY_HOME=`dirname "$this"`/..
41  
-
42  
-#check to see if the conf dir is given as an optional argument
43  
-if [ $# -gt 1 ]
44  
-then
45  
-    if [ "--config" = "$1" ]
46  
-	  then
47  
-	      shift
48  
-	      confdir=$1
49  
-	      shift
50  
-	      HDFSPROXY_CONF_DIR=$confdir
51  
-    fi
52  
-fi
53  
- 
54  
-# Allow alternate conf dir location.
55  
-HDFSPROXY_CONF_DIR="${HDFSPROXY_CONF_DIR:-$HDFSPROXY_HOME/conf}"
56  
-
57  
-#check to see it is specified whether to use the slaves file
58  
-if [ $# -gt 1 ]
59  
-then
60  
-    if [ "--hosts" = "$1" ]
61  
-    then
62  
-        shift
63  
-        slavesfile=$1
64  
-        shift
65  
-        export HDFSPROXY_SLAVES="${HDFSPROXY_CONF_DIR}/$slavesfile"
66  
-    fi
67  
-fi
141  hdfs/src/contrib/hdfsproxy/bin/hdfsproxy-daemon.sh
... ...
@@ -1,141 +0,0 @@
1  
-#!/usr/bin/env bash
2  
-
3  
-# Licensed to the Apache Software Foundation (ASF) under one or more
4  
-# contributor license agreements.  See the NOTICE file distributed with
5  
-# this work for additional information regarding copyright ownership.
6  
-# The ASF licenses this file to You under the Apache License, Version 2.0
7  
-# (the "License"); you may not use this file except in compliance with
8  
-# the License.  You may obtain a copy of the License at
9  
-#
10  
-#     http://www.apache.org/licenses/LICENSE-2.0
11  
-#
12  
-# Unless required by applicable law or agreed to in writing, software
13  
-# distributed under the License is distributed on an "AS IS" BASIS,
14  
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  
-# See the License for the specific language governing permissions and
16  
-# limitations under the License.
17  
-
18  
-
19  
-# Runs a HdfsProxy as a daemon.
20  
-#
21  
-# Environment Variables
22  
-#
23  
-#   HDFSPROXY_CONF_DIR  Alternate conf dir. Default is ${HDFSPROXY_HOME}/conf.
24  
-#   HDFSPROXY_LOG_DIR   Where log files are stored.  PWD by default.
25  
-#   HDFSPROXY_MASTER    host:path where hdfsproxy code should be rsync'd from
26  
-#   HDFSPROXY_PID_DIR   The pid files are stored. /tmp by default.
27  
-#   HDFSPROXY_IDENT_STRING   A string representing this instance of hdfsproxy. $USER by default
28  
-#   HDFSPROXY_NICENESS The scheduling priority for daemons. Defaults to 0.
29  
-##
30  
-
31  
-usage="Usage: hdfsproxy-daemon.sh [--config <conf-dir>] [--hosts hostlistfile] (start|stop) "
32  
-
33  
-# if no args specified, show usage
34  
-if [ $# -le 1 ]; then
35  
-  echo $usage
36  
-  exit 1
37  
-fi
38  
-
39  
-bin=`dirname "$0"`
40  
-bin=`cd "$bin"; pwd`
41  
-
42  
-. "$bin"/hdfsproxy-config.sh
43  
-
44  
-# get arguments
45  
-startStop=$1
46  
-shift
47  
-
48  
-hdfsproxy_rotate_log ()
49  
-{
50  
-    log=$1;
51  
-    num=5;
52  
-    if [ -n "$2" ]; then
53  
-	num=$2
54  
-    fi
55  
-    if [ -f "$log" ]; then # rotate logs
56  
-	while [ $num -gt 1 ]; do
57  
-	    prev=`expr $num - 1`
58  
-	    [ -f "$log.$prev" ] && mv "$log.$prev" "$log.$num"
59  
-	    num=$prev
60  
-	done
61  
-	mv "$log" "$log.$num";
62  
-    fi
63  
-}
64  
-
65  
-if [ -f "${HDFSPROXY_CONF_DIR}/hdfsproxy-env.sh" ]; then
66  
-  . "${HDFSPROXY_CONF_DIR}/hdfsproxy-env.sh"
67  
-fi
68  
-
69  
-# get log directory
70  
-if [ "$HDFSPROXY_LOG_DIR" = "" ]; then
71  
-  export HDFSPROXY_LOG_DIR="$HDFSPROXY_HOME/logs"
72  
-fi
73  
-mkdir -p "$HDFSPROXY_LOG_DIR"
74  
-
75  
-if [ "$HDFSPROXY_PID_DIR" = "" ]; then
76  
-  HDFSPROXY_PID_DIR=/tmp
77  
-fi
78  
-
79  
-if [ "$HDFSPROXY_IDENT_STRING" = "" ]; then
80  
-  export HDFSPROXY_IDENT_STRING="$USER"
81  
-fi
82  
-
83  
-# some variables
84  
-export HDFSPROXY_LOGFILE=hdfsproxy-$HDFSPROXY_IDENT_STRING-$HOSTNAME.log
85  
-export HDFSPROXY_ROOT_LOGGER="INFO,DRFA"
86  
-log=$HDFSPROXY_LOG_DIR/hdfsproxy-$HDFSPROXY_IDENT_STRING-$HOSTNAME.out
87  
-pid=$HDFSPROXY_PID_DIR/hdfsproxy-$HDFSPROXY_IDENT_STRING.pid
88  
-
89  
-# Set default scheduling priority
90  
-if [ "$HDFSPROXY_NICENESS" = "" ]; then
91  
-    export HDFSPROXY_NICENESS=0
92  
-fi
93  
-
94  
-case $startStop in
95  
-
96  
-  (start)
97  
-
98  
-    mkdir -p "$HDFSPROXY_PID_DIR"
99  
-
100  
-    if [ -f $pid ]; then
101  
-      if kill -0 `cat $pid` > /dev/null 2>&1; then
102  
-        echo hdfsproxy running as process `cat $pid`.  Stop it first.
103  
-        exit 1
104  
-      fi
105  
-    fi
106  
-
107  
-    if [ "$HDFSPROXY_MASTER" != "" ]; then
108  
-      echo rsync from $HDFSPROXY_MASTER
109  
-      rsync -a -e ssh --delete --exclude=.svn --exclude='logs/*' --exclude='contrib/hod/logs/*' $HDFSPROXY_MASTER/ "$HDFSPROXY_HOME"
110  
-    fi
111  
-
112  
-    hdfsproxy_rotate_log $log
113  
-    echo starting hdfsproxy, logging to $log
114  
-    cd "$HDFSPROXY_HOME"
115  
-    nohup nice -n $HDFSPROXY_NICENESS "$HDFSPROXY_HOME"/bin/hdfsproxy --config $HDFSPROXY_CONF_DIR "$@" > "$log" 2>&1 < /dev/null &
116  
-    echo $! > $pid
117  
-    sleep 1; head "$log"
118  
-    ;;
119  
-          
120  
-  (stop)
121  
-
122  
-    if [ -f $pid ]; then
123  
-      if kill -0 `cat $pid` > /dev/null 2>&1; then
124  
-        echo stopping hdfsproxy
125  
-        kill `cat $pid`
126  
-      else
127  
-        echo no hdfsproxy to stop
128  
-      fi
129  
-    else
130  
-      echo no hdfsproxy to stop
131  
-    fi
132  
-    ;;
133  
-
134  
-  (*)
135  
-    echo $usage
136  
-    exit 1
137  
-    ;;
138  
-
139  
-esac
140  
-
141  
-
34  hdfs/src/contrib/hdfsproxy/bin/hdfsproxy-daemons.sh
... ...
@@ -1,34 +0,0 @@
1  
-#!/usr/bin/env bash
2  
-
3  
-# Licensed to the Apache Software Foundation (ASF) under one or more
4  
-# contributor license agreements.  See the NOTICE file distributed with
5  
-# this work for additional information regarding copyright ownership.
6  
-# The ASF licenses this file to You under the Apache License, Version 2.0
7  
-# (the "License"); you may not use this file except in compliance with
8  
-# the License.  You may obtain a copy of the License at
9  
-#
10  
-#     http://www.apache.org/licenses/LICENSE-2.0
11  
-#
12  
-# Unless required by applicable law or agreed to in writing, software
13  
-# distributed under the License is distributed on an "AS IS" BASIS,
14  
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  
-# See the License for the specific language governing permissions and
16  
-# limitations under the License.
17  
-
18  
-
19  
-# Run a HdfsProxy command on all slave hosts.
20  
-
21  
-usage="Usage: hdfsproxy-daemons.sh [--config confdir] [--hosts hostlistfile] [start|stop] "
22  
-
23  
-# if no args specified, show usage
24  
-if [ $# -le 1 ]; then
25  
-  echo $usage
26  
-  exit 1
27  
-fi
28  
-
29  
-bin=`dirname "$0"`
30  
-bin=`cd "$bin"; pwd`
31  
-
32  
-. $bin/hdfsproxy-config.sh
33  
-
34  
-exec "$bin/hdfsproxy-slaves.sh" --config $HDFSPROXY_CONF_DIR cd "$HDFSPROXY_HOME" \; "$bin/hdfsproxy-daemon.sh" --config $HDFSPROXY_CONF_DIR "$@"
68  hdfs/src/contrib/hdfsproxy/bin/hdfsproxy-slaves.sh
... ...
@@ -1,68 +0,0 @@
1  
-#!/usr/bin/env bash
2  
-
3  
-# Licensed to the Apache Software Foundation (ASF) under one or more
4  
-# contributor license agreements.  See the NOTICE file distributed with
5  
-# this work for additional information regarding copyright ownership.
6  
-# The ASF licenses this file to You under the Apache License, Version 2.0
7  
-# (the "License"); you may not use this file except in compliance with
8  
-# the License.  You may obtain a copy of the License at
9  
-#
10  
-#     http://www.apache.org/licenses/LICENSE-2.0
11  
-#
12  
-# Unless required by applicable law or agreed to in writing, software
13  
-# distributed under the License is distributed on an "AS IS" BASIS,
14  
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  
-# See the License for the specific language governing permissions and
16  
-# limitations under the License.
17  
-
18  
-
19  
-# Run a shell command on all slave hosts.
20  
-#
21  
-# Environment Variables
22  
-#
23  
-#   HDFSPROXY_SLAVES    File naming remote hosts.
24  
-#     Default is ${HDFSPROXY_CONF_DIR}/hdfsproxy-hosts.
25  
-#   HDFSPROXY_CONF_DIR  Alternate conf dir. Default is ${HDFSPROXY_HOME}/conf.
26  
-#   HDFSPROXY_SLAVE_SLEEP Seconds to sleep between spawning remote commands.
27  
-#   HDFSPROXY_SSH_OPTS Options passed to ssh when running remote commands.
28  
-##
29  
-
30  
-usage="Usage: hdfsproxy-slaves.sh [--config confdir] command..."
31  
-
32  
-# if no args specified, show usage
33  
-if [ $# -le 0 ]; then
34  
-  echo $usage
35  
-  exit 1
36  
-fi
37  
-
38  
-bin=`dirname "$0"`
39  
-bin=`cd "$bin"; pwd`
40  
-
41  
-. "$bin"/hdfsproxy-config.sh
42  
-
43  
-# If the slaves file is specified in the command line,
44  
-# then it takes precedence over the definition in 
45  
-# hdfsproxy-env.sh. Save it here.
46  
-HOSTLIST=$HDFSPROXY_SLAVES
47  
-
48  
-if [ -f "${HDFSPROXY_CONF_DIR}/hdfsproxy-env.sh" ]; then
49  
-  . "${HDFSPROXY_CONF_DIR}/hdfsproxy-env.sh"
50  
-fi
51  
-
52  
-if [ "$HOSTLIST" = "" ]; then
53  
-  if [ "$HDFSPROXY_SLAVES" = "" ]; then
54  
-    export HOSTLIST="${HDFSPROXY_CONF_DIR}/hdfsproxy-hosts"
55  
-  else
56  
-    export HOSTLIST="${HDFSPROXY_SLAVES}"
57  
-  fi
58  
-fi
59  
-
60  
-for slave in `cat "$HOSTLIST"`; do
61  
- ssh $HDFSPROXY_SSH_OPTS $slave $"${@// /\\ }" \
62  
-   2>&1 | sed "s/^/$slave: /" &
63  
- if [ "$HDFSPROXY_SLAVE_SLEEP" != "" ]; then
64  
-   sleep $HDFSPROXY_SLAVE_SLEEP
65  
- fi
66  
-done
67  
-
68  
-wait
92  hdfs/src/contrib/hdfsproxy/bin/hdfsproxy-tomcat-server.sh
... ...
@@ -1,92 +0,0 @@
1  
-#!/usr/bin/env bash
2  
-
3  
-# Licensed to the Apache Software Foundation (ASF) under one or more
4  
-# contributor license agreements.  See the NOTICE file distributed with
5  
-# this work for additional information regarding copyright ownership.
6  
-# The ASF licenses this file to You under the Apache License, Version 2.0
7  
-# (the "License"); you may not use this file except in compliance with
8  
-# the License.  You may obtain a copy of the License at
9  
-#
10  
-#     http://www.apache.org/licenses/LICENSE-2.0
11  
-#
12  
-# Unless required by applicable law or agreed to in writing, software
13  
-# distributed under the License is distributed on an "AS IS" BASIS,
14  
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  
-# See the License for the specific language governing permissions and
16  
-# limitations under the License.
17  
-
18  
-
19  
-# Runs a HdfsProxy as a daemon.
20  
-#
21  
-# Environment Variables
22  
-#
23  
-#   HDFSPROXY_CONF_DIR  Alternate conf dir. Default is ${HDFSPROXY_HOME}/conf.
24  
-#   HDFSPROXY_MASTER    host:path where hdfsproxy code should be rsync'd from
25  
-#   HDFSPROXY_PID_DIR   The pid files are stored. /tmp by default.
26  
-#   HDFSPROXY_IDENT_STRING   A string representing this instance of hdfsproxy. $USER by default
27  
-#   HDFSPROXY_NICENESS The scheduling priority for daemons. Defaults to 0.
28  
-#		TOMCAT_HOME_DIR tomcat home directory.
29  
-##
30  
-
31  
-usage="Usage: hdfsproxy-tomcat-server.sh [--config <conf-dir>] [--hosts hostlistfile] (start|stop) "
32  
-
33  
-# if no args specified, show usage
34  
-if [ $# -le 1 ]; then
35  
-  echo $usage
36  
-  exit 1
37  
-fi
38  
-
39  
-bin=`dirname "$0"`
40  
-bin=`cd "$bin"; pwd`
41  
-
42  
-. "$bin"/hdfsproxy-config.sh
43  
-
44  
-# get arguments
45  
-startStop=$1
46  
-shift
47  
-
48  
-
49  
-if [ -f "${HDFSPROXY_CONF_DIR}/hdfsproxy-env.sh" ]; then
50  
-  . "${HDFSPROXY_CONF_DIR}/hdfsproxy-env.sh"
51  
-fi
52  
-
53  
-
54  
-if [ "$HDFSPROXY_IDENT_STRING" = "" ]; then
55  
-  export HDFSPROXY_IDENT_STRING="$USER"
56  
-fi
57  
-
58  
-
59  
-# Set default scheduling priority
60  
-if [ "$HDFSPROXY_NICENESS" = "" ]; then
61  
-    export HDFSPROXY_NICENESS=0
62  
-fi
63  
-
64  
-case $startStop in
65  
-
66  
-  (start)
67  
-    if [ "$HDFSPROXY_MASTER" != "" ]; then
68  
-      echo rsync from $HDFSPROXY_MASTER
69  
-      rsync -a -e ssh --delete --exclude=.svn --exclude='logs/*' --exclude='contrib/hod/logs/*' $HDFSPROXY_MASTER/ "$HDFSPROXY_HOME"
70  
-    fi
71  
-
72  
-    echo starting hdfsproxy tomcat server
73  
-    cd "$HDFSPROXY_HOME"
74  
-    nohup nice -n $HDFSPROXY_NICENESS "$TOMCAT_HOME_DIR"/bin/startup.sh >& /dev/null &
75  
-    sleep 1
76  
-    ;;
77  
-          
78  
-  (stop)
79  
-
80  
-    echo stopping hdfsproxy tomcat server
81  
-    cd "$HDFSPROXY_HOME"
82  
-    nohup nice -n $HDFSPROXY_NICENESS "$TOMCAT_HOME_DIR"/bin/shutdown.sh >& /dev/null &
83  
-    ;;
84  
-
85  
-  (*)
86  
-    echo $usage
87  
-    exit 1
88  
-    ;;
89  
-
90  
-esac
91  
-
92  
-
34  hdfs/src/contrib/hdfsproxy/bin/hdfsproxy-tomcat-servers.sh
... ...
@@ -1,34 +0,0 @@
1  
-#!/usr/bin/env bash
2  
-
3  
-# Licensed to the Apache Software Foundation (ASF) under one or more
4  
-# contributor license agreements.  See the NOTICE file distributed with
5  
-# this work for additional information regarding copyright ownership.
6  
-# The ASF licenses this file to You under the Apache License, Version 2.0
7  
-# (the "License"); you may not use this file except in compliance with
8  
-# the License.  You may obtain a copy of the License at
9  
-#
10  
-#     http://www.apache.org/licenses/LICENSE-2.0
11  
-#
12  
-# Unless required by applicable law or agreed to in writing, software
13  
-# distributed under the License is distributed on an "AS IS" BASIS,
14  
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  
-# See the License for the specific language governing permissions and
16  
-# limitations under the License.
17  
-
18  
-
19  
-# Run a HdfsProxy command on all slave hosts.
20  
-
21  
-usage="Usage: hdfsproxy-tomcat-servers.sh [--config confdir] [--hosts hostlistfile] [start|stop] "
22  
-
23  
-# if no args specified, show usage
24  
-if [ $# -le 1 ]; then
25  
-  echo $usage
26  
-  exit 1
27  
-fi
28  
-
29  
-bin=`dirname "$0"`
30  
-bin=`cd "$bin"; pwd`
31  
-
32  
-. $bin/hdfsproxy-config.sh
33  
-
34  
-exec "$bin/hdfsproxy-tomcat-slaves.sh" --config $HDFSPROXY_CONF_DIR cd "$HDFSPROXY_HOME" \; "$bin/hdfsproxy-tomcat-server.sh" --config $HDFSPROXY_CONF_DIR "$@"
68  hdfs/src/contrib/hdfsproxy/bin/hdfsproxy-tomcat-slaves.sh
... ...
@@ -1,68 +0,0 @@
1  
-#!/usr/bin/env bash
2  
-
3  
-# Licensed to the Apache Software Foundation (ASF) under one or more
4  
-# contributor license agreements.  See the NOTICE file distributed with
5  
-# this work for additional information regarding copyright ownership.
6  
-# The ASF licenses this file to You under the Apache License, Version 2.0
7  
-# (the "License"); you may not use this file except in compliance with
8  
-# the License.  You may obtain a copy of the License at
9  
-#
10  
-#     http://www.apache.org/licenses/LICENSE-2.0
11  
-#
12  
-# Unless required by applicable law or agreed to in writing, software
13  
-# distributed under the License is distributed on an "AS IS" BASIS,
14  
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  
-# See the License for the specific language governing permissions and
16  
-# limitations under the License.
17  
-
18  
-
19  
-# Run a shell command on all slave hosts.
20  
-#
21  
-# Environment Variables
22  
-#
23  
-#   HDFSPROXY_SLAVES    File naming remote hosts.
24  
-#     Default is ${HDFSPROXY_CONF_DIR}/hdfsproxy-hosts.
25  
-#   HDFSPROXY_CONF_DIR  Alternate conf dir. Default is ${HDFSPROXY_HOME}/conf.
26  
-#   HDFSPROXY_SLAVE_SLEEP Seconds to sleep between spawning remote commands.
27  
-#   HDFSPROXY_SSH_OPTS Options passed to ssh when running remote commands.
28  
-##
29  
-
30  
-usage="Usage: hdfsproxy-tomcat-slaves.sh [--config confdir] command..."
31  
-
32  
-# if no args specified, show usage
33  
-if [ $# -le 0 ]; then
34  
-  echo $usage
35  
-  exit 1
36  
-fi
37  
-
38  
-bin=`dirname "$0"`
39  
-bin=`cd "$bin"; pwd`
40  
-
41  
-. "$bin"/hdfsproxy-config.sh
42  
-
43  
-# If the slaves file is specified in the command line,
44  
-# then it takes precedence over the definition in 
45  
-# hdfsproxy-env.sh. Save it here.
46  
-HOSTLIST=$HDFSPROXY_SLAVES
47  
-
48  
-if [ -f "${HDFSPROXY_CONF_DIR}/hdfsproxy-env.sh" ]; then
49  
-  . "${HDFSPROXY_CONF_DIR}/hdfsproxy-env.sh"
50  
-fi
51  
-
52  
-if [ "$HOSTLIST" = "" ]; then
53  
-  if [ "$HDFSPROXY_SLAVES" = "" ]; then
54  
-    export HOSTLIST="${HDFSPROXY_CONF_DIR}/hdfsproxy-hosts"
55  
-  else
56  
-    export HOSTLIST="${HDFSPROXY_SLAVES}"
57  
-  fi
58  
-fi
59  
-
60  
-for slave in `cat "$HOSTLIST"`; do
61  
- ssh $HDFSPROXY_SSH_OPTS $slave $"${@// /\\ }" \
62  
-   2>&1 | sed "s/^/$slave: /" & 
63  
- if [ "$HDFSPROXY_SLAVE_SLEEP" != "" ]; then
64  
-   sleep $HDFSPROXY_SLAVE_SLEEP
65  
- fi
66  
-done
67  
-
68  
-wait
152  hdfs/src/contrib/hdfsproxy/bin/proxy-util
... ...
@@ -1,152 +0,0 @@
1  
-#!/usr/bin/env bash
2  
-
3  
-# Licensed to the Apache Software Foundation (ASF) under one or more
4  
-# contributor license agreements.  See the NOTICE file distributed with
5  
-# this work for additional information regarding copyright ownership.
6  
-# The ASF licenses this file to You under the Apache License, Version 2.0
7  
-# (the "License"); you may not use this file except in compliance with
8  
-# the License.  You may obtain a copy of the License at
9  
-#
10  
-#     http://www.apache.org/licenses/LICENSE-2.0
11  
-#
12  
-# Unless required by applicable law or agreed to in writing, software
13  
-# distributed under the License is distributed on an "AS IS" BASIS,
14  
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  
-# See the License for the specific language governing permissions and
16  
-# limitations under the License.
17  
-
18  
-
19  
-# The Proxy command utility script
20  
-#
21  
-# Environment Variables
22  
-#
23  
-#   JAVA_HOME        The java implementation to use.  Overrides JAVA_HOME.
24  
-#
25  
-#   HDFSPROXY_CLASSPATH Extra Java CLASSPATH entries.
26  
-#
27  
-#   HDFSPROXY_HEAPSIZE  The maximum amount of heap to use, in MB. 
28  
-#                    Default is 1000.
29  
-#
30  
-#   HDFSPROXY_OPTS      Extra Java runtime options.
31  
-#   
32  
-#   HDFSPROXY_NAMENODE_OPTS       These options are added to HDFSPROXY_OPTS 
33  
-#   HDFSPROXY_CLIENT_OPTS         when the respective command is run.
34  
-#   HDFSPROXY_{COMMAND}_OPTS etc  HDFSPROXY_JT_OPTS applies to JobTracker 
35  
-#                              for e.g.  HDFSPROXY_CLIENT_OPTS applies to 
36  
-#                              more than one command (fs, dfs, fsck, 
37  
-#                              dfsadmin etc)  
38  
-#
39  
-#   HDFSPROXY_CONF_DIR  Alternate conf dir. Default is ${HDFSPROXY_HOME}/conf.
40  
-#
41  
-#   HDFSPROXY_ROOT_LOGGER The root appender. Default is INFO,console
42  
-#
43  
-
44  
-bin=`dirname "$0"`
45  
-bin=`cd "$bin"; pwd`
46  
-
47  
-. "$bin"/hdfsproxy-config.sh
48  
-
49  
-cygwin=false
50  
-case "`uname`" in
51  
-CYGWIN*) cygwin=true;;
52  
-esac
53  
-
54  
-if [ -f "${HDFSPROXY_CONF_DIR}/hdfsproxy-env.sh" ]; then
55  
-  . "${HDFSPROXY_CONF_DIR}/hdfsproxy-env.sh"
56  
-fi
57  
-
58  
-# some Java parameters
59  
-if [ "$JAVA_HOME" != "" ]; then
60  
-  #echo "run java in $JAVA_HOME"
61  
-  JAVA_HOME=$JAVA_HOME
62  
-fi
63  
-  
64  
-if [ "$JAVA_HOME" = "" ]; then
65  
-  echo "Error: JAVA_HOME is not set."
66  
-  exit 1
67  
-fi
68  
-
69  
-JAVA=$JAVA_HOME/bin/java
70  
-JAVA_HEAP_MAX=-Xmx1000m 
71  
-
72  
-# check envvars which might override default args
73  
-if [ "$HDFSPROXY_HEAPSIZE" != "" ]; then
74  
-  #echo "run with heapsize $HDFSPROXY_HEAPSIZE"
75  
-  JAVA_HEAP_MAX="-Xmx""$HDFSPROXY_HEAPSIZE""m"
76  
-  #echo $JAVA_HEAP_MAX
77  
-fi
78  
-
79  
-# CLASSPATH initially contains $HDFSPROXY_CONF_DIR
80  
-CLASSPATH="${HADOOP_CONF_DIR}"
81  
-CLASSPATH="${CLASSPATH}:${HDFSPROXY_CONF_DIR}"
82  
-CLASSPATH=${CLASSPATH}:$JAVA_HOME/lib/tools.jar
83  
-
84  
-# for developers, add HdfsProxy classes to CLASSPATH
85  
-if [ -d "$HDFSPROXY_HOME/build/classes" ]; then
86  
-  CLASSPATH=${CLASSPATH}:$HDFSPROXY_HOME/build/classes
87  
-fi
88  
-if [ -d "$HDFSPROXY_HOME/build/web/webapps" ]; then
89  
-  CLASSPATH=${CLASSPATH}:$HDFSPROXY_HOME/build/web
90  
-fi
91  
-if [ -d "$HDFSPROXY_HOME/build/test/hdfs/classes" ]; then
92  
-  CLASSPATH=${CLASSPATH}:$HDFSPROXY_HOME/build/test/hdfs/classes
93  
-fi
94  
-
95  
-# so that filenames w/ spaces are handled correctly in loops below
96  
-IFS=
97  
-
98  
-# for releases, add hdfsproxy jar & webapps to CLASSPATH
99  
-if [ -d "$HDFSPROXY_HOME/webapps" ]; then
100  
-  CLASSPATH=${CLASSPATH}:$HDFSPROXY_HOME
101  
-fi
102  
-for f in $HDFSPROXY_HOME/hdfsproxy-*.jar; do
103  
-  CLASSPATH=${CLASSPATH}:$f;
104  
-done
105  
-
106  
-# add libs to CLASSPATH
107  
-for f in $HDFSPROXY_HOME/lib/*.jar; do
108  
-  CLASSPATH=${CLASSPATH}:$f;
109  
-done
110  
-
111  
-# add user-specified CLASSPATH last
112  
-if [ "$HDFSPROXY_CLASSPATH" != "" ]; then
113  
-  CLASSPATH=${CLASSPATH}:${HDFSPROXY_CLASSPATH}
114  
-fi
115  
-
116  
-# default log directory & file
117  
-if [ "$HDFSPROXY_LOG_DIR" = "" ]; then
118  
-  HDFSPROXY_LOG_DIR="$HDFSPROXY_HOME/logs"
119  
-fi
120  
-if [ "$HDFSPROXY_LOGFILE" = "" ]; then
121  
-  HDFSPROXY_LOGFILE='proxy-util.log'
122  
-fi
123  
-
124  
-# restore ordinary behaviour
125  
-unset IFS
126  
-
127  
-# figure out which class to run
128  
-CLASS='org.apache.hadoop.hdfsproxy.ProxyUtil'
129  
-
130  
-# cygwin path translation
131  
-if $cygwin; then
132  
-  CLASSPATH=`cygpath -p -w "$CLASSPATH"`
133  
-  HDFSPROXY_HOME=`cygpath -d "$HDFSPROXY_HOME"`
134  
-  HDFSPROXY_LOG_DIR=`cygpath -d "$HDFSPROXY_LOG_DIR"`
135  
-fi
136  
-
137  
-# cygwin path translation
138  
-if $cygwin; then
139  
-  JAVA_LIBRARY_PATH=`cygpath -p "$JAVA_LIBRARY_PATH"`
140  
-fi
141  
-
142  
-HDFSPROXY_OPTS="$HDFSPROXY_OPTS -Dhdfsproxy.log.dir=$HDFSPROXY_LOG_DIR"
143  
-HDFSPROXY_OPTS="$HDFSPROXY_OPTS -Dhdfsproxy.log.file=$HDFSPROXY_LOGFILE"
144  
-HDFSPROXY_OPTS="$HDFSPROXY_OPTS -Dhdfsproxy.home.dir=$HDFSPROXY_HOME"
145  
-HDFSPROXY_OPTS="$HDFSPROXY_OPTS -Dhdfsproxy.id.str=$HDFSPROXY_IDENT_STRING"
146  
-HDFSPROXY_OPTS="$HDFSPROXY_OPTS -Dhdfsproxy.root.logger=${HDFSPROXY_ROOT_LOGGER:-INFO,console}"
147  
-if [ "x$JAVA_LIBRARY_PATH" != "x" ]; then
148  
-  HDFSPROXY_OPTS="$HDFSPROXY_OPTS -Djava.library.path=$JAVA_LIBRARY_PATH"
149  
-fi  
150  
-
151  
-# run it
152  
-exec "$JAVA" $JAVA_HEAP_MAX $HDFSPROXY_OPTS -classpath "$CLASSPATH" $CLASS "$@"
36  hdfs/src/contrib/hdfsproxy/bin/start-hdfsproxy-tomcat.sh
... ...
@@ -1,36 +0,0 @@
1  
-#!/usr/bin/env bash
2  
-
3  
-# Licensed to the Apache Software Foundation (ASF) under one or more
4  
-# contributor license agreements.  See the NOTICE file distributed with
5  
-# this work for additional information regarding copyright ownership.
6  
-# The ASF licenses this file to You under the Apache License, Version 2.0
7  
-# (the "License"); you may not use this file except in compliance with
8  
-# the License.  You may obtain a copy of the License at
9  
-#
10  
-#     http://www.apache.org/licenses/LICENSE-2.0
11  
-#
12  
-# Unless required by applicable law or agreed to in writing, software
13  
-# distributed under the License is distributed on an "AS IS" BASIS,
14  
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  
-# See the License for the specific language governing permissions and
16  
-# limitations under the License.
17  
-
18  
-
19  
-# Start hdfsproxy tomcat servers.
20  
-# Run this on master node.
21  
-
22  
-usage="Usage: start-hdfsproxy-tomcat.sh"
23  
-
24  
-bin=`dirname "$0"`
25  
-bin=`cd "$bin"; pwd`
26  
-
27  
-. "$bin"/hdfsproxy-config.sh
28  
-
29  
-# get arguments
30  
-if [ $# -ge 1 ]; then
31  
-  echo $usage
32  
-  exit 1
33  
-fi
34  
-
35  
-# start hdfsproxy tomcat servers
36  
-"$bin"/hdfsproxy-tomcat-servers.sh --config $HDFSPROXY_CONF_DIR --hosts hdfsproxy-hosts start
37  hdfs/src/contrib/hdfsproxy/bin/start-hdfsproxy.sh
... ...
@@ -1,37 +0,0 @@
1  
-#!/usr/bin/env bash
2  
-
3  
-# Licensed to the Apache Software Foundation (ASF) under one or more
4  
-# contributor license agreements.  See the NOTICE file distributed with
5  
-# this work for additional information regarding copyright ownership.
6  
-# The ASF licenses this file to You under the Apache License, Version 2.0
7  
-# (the "License"); you may not use this file except in compliance with
8  
-# the License.  You may obtain a copy of the License at
9  
-#
10  
-#     http://www.apache.org/licenses/LICENSE-2.0
11  
-#
12  
-# Unless required by applicable law or agreed to in writing, software
13  
-# distributed under the License is distributed on an "AS IS" BASIS,
14  
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  
-# See the License for the specific language governing permissions and
16  
-# limitations under the License.
17  
-
18  
-
19  
-# Start hdfsproxy daemons.
20  
-# Run this on master node.
21  
-
22  
-usage="Usage: start-hdfsproxy.sh"
23  
-
24  
-bin=`dirname "$0"`
25  
-bin=`cd "$bin"; pwd`
26  
-
27  
-. "$bin"/hdfsproxy-config.sh
28  
-
29  
-# get arguments
30