source: proiecte/HadoopJUnit/hadoop-0.20.1/docs/api/org/apache/hadoop/util/Shell.html @ 120

Last change on this file since 120 was 120, checked in by (none), 14 years ago

Added the mail files for the Hadoop JUNit Project

  • Property svn:executable set to *
File size: 34.1 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<!--NewPage-->
3<HTML>
4<HEAD>
5<!-- Generated by javadoc (build 1.6.0_07) on Tue Sep 01 20:56:55 UTC 2009 -->
6<TITLE>
7Shell (Hadoop 0.20.1 API)
8</TITLE>
9
10<META NAME="date" CONTENT="2009-09-01">
11
12<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
13
14<SCRIPT type="text/javascript">
15function windowTitle()
16{
17    if (location.href.indexOf('is-external=true') == -1) {
18        parent.document.title="Shell (Hadoop 0.20.1 API)";
19    }
20}
21</SCRIPT>
22<NOSCRIPT>
23</NOSCRIPT>
24
25</HEAD>
26
27<BODY BGCOLOR="white" onload="windowTitle();">
28<HR>
29
30
31<!-- ========= START OF TOP NAVBAR ======= -->
32<A NAME="navbar_top"><!-- --></A>
33<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
34<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
35<TR>
36<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
37<A NAME="navbar_top_firstrow"><!-- --></A>
38<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
39  <TR ALIGN="center" VALIGN="top">
40  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
41  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
42  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
43  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/Shell.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
44  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
45  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
46  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
47  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
48  </TR>
49</TABLE>
50</TD>
51<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
52</EM>
53</TD>
54</TR>
55
56<TR>
57<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
58&nbsp;<A HREF="../../../../org/apache/hadoop/util/ServletUtil.html" title="class in org.apache.hadoop.util"><B>PREV CLASS</B></A>&nbsp;
59&nbsp;<A HREF="../../../../org/apache/hadoop/util/Shell.ExitCodeException.html" title="class in org.apache.hadoop.util"><B>NEXT CLASS</B></A></FONT></TD>
60<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
61  <A HREF="../../../../index.html?org/apache/hadoop/util/Shell.html" target="_top"><B>FRAMES</B></A>  &nbsp;
62&nbsp;<A HREF="Shell.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
63&nbsp;<SCRIPT type="text/javascript">
64  <!--
65  if(window==top) {
66    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
67  }
68  //-->
69</SCRIPT>
70<NOSCRIPT>
71  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
72</NOSCRIPT>
73
74
75</FONT></TD>
76</TR>
77<TR>
78<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
79  SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
80<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
81DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
82</TR>
83</TABLE>
84<A NAME="skip-navbar_top"></A>
85<!-- ========= END OF TOP NAVBAR ========= -->
86
87<HR>
88<!-- ======== START OF CLASS DATA ======== -->
89<H2>
90<FONT SIZE="-1">
91org.apache.hadoop.util</FONT>
92<BR>
93Class Shell</H2>
94<PRE>
95<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
96  <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.hadoop.util.Shell</B>
97</PRE>
98<DL>
99<DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../../org/apache/hadoop/fs/DF.html" title="class in org.apache.hadoop.fs">DF</A>, <A HREF="../../../../org/apache/hadoop/fs/DU.html" title="class in org.apache.hadoop.fs">DU</A>, <A HREF="../../../../org/apache/hadoop/util/Shell.ShellCommandExecutor.html" title="class in org.apache.hadoop.util">Shell.ShellCommandExecutor</A></DD>
100</DL>
101<HR>
102<DL>
103<DT><PRE>public abstract class <B>Shell</B><DT>extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL>
104</PRE>
105
106<P>
107A base class for running a Unix command.
108 
109 <code>Shell</code> can be used to run unix commands like <code>du</code> or
110 <code>df</code>. It also offers facilities to gate commands by
111 time-intervals.
112<P>
113
114<P>
115<HR>
116
117<P>
118<!-- ======== NESTED CLASS SUMMARY ======== -->
119
120<A NAME="nested_class_summary"><!-- --></A>
121<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
122<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
123<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
124<B>Nested Class Summary</B></FONT></TH>
125</TR>
126<TR BGCOLOR="white" CLASS="TableRowColor">
127<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
128<CODE>static&nbsp;class</CODE></FONT></TD>
129<TD><CODE><B><A HREF="../../../../org/apache/hadoop/util/Shell.ExitCodeException.html" title="class in org.apache.hadoop.util">Shell.ExitCodeException</A></B></CODE>
130
131<BR>
132&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This is an IOException with exit code added.</TD>
133</TR>
134<TR BGCOLOR="white" CLASS="TableRowColor">
135<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
136<CODE>static&nbsp;class</CODE></FONT></TD>
137<TD><CODE><B><A HREF="../../../../org/apache/hadoop/util/Shell.ShellCommandExecutor.html" title="class in org.apache.hadoop.util">Shell.ShellCommandExecutor</A></B></CODE>
138
139<BR>
140&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A simple shell command executor.</TD>
141</TR>
142</TABLE>
143&nbsp;<!-- =========== FIELD SUMMARY =========== -->
144
145<A NAME="field_summary"><!-- --></A>
146<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
147<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
148<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
149<B>Field Summary</B></FONT></TH>
150</TR>
151<TR BGCOLOR="white" CLASS="TableRowColor">
152<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
153<CODE>static&nbsp;org.apache.commons.logging.Log</CODE></FONT></TD>
154<TD><CODE><B><A HREF="../../../../org/apache/hadoop/util/Shell.html#LOG">LOG</A></B></CODE>
155
156<BR>
157&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
158</TR>
159<TR BGCOLOR="white" CLASS="TableRowColor">
160<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
161<CODE>static&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
162<TD><CODE><B><A HREF="../../../../org/apache/hadoop/util/Shell.html#SET_GROUP_COMMAND">SET_GROUP_COMMAND</A></B></CODE>
163
164<BR>
165&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
166</TR>
167<TR BGCOLOR="white" CLASS="TableRowColor">
168<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
169<CODE>static&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
170<TD><CODE><B><A HREF="../../../../org/apache/hadoop/util/Shell.html#SET_OWNER_COMMAND">SET_OWNER_COMMAND</A></B></CODE>
171
172<BR>
173&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a Unix command to set owner</TD>
174</TR>
175<TR BGCOLOR="white" CLASS="TableRowColor">
176<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
177<CODE>static&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
178<TD><CODE><B><A HREF="../../../../org/apache/hadoop/util/Shell.html#SET_PERMISSION_COMMAND">SET_PERMISSION_COMMAND</A></B></CODE>
179
180<BR>
181&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a Unix command to set permission</TD>
182</TR>
183<TR BGCOLOR="white" CLASS="TableRowColor">
184<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
185<CODE>static&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
186<TD><CODE><B><A HREF="../../../../org/apache/hadoop/util/Shell.html#USER_NAME_COMMAND">USER_NAME_COMMAND</A></B></CODE>
187
188<BR>
189&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a Unix command to get the current user's name</TD>
190</TR>
191<TR BGCOLOR="white" CLASS="TableRowColor">
192<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
193<CODE>static&nbsp;boolean</CODE></FONT></TD>
194<TD><CODE><B><A HREF="../../../../org/apache/hadoop/util/Shell.html#WINDOWS">WINDOWS</A></B></CODE>
195
196<BR>
197&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set to true on Windows platforms</TD>
198</TR>
199</TABLE>
200&nbsp;
201<!-- ======== CONSTRUCTOR SUMMARY ======== -->
202
203<A NAME="constructor_summary"><!-- --></A>
204<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
205<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
206<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
207<B>Constructor Summary</B></FONT></TH>
208</TR>
209<TR BGCOLOR="white" CLASS="TableRowColor">
210<TD><CODE><B><A HREF="../../../../org/apache/hadoop/util/Shell.html#Shell()">Shell</A></B>()</CODE>
211
212<BR>
213&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
214</TR>
215<TR BGCOLOR="white" CLASS="TableRowColor">
216<TD><CODE><B><A HREF="../../../../org/apache/hadoop/util/Shell.html#Shell(long)">Shell</A></B>(long&nbsp;interval)</CODE>
217
218<BR>
219&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
220</TR>
221</TABLE>
222&nbsp;
223<!-- ========== METHOD SUMMARY =========== -->
224
225<A NAME="method_summary"><!-- --></A>
226<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
227<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
228<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
229<B>Method Summary</B></FONT></TH>
230</TR>
231<TR BGCOLOR="white" CLASS="TableRowColor">
232<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
233<CODE>static&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
234<TD><CODE><B><A HREF="../../../../org/apache/hadoop/util/Shell.html#execCommand(java.util.Map, java.lang.String...)">execCommand</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</A>&lt;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>,<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&gt;&nbsp;env,
235            <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>...&nbsp;cmd)</CODE>
236
237<BR>
238&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Static method to execute a shell command.</TD>
239</TR>
240<TR BGCOLOR="white" CLASS="TableRowColor">
241<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
242<CODE>static&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
243<TD><CODE><B><A HREF="../../../../org/apache/hadoop/util/Shell.html#execCommand(java.lang.String...)">execCommand</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>...&nbsp;cmd)</CODE>
244
245<BR>
246&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Static method to execute a shell command.</TD>
247</TR>
248<TR BGCOLOR="white" CLASS="TableRowColor">
249<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
250<CODE>protected abstract &nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>[]</CODE></FONT></TD>
251<TD><CODE><B><A HREF="../../../../org/apache/hadoop/util/Shell.html#getExecString()">getExecString</A></B>()</CODE>
252
253<BR>
254&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return an array containing the command name & its parameters</TD>
255</TR>
256<TR BGCOLOR="white" CLASS="TableRowColor">
257<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
258<CODE>&nbsp;int</CODE></FONT></TD>
259<TD><CODE><B><A HREF="../../../../org/apache/hadoop/util/Shell.html#getExitCode()">getExitCode</A></B>()</CODE>
260
261<BR>
262&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;get the exit code</TD>
263</TR>
264<TR BGCOLOR="white" CLASS="TableRowColor">
265<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
266<CODE>static&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>[]</CODE></FONT></TD>
267<TD><CODE><B><A HREF="../../../../org/apache/hadoop/util/Shell.html#getGET_PERMISSION_COMMAND()">getGET_PERMISSION_COMMAND</A></B>()</CODE>
268
269<BR>
270&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return a Unix command to get permission information.</TD>
271</TR>
272<TR BGCOLOR="white" CLASS="TableRowColor">
273<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
274<CODE>static&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>[]</CODE></FONT></TD>
275<TD><CODE><B><A HREF="../../../../org/apache/hadoop/util/Shell.html#getGROUPS_COMMAND()">getGROUPS_COMMAND</A></B>()</CODE>
276
277<BR>
278&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a Unix command to get the current user's groups list</TD>
279</TR>
280<TR BGCOLOR="white" CLASS="TableRowColor">
281<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
282<CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Process.html?is-external=true" title="class or interface in java.lang">Process</A></CODE></FONT></TD>
283<TD><CODE><B><A HREF="../../../../org/apache/hadoop/util/Shell.html#getProcess()">getProcess</A></B>()</CODE>
284
285<BR>
286&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;get the current sub-process executing the given command</TD>
287</TR>
288<TR BGCOLOR="white" CLASS="TableRowColor">
289<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
290<CODE>static&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>[]</CODE></FONT></TD>
291<TD><CODE><B><A HREF="../../../../org/apache/hadoop/util/Shell.html#getUlimitMemoryCommand(org.apache.hadoop.conf.Configuration)">getUlimitMemoryCommand</A></B>(<A HREF="../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</A>&nbsp;conf)</CODE>
292
293<BR>
294&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the Unix command for setting the maximum virtual memory available
295 to a given child process.</TD>
296</TR>
297<TR BGCOLOR="white" CLASS="TableRowColor">
298<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
299<CODE>protected abstract &nbsp;void</CODE></FONT></TD>
300<TD><CODE><B><A HREF="../../../../org/apache/hadoop/util/Shell.html#parseExecResult(java.io.BufferedReader)">parseExecResult</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/io/BufferedReader.html?is-external=true" title="class or interface in java.io">BufferedReader</A>&nbsp;lines)</CODE>
301
302<BR>
303&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Parse the execution result</TD>
304</TR>
305<TR BGCOLOR="white" CLASS="TableRowColor">
306<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
307<CODE>protected &nbsp;void</CODE></FONT></TD>
308<TD><CODE><B><A HREF="../../../../org/apache/hadoop/util/Shell.html#run()">run</A></B>()</CODE>
309
310<BR>
311&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;check to see if a command needs to be executed and execute if needed</TD>
312</TR>
313<TR BGCOLOR="white" CLASS="TableRowColor">
314<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
315<CODE>protected &nbsp;void</CODE></FONT></TD>
316<TD><CODE><B><A HREF="../../../../org/apache/hadoop/util/Shell.html#setEnvironment(java.util.Map)">setEnvironment</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</A>&lt;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>,<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&gt;&nbsp;env)</CODE>
317
318<BR>
319&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set the environment for the command</TD>
320</TR>
321<TR BGCOLOR="white" CLASS="TableRowColor">
322<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
323<CODE>protected &nbsp;void</CODE></FONT></TD>
324<TD><CODE><B><A HREF="../../../../org/apache/hadoop/util/Shell.html#setWorkingDirectory(java.io.File)">setWorkingDirectory</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</A>&nbsp;dir)</CODE>
325
326<BR>
327&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set the working directory</TD>
328</TR>
329</TABLE>
330&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
331<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
332<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
333<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
334</TR>
335<TR BGCOLOR="white" CLASS="TableRowColor">
336<TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
337</TR>
338</TABLE>
339&nbsp;
340<P>
341
342<!-- ============ FIELD DETAIL =========== -->
343
344<A NAME="field_detail"><!-- --></A>
345<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
346<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
347<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
348<B>Field Detail</B></FONT></TH>
349</TR>
350</TABLE>
351
352<A NAME="LOG"><!-- --></A><H3>
353LOG</H3>
354<PRE>
355public static final org.apache.commons.logging.Log <B>LOG</B></PRE>
356<DL>
357<DL>
358</DL>
359</DL>
360<HR>
361
362<A NAME="USER_NAME_COMMAND"><!-- --></A><H3>
363USER_NAME_COMMAND</H3>
364<PRE>
365public static final <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>USER_NAME_COMMAND</B></PRE>
366<DL>
367<DD>a Unix command to get the current user's name
368<P>
369<DL>
370<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.apache.hadoop.util.Shell.USER_NAME_COMMAND">Constant Field Values</A></DL>
371</DL>
372<HR>
373
374<A NAME="SET_PERMISSION_COMMAND"><!-- --></A><H3>
375SET_PERMISSION_COMMAND</H3>
376<PRE>
377public static final <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>SET_PERMISSION_COMMAND</B></PRE>
378<DL>
379<DD>a Unix command to set permission
380<P>
381<DL>
382<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.apache.hadoop.util.Shell.SET_PERMISSION_COMMAND">Constant Field Values</A></DL>
383</DL>
384<HR>
385
386<A NAME="SET_OWNER_COMMAND"><!-- --></A><H3>
387SET_OWNER_COMMAND</H3>
388<PRE>
389public static final <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>SET_OWNER_COMMAND</B></PRE>
390<DL>
391<DD>a Unix command to set owner
392<P>
393<DL>
394<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.apache.hadoop.util.Shell.SET_OWNER_COMMAND">Constant Field Values</A></DL>
395</DL>
396<HR>
397
398<A NAME="SET_GROUP_COMMAND"><!-- --></A><H3>
399SET_GROUP_COMMAND</H3>
400<PRE>
401public static final <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>SET_GROUP_COMMAND</B></PRE>
402<DL>
403<DL>
404<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.apache.hadoop.util.Shell.SET_GROUP_COMMAND">Constant Field Values</A></DL>
405</DL>
406<HR>
407
408<A NAME="WINDOWS"><!-- --></A><H3>
409WINDOWS</H3>
410<PRE>
411public static final boolean <B>WINDOWS</B></PRE>
412<DL>
413<DD>Set to true on Windows platforms
414<P>
415<DL>
416</DL>
417</DL>
418
419<!-- ========= CONSTRUCTOR DETAIL ======== -->
420
421<A NAME="constructor_detail"><!-- --></A>
422<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
423<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
424<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
425<B>Constructor Detail</B></FONT></TH>
426</TR>
427</TABLE>
428
429<A NAME="Shell()"><!-- --></A><H3>
430Shell</H3>
431<PRE>
432public <B>Shell</B>()</PRE>
433<DL>
434</DL>
435<HR>
436
437<A NAME="Shell(long)"><!-- --></A><H3>
438Shell</H3>
439<PRE>
440public <B>Shell</B>(long&nbsp;interval)</PRE>
441<DL>
442<DL>
443<DT><B>Parameters:</B><DD><CODE>interval</CODE> - the minimum duration to wait before re-executing the
444        command.</DL>
445</DL>
446
447<!-- ============ METHOD DETAIL ========== -->
448
449<A NAME="method_detail"><!-- --></A>
450<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
451<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
452<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
453<B>Method Detail</B></FONT></TH>
454</TR>
455</TABLE>
456
457<A NAME="getGROUPS_COMMAND()"><!-- --></A><H3>
458getGROUPS_COMMAND</H3>
459<PRE>
460public static <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>[] <B>getGROUPS_COMMAND</B>()</PRE>
461<DL>
462<DD>a Unix command to get the current user's groups list
463<P>
464<DD><DL>
465</DL>
466</DD>
467</DL>
468<HR>
469
470<A NAME="getGET_PERMISSION_COMMAND()"><!-- --></A><H3>
471getGET_PERMISSION_COMMAND</H3>
472<PRE>
473public static <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>[] <B>getGET_PERMISSION_COMMAND</B>()</PRE>
474<DL>
475<DD>Return a Unix command to get permission information.
476<P>
477<DD><DL>
478</DL>
479</DD>
480</DL>
481<HR>
482
483<A NAME="getUlimitMemoryCommand(org.apache.hadoop.conf.Configuration)"><!-- --></A><H3>
484getUlimitMemoryCommand</H3>
485<PRE>
486public static <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>[] <B>getUlimitMemoryCommand</B>(<A HREF="../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</A>&nbsp;conf)</PRE>
487<DL>
488<DD>Get the Unix command for setting the maximum virtual memory available
489 to a given child process. This is only relevant when we are forking a
490 process from within the <A HREF="../../../../org/apache/hadoop/mapred/Mapper.html" title="interface in org.apache.hadoop.mapred"><CODE>Mapper</CODE></A> or the
491 <A HREF="../../../../org/apache/hadoop/mapred/Reducer.html" title="interface in org.apache.hadoop.mapred"><CODE>Reducer</CODE></A> implementations
492 e.g. <a href="../../../../org/apache/hadoop/mapred/pipes/package-summary.html">Hadoop Pipes</a> 
493 or <a href="../../../../org/apache/hadoop/streaming/package-summary.html">Hadoop Streaming</a>.
494 
495 It also checks to ensure that we are running on a *nix platform else
496 (e.g. in Cygwin/Windows) it returns <code>null</code>.
497<P>
498<DD><DL>
499<DT><B>Parameters:</B><DD><CODE>conf</CODE> - configuration
500<DT><B>Returns:</B><DD>a <code>String[]</code> with the ulimit command arguments or
501         <code>null</code> if we are running on a non *nix platform or
502         if the limit is unspecified.</DL>
503</DD>
504</DL>
505<HR>
506
507<A NAME="setEnvironment(java.util.Map)"><!-- --></A><H3>
508setEnvironment</H3>
509<PRE>
510protected void <B>setEnvironment</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</A>&lt;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>,<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&gt;&nbsp;env)</PRE>
511<DL>
512<DD>set the environment for the command
513<P>
514<DD><DL>
515<DT><B>Parameters:</B><DD><CODE>env</CODE> - Mapping of environment variables</DL>
516</DD>
517</DL>
518<HR>
519
520<A NAME="setWorkingDirectory(java.io.File)"><!-- --></A><H3>
521setWorkingDirectory</H3>
522<PRE>
523protected void <B>setWorkingDirectory</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</A>&nbsp;dir)</PRE>
524<DL>
525<DD>set the working directory
526<P>
527<DD><DL>
528<DT><B>Parameters:</B><DD><CODE>dir</CODE> - The directory where the command would be executed</DL>
529</DD>
530</DL>
531<HR>
532
533<A NAME="run()"><!-- --></A><H3>
534run</H3>
535<PRE>
536protected void <B>run</B>()
537            throws <A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></PRE>
538<DL>
539<DD>check to see if a command needs to be executed and execute if needed
540<P>
541<DD><DL>
542
543<DT><B>Throws:</B>
544<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE></DL>
545</DD>
546</DL>
547<HR>
548
549<A NAME="getExecString()"><!-- --></A><H3>
550getExecString</H3>
551<PRE>
552protected abstract <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>[] <B>getExecString</B>()</PRE>
553<DL>
554<DD>return an array containing the command name & its parameters
555<P>
556<DD><DL>
557</DL>
558</DD>
559</DL>
560<HR>
561
562<A NAME="parseExecResult(java.io.BufferedReader)"><!-- --></A><H3>
563parseExecResult</H3>
564<PRE>
565protected abstract void <B>parseExecResult</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/io/BufferedReader.html?is-external=true" title="class or interface in java.io">BufferedReader</A>&nbsp;lines)
566                                 throws <A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></PRE>
567<DL>
568<DD>Parse the execution result
569<P>
570<DD><DL>
571
572<DT><B>Throws:</B>
573<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE></DL>
574</DD>
575</DL>
576<HR>
577
578<A NAME="getProcess()"><!-- --></A><H3>
579getProcess</H3>
580<PRE>
581public <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Process.html?is-external=true" title="class or interface in java.lang">Process</A> <B>getProcess</B>()</PRE>
582<DL>
583<DD>get the current sub-process executing the given command
584<P>
585<DD><DL>
586
587<DT><B>Returns:</B><DD>process executing the command</DL>
588</DD>
589</DL>
590<HR>
591
592<A NAME="getExitCode()"><!-- --></A><H3>
593getExitCode</H3>
594<PRE>
595public int <B>getExitCode</B>()</PRE>
596<DL>
597<DD>get the exit code
598<P>
599<DD><DL>
600
601<DT><B>Returns:</B><DD>the exit code of the process</DL>
602</DD>
603</DL>
604<HR>
605
606<A NAME="execCommand(java.lang.String...)"><!-- --></A><H3>
607execCommand</H3>
608<PRE>
609public static <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>execCommand</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>...&nbsp;cmd)
610                          throws <A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></PRE>
611<DL>
612<DD>Static method to execute a shell command.
613 Covers most of the simple cases without requiring the user to implement 
614 the <code>Shell</code> interface.
615<P>
616<DD><DL>
617<DT><B>Parameters:</B><DD><CODE>cmd</CODE> - shell command to execute.
618<DT><B>Returns:</B><DD>the output of the executed command.
619<DT><B>Throws:</B>
620<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE></DL>
621</DD>
622</DL>
623<HR>
624
625<A NAME="execCommand(java.util.Map, java.lang.String...)"><!-- --></A><H3>
626execCommand</H3>
627<PRE>
628public static <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>execCommand</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</A>&lt;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>,<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&gt;&nbsp;env,
629                                 <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>...&nbsp;cmd)
630                          throws <A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></PRE>
631<DL>
632<DD>Static method to execute a shell command.
633 Covers most of the simple cases without requiring the user to implement 
634 the <code>Shell</code> interface.
635<P>
636<DD><DL>
637<DT><B>Parameters:</B><DD><CODE>env</CODE> - the map of environment key=value<DD><CODE>cmd</CODE> - shell command to execute.
638<DT><B>Returns:</B><DD>the output of the executed command.
639<DT><B>Throws:</B>
640<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE></DL>
641</DD>
642</DL>
643<!-- ========= END OF CLASS DATA ========= -->
644<HR>
645
646
647<!-- ======= START OF BOTTOM NAVBAR ====== -->
648<A NAME="navbar_bottom"><!-- --></A>
649<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
650<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
651<TR>
652<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
653<A NAME="navbar_bottom_firstrow"><!-- --></A>
654<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
655  <TR ALIGN="center" VALIGN="top">
656  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
657  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
658  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
659  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/Shell.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
660  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
661  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
662  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
663  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
664  </TR>
665</TABLE>
666</TD>
667<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
668</EM>
669</TD>
670</TR>
671
672<TR>
673<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
674&nbsp;<A HREF="../../../../org/apache/hadoop/util/ServletUtil.html" title="class in org.apache.hadoop.util"><B>PREV CLASS</B></A>&nbsp;
675&nbsp;<A HREF="../../../../org/apache/hadoop/util/Shell.ExitCodeException.html" title="class in org.apache.hadoop.util"><B>NEXT CLASS</B></A></FONT></TD>
676<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
677  <A HREF="../../../../index.html?org/apache/hadoop/util/Shell.html" target="_top"><B>FRAMES</B></A>  &nbsp;
678&nbsp;<A HREF="Shell.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
679&nbsp;<SCRIPT type="text/javascript">
680  <!--
681  if(window==top) {
682    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
683  }
684  //-->
685</SCRIPT>
686<NOSCRIPT>
687  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
688</NOSCRIPT>
689
690
691</FONT></TD>
692</TR>
693<TR>
694<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
695  SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
696<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
697DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
698</TR>
699</TABLE>
700<A NAME="skip-navbar_bottom"></A>
701<!-- ======== END OF BOTTOM NAVBAR ======= -->
702
703<HR>
704Copyright &copy; 2009 The Apache Software Foundation
705</BODY>
706</HTML>
Note: See TracBrowser for help on using the repository browser.