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:54 UTC 2009 --> |
---|
6 | <TITLE> |
---|
7 | TFile.Writer (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"> |
---|
15 | function windowTitle() |
---|
16 | { |
---|
17 | if (location.href.indexOf('is-external=true') == -1) { |
---|
18 | parent.document.title="TFile.Writer (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> </TD> |
---|
41 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
---|
42 | <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
---|
43 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/TFile.Writer.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> |
---|
44 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
---|
45 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
---|
46 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
---|
47 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </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 | <A HREF="../../../../../../org/apache/hadoop/io/file/tfile/TFile.Reader.Scanner.Entry.html" title="class in org.apache.hadoop.io.file.tfile"><B>PREV CLASS</B></A> |
---|
59 | <A HREF="../../../../../../org/apache/hadoop/io/file/tfile/Utils.html" title="class in org.apache.hadoop.io.file.tfile"><B>NEXT CLASS</B></A></FONT></TD> |
---|
60 | <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
---|
61 | <A HREF="../../../../../../index.html?org/apache/hadoop/io/file/tfile/TFile.Writer.html" target="_top"><B>FRAMES</B></A> |
---|
62 | <A HREF="TFile.Writer.html" target="_top"><B>NO FRAMES</B></A> |
---|
63 | <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: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> |
---|
80 | <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
---|
81 | DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <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"> |
---|
91 | org.apache.hadoop.io.file.tfile</FONT> |
---|
92 | <BR> |
---|
93 | Class TFile.Writer</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.io.file.tfile.TFile.Writer</B> |
---|
97 | </PRE> |
---|
98 | <DL> |
---|
99 | <DT><B>All Implemented Interfaces:</B> <DD><A HREF="http://java.sun.com/javase/6/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io">Closeable</A></DD> |
---|
100 | </DL> |
---|
101 | <DL> |
---|
102 | <DT><B>Enclosing class:</B><DD><A HREF="../../../../../../org/apache/hadoop/io/file/tfile/TFile.html" title="class in org.apache.hadoop.io.file.tfile">TFile</A></DD> |
---|
103 | </DL> |
---|
104 | <HR> |
---|
105 | <DL> |
---|
106 | <DT><PRE>public static class <B>TFile.Writer</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><DT>implements <A HREF="http://java.sun.com/javase/6/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io">Closeable</A></DL> |
---|
107 | </PRE> |
---|
108 | |
---|
109 | <P> |
---|
110 | TFile Writer. |
---|
111 | <P> |
---|
112 | |
---|
113 | <P> |
---|
114 | <HR> |
---|
115 | |
---|
116 | <P> |
---|
117 | |
---|
118 | <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
---|
119 | |
---|
120 | <A NAME="constructor_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>Constructor Summary</B></FONT></TH> |
---|
125 | </TR> |
---|
126 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
127 | <TD><CODE><B><A HREF="../../../../../../org/apache/hadoop/io/file/tfile/TFile.Writer.html#TFile.Writer(org.apache.hadoop.fs.FSDataOutputStream, int, java.lang.String, java.lang.String, org.apache.hadoop.conf.Configuration)">TFile.Writer</A></B>(<A HREF="../../../../../../org/apache/hadoop/fs/FSDataOutputStream.html" title="class in org.apache.hadoop.fs">FSDataOutputStream</A> fsdos, |
---|
128 | int minBlockSize, |
---|
129 | <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> compressName, |
---|
130 | <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> comparator, |
---|
131 | <A HREF="../../../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</A> conf)</CODE> |
---|
132 | |
---|
133 | <BR> |
---|
134 | Constructor</TD> |
---|
135 | </TR> |
---|
136 | </TABLE> |
---|
137 | |
---|
138 | <!-- ========== METHOD SUMMARY =========== --> |
---|
139 | |
---|
140 | <A NAME="method_summary"><!-- --></A> |
---|
141 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
142 | <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
---|
143 | <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
---|
144 | <B>Method Summary</B></FONT></TH> |
---|
145 | </TR> |
---|
146 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
147 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
148 | <CODE> void</CODE></FONT></TD> |
---|
149 | <TD><CODE><B><A HREF="../../../../../../org/apache/hadoop/io/file/tfile/TFile.Writer.html#append(byte[], byte[])">append</A></B>(byte[] key, |
---|
150 | byte[] value)</CODE> |
---|
151 | |
---|
152 | <BR> |
---|
153 | Adding a new key-value pair to the TFile.</TD> |
---|
154 | </TR> |
---|
155 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
156 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
157 | <CODE> void</CODE></FONT></TD> |
---|
158 | <TD><CODE><B><A HREF="../../../../../../org/apache/hadoop/io/file/tfile/TFile.Writer.html#append(byte[], int, int, byte[], int, int)">append</A></B>(byte[] key, |
---|
159 | int koff, |
---|
160 | int klen, |
---|
161 | byte[] value, |
---|
162 | int voff, |
---|
163 | int vlen)</CODE> |
---|
164 | |
---|
165 | <BR> |
---|
166 | Adding a new key-value pair to TFile.</TD> |
---|
167 | </TR> |
---|
168 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
169 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
170 | <CODE> void</CODE></FONT></TD> |
---|
171 | <TD><CODE><B><A HREF="../../../../../../org/apache/hadoop/io/file/tfile/TFile.Writer.html#close()">close</A></B>()</CODE> |
---|
172 | |
---|
173 | <BR> |
---|
174 | Close the Writer.</TD> |
---|
175 | </TR> |
---|
176 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
177 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
178 | <CODE> <A HREF="http://java.sun.com/javase/6/docs/api/java/io/DataOutputStream.html?is-external=true" title="class or interface in java.io">DataOutputStream</A></CODE></FONT></TD> |
---|
179 | <TD><CODE><B><A HREF="../../../../../../org/apache/hadoop/io/file/tfile/TFile.Writer.html#prepareAppendKey(int)">prepareAppendKey</A></B>(int length)</CODE> |
---|
180 | |
---|
181 | <BR> |
---|
182 | Obtain an output stream for writing a key into TFile.</TD> |
---|
183 | </TR> |
---|
184 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
185 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
186 | <CODE> <A HREF="http://java.sun.com/javase/6/docs/api/java/io/DataOutputStream.html?is-external=true" title="class or interface in java.io">DataOutputStream</A></CODE></FONT></TD> |
---|
187 | <TD><CODE><B><A HREF="../../../../../../org/apache/hadoop/io/file/tfile/TFile.Writer.html#prepareAppendValue(int)">prepareAppendValue</A></B>(int length)</CODE> |
---|
188 | |
---|
189 | <BR> |
---|
190 | Obtain an output stream for writing a value into TFile.</TD> |
---|
191 | </TR> |
---|
192 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
193 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
194 | <CODE> <A HREF="http://java.sun.com/javase/6/docs/api/java/io/DataOutputStream.html?is-external=true" title="class or interface in java.io">DataOutputStream</A></CODE></FONT></TD> |
---|
195 | <TD><CODE><B><A HREF="../../../../../../org/apache/hadoop/io/file/tfile/TFile.Writer.html#prepareMetaBlock(java.lang.String)">prepareMetaBlock</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> name)</CODE> |
---|
196 | |
---|
197 | <BR> |
---|
198 | Obtain an output stream for creating a meta block.</TD> |
---|
199 | </TR> |
---|
200 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
201 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
202 | <CODE> <A HREF="http://java.sun.com/javase/6/docs/api/java/io/DataOutputStream.html?is-external=true" title="class or interface in java.io">DataOutputStream</A></CODE></FONT></TD> |
---|
203 | <TD><CODE><B><A HREF="../../../../../../org/apache/hadoop/io/file/tfile/TFile.Writer.html#prepareMetaBlock(java.lang.String, java.lang.String)">prepareMetaBlock</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> name, |
---|
204 | <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> compressName)</CODE> |
---|
205 | |
---|
206 | <BR> |
---|
207 | Obtain an output stream for creating a meta block.</TD> |
---|
208 | </TR> |
---|
209 | </TABLE> |
---|
210 | <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> |
---|
211 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
212 | <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> |
---|
213 | <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> |
---|
214 | </TR> |
---|
215 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
216 | <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> |
---|
217 | </TR> |
---|
218 | </TABLE> |
---|
219 | |
---|
220 | <P> |
---|
221 | |
---|
222 | <!-- ========= CONSTRUCTOR DETAIL ======== --> |
---|
223 | |
---|
224 | <A NAME="constructor_detail"><!-- --></A> |
---|
225 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
226 | <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
---|
227 | <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
---|
228 | <B>Constructor Detail</B></FONT></TH> |
---|
229 | </TR> |
---|
230 | </TABLE> |
---|
231 | |
---|
232 | <A NAME="TFile.Writer(org.apache.hadoop.fs.FSDataOutputStream, int, java.lang.String, java.lang.String, org.apache.hadoop.conf.Configuration)"><!-- --></A><H3> |
---|
233 | TFile.Writer</H3> |
---|
234 | <PRE> |
---|
235 | public <B>TFile.Writer</B>(<A HREF="../../../../../../org/apache/hadoop/fs/FSDataOutputStream.html" title="class in org.apache.hadoop.fs">FSDataOutputStream</A> fsdos, |
---|
236 | int minBlockSize, |
---|
237 | <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> compressName, |
---|
238 | <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> comparator, |
---|
239 | <A HREF="../../../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</A> conf) |
---|
240 | 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> |
---|
241 | <DL> |
---|
242 | <DD>Constructor |
---|
243 | <P> |
---|
244 | <DL> |
---|
245 | <DT><B>Parameters:</B><DD><CODE>fsdos</CODE> - output stream for writing. Must be at position 0.<DD><CODE>minBlockSize</CODE> - Minimum compressed block size in bytes. A compression block will |
---|
246 | not be closed until it reaches this size except for the last |
---|
247 | block.<DD><CODE>compressName</CODE> - Name of the compression algorithm. Must be one of the strings |
---|
248 | returned by <A HREF="../../../../../../org/apache/hadoop/io/file/tfile/TFile.html#getSupportedCompressionAlgorithms()"><CODE>TFile.getSupportedCompressionAlgorithms()</CODE></A>.<DD><CODE>comparator</CODE> - Leave comparator as null or empty string if TFile is not sorted. |
---|
249 | Otherwise, provide the string name for the comparison algorithm |
---|
250 | for keys. Two kinds of comparators are supported. |
---|
251 | <ul> |
---|
252 | <li>Algorithmic comparator: binary comparators that is language |
---|
253 | independent. Currently, only "memcmp" is supported. |
---|
254 | <li>Language-specific comparator: binary comparators that can |
---|
255 | only be constructed in specific language. For Java, the syntax |
---|
256 | is "jclass:", followed by the class name of the RawComparator. |
---|
257 | Currently, we only support RawComparators that can be |
---|
258 | constructed through the default constructor (with no |
---|
259 | parameters). Parameterized RawComparators such as |
---|
260 | <A HREF="../../../../../../org/apache/hadoop/io/WritableComparator.html" title="class in org.apache.hadoop.io"><CODE>WritableComparator</CODE></A> or |
---|
261 | <A HREF="../../../../../../org/apache/hadoop/io/serializer/JavaSerializationComparator.html" title="class in org.apache.hadoop.io.serializer"><CODE>JavaSerializationComparator</CODE></A> may not be directly used. |
---|
262 | One should write a wrapper class that inherits from such classes |
---|
263 | and use its default constructor to perform proper |
---|
264 | initialization. |
---|
265 | </ul><DD><CODE>conf</CODE> - The configuration object. |
---|
266 | <DT><B>Throws:</B> |
---|
267 | <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> |
---|
268 | </DL> |
---|
269 | |
---|
270 | <!-- ============ METHOD DETAIL ========== --> |
---|
271 | |
---|
272 | <A NAME="method_detail"><!-- --></A> |
---|
273 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
274 | <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
---|
275 | <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
---|
276 | <B>Method Detail</B></FONT></TH> |
---|
277 | </TR> |
---|
278 | </TABLE> |
---|
279 | |
---|
280 | <A NAME="close()"><!-- --></A><H3> |
---|
281 | close</H3> |
---|
282 | <PRE> |
---|
283 | public void <B>close</B>() |
---|
284 | 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> |
---|
285 | <DL> |
---|
286 | <DD>Close the Writer. Resources will be released regardless of the exceptions |
---|
287 | being thrown. Future close calls will have no effect. |
---|
288 | |
---|
289 | The underlying FSDataOutputStream is not closed. |
---|
290 | <P> |
---|
291 | <DD><DL> |
---|
292 | <DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/Closeable.html?is-external=true#close()" title="class or interface in java.io">close</A></CODE> in interface <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io">Closeable</A></CODE></DL> |
---|
293 | </DD> |
---|
294 | <DD><DL> |
---|
295 | |
---|
296 | <DT><B>Throws:</B> |
---|
297 | <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> |
---|
298 | </DD> |
---|
299 | </DL> |
---|
300 | <HR> |
---|
301 | |
---|
302 | <A NAME="append(byte[], byte[])"><!-- --></A><H3> |
---|
303 | append</H3> |
---|
304 | <PRE> |
---|
305 | public void <B>append</B>(byte[] key, |
---|
306 | byte[] value) |
---|
307 | 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> |
---|
308 | <DL> |
---|
309 | <DD>Adding a new key-value pair to the TFile. This is synonymous to |
---|
310 | append(key, 0, key.length, value, 0, value.length) |
---|
311 | <P> |
---|
312 | <DD><DL> |
---|
313 | </DL> |
---|
314 | </DD> |
---|
315 | <DD><DL> |
---|
316 | <DT><B>Parameters:</B><DD><CODE>key</CODE> - Buffer for key.<DD><CODE>value</CODE> - Buffer for value. |
---|
317 | <DT><B>Throws:</B> |
---|
318 | <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> |
---|
319 | </DD> |
---|
320 | </DL> |
---|
321 | <HR> |
---|
322 | |
---|
323 | <A NAME="append(byte[], int, int, byte[], int, int)"><!-- --></A><H3> |
---|
324 | append</H3> |
---|
325 | <PRE> |
---|
326 | public void <B>append</B>(byte[] key, |
---|
327 | int koff, |
---|
328 | int klen, |
---|
329 | byte[] value, |
---|
330 | int voff, |
---|
331 | int vlen) |
---|
332 | 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> |
---|
333 | <DL> |
---|
334 | <DD>Adding a new key-value pair to TFile. |
---|
335 | <P> |
---|
336 | <DD><DL> |
---|
337 | </DL> |
---|
338 | </DD> |
---|
339 | <DD><DL> |
---|
340 | <DT><B>Parameters:</B><DD><CODE>key</CODE> - buffer for key.<DD><CODE>koff</CODE> - offset in key buffer.<DD><CODE>klen</CODE> - length of key.<DD><CODE>value</CODE> - buffer for value.<DD><CODE>voff</CODE> - offset in value buffer.<DD><CODE>vlen</CODE> - length of value. |
---|
341 | <DT><B>Throws:</B> |
---|
342 | <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> - Upon IO errors. |
---|
343 | <p> |
---|
344 | If an exception is thrown, the TFile will be in an inconsistent |
---|
345 | state. The only legitimate call after that would be close</DL> |
---|
346 | </DD> |
---|
347 | </DL> |
---|
348 | <HR> |
---|
349 | |
---|
350 | <A NAME="prepareAppendKey(int)"><!-- --></A><H3> |
---|
351 | prepareAppendKey</H3> |
---|
352 | <PRE> |
---|
353 | public <A HREF="http://java.sun.com/javase/6/docs/api/java/io/DataOutputStream.html?is-external=true" title="class or interface in java.io">DataOutputStream</A> <B>prepareAppendKey</B>(int length) |
---|
354 | 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> |
---|
355 | <DL> |
---|
356 | <DD>Obtain an output stream for writing a key into TFile. This may only be |
---|
357 | called when there is no active Key appending stream or value appending |
---|
358 | stream. |
---|
359 | <P> |
---|
360 | <DD><DL> |
---|
361 | </DL> |
---|
362 | </DD> |
---|
363 | <DD><DL> |
---|
364 | <DT><B>Parameters:</B><DD><CODE>length</CODE> - The expected length of the key. If length of the key is not |
---|
365 | known, set length = -1. Otherwise, the application must write |
---|
366 | exactly as many bytes as specified here before calling close on |
---|
367 | the returned output stream. |
---|
368 | <DT><B>Returns:</B><DD>The key appending output stream. |
---|
369 | <DT><B>Throws:</B> |
---|
370 | <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> |
---|
371 | </DD> |
---|
372 | </DL> |
---|
373 | <HR> |
---|
374 | |
---|
375 | <A NAME="prepareAppendValue(int)"><!-- --></A><H3> |
---|
376 | prepareAppendValue</H3> |
---|
377 | <PRE> |
---|
378 | public <A HREF="http://java.sun.com/javase/6/docs/api/java/io/DataOutputStream.html?is-external=true" title="class or interface in java.io">DataOutputStream</A> <B>prepareAppendValue</B>(int length) |
---|
379 | 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> |
---|
380 | <DL> |
---|
381 | <DD>Obtain an output stream for writing a value into TFile. This may only be |
---|
382 | called right after a key appending operation (the key append stream must |
---|
383 | be closed). |
---|
384 | <P> |
---|
385 | <DD><DL> |
---|
386 | </DL> |
---|
387 | </DD> |
---|
388 | <DD><DL> |
---|
389 | <DT><B>Parameters:</B><DD><CODE>length</CODE> - The expected length of the value. If length of the value is not |
---|
390 | known, set length = -1. Otherwise, the application must write |
---|
391 | exactly as many bytes as specified here before calling close on |
---|
392 | the returned output stream. Advertising the value size up-front |
---|
393 | guarantees that the value is encoded in one chunk, and avoids |
---|
394 | intermediate chunk buffering. |
---|
395 | <DT><B>Throws:</B> |
---|
396 | <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> |
---|
397 | </DD> |
---|
398 | </DL> |
---|
399 | <HR> |
---|
400 | |
---|
401 | <A NAME="prepareMetaBlock(java.lang.String, java.lang.String)"><!-- --></A><H3> |
---|
402 | prepareMetaBlock</H3> |
---|
403 | <PRE> |
---|
404 | public <A HREF="http://java.sun.com/javase/6/docs/api/java/io/DataOutputStream.html?is-external=true" title="class or interface in java.io">DataOutputStream</A> <B>prepareMetaBlock</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> name, |
---|
405 | <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> compressName) |
---|
406 | 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>, |
---|
407 | <A HREF="../../../../../../org/apache/hadoop/io/file/tfile/MetaBlockAlreadyExists.html" title="class in org.apache.hadoop.io.file.tfile">MetaBlockAlreadyExists</A></PRE> |
---|
408 | <DL> |
---|
409 | <DD>Obtain an output stream for creating a meta block. This function may not |
---|
410 | be called when there is a key append stream or value append stream |
---|
411 | active. No more key-value insertion is allowed after a meta data block |
---|
412 | has been added to TFile. |
---|
413 | <P> |
---|
414 | <DD><DL> |
---|
415 | </DL> |
---|
416 | </DD> |
---|
417 | <DD><DL> |
---|
418 | <DT><B>Parameters:</B><DD><CODE>name</CODE> - Name of the meta block.<DD><CODE>compressName</CODE> - Name of the compression algorithm to be used. Must be one of the |
---|
419 | strings returned by |
---|
420 | <A HREF="../../../../../../org/apache/hadoop/io/file/tfile/TFile.html#getSupportedCompressionAlgorithms()"><CODE>TFile.getSupportedCompressionAlgorithms()</CODE></A>. |
---|
421 | <DT><B>Returns:</B><DD>A DataOutputStream that can be used to write Meta Block data. |
---|
422 | Closing the stream would signal the ending of the block. |
---|
423 | <DT><B>Throws:</B> |
---|
424 | <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> |
---|
425 | <DD><CODE><A HREF="../../../../../../org/apache/hadoop/io/file/tfile/MetaBlockAlreadyExists.html" title="class in org.apache.hadoop.io.file.tfile">MetaBlockAlreadyExists</A></CODE> - the Meta Block with the same name already exists.</DL> |
---|
426 | </DD> |
---|
427 | </DL> |
---|
428 | <HR> |
---|
429 | |
---|
430 | <A NAME="prepareMetaBlock(java.lang.String)"><!-- --></A><H3> |
---|
431 | prepareMetaBlock</H3> |
---|
432 | <PRE> |
---|
433 | public <A HREF="http://java.sun.com/javase/6/docs/api/java/io/DataOutputStream.html?is-external=true" title="class or interface in java.io">DataOutputStream</A> <B>prepareMetaBlock</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> name) |
---|
434 | 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>, |
---|
435 | <A HREF="../../../../../../org/apache/hadoop/io/file/tfile/MetaBlockAlreadyExists.html" title="class in org.apache.hadoop.io.file.tfile">MetaBlockAlreadyExists</A></PRE> |
---|
436 | <DL> |
---|
437 | <DD>Obtain an output stream for creating a meta block. This function may not |
---|
438 | be called when there is a key append stream or value append stream |
---|
439 | active. No more key-value insertion is allowed after a meta data block |
---|
440 | has been added to TFile. Data will be compressed using the default |
---|
441 | compressor as defined in Writer's constructor. |
---|
442 | <P> |
---|
443 | <DD><DL> |
---|
444 | </DL> |
---|
445 | </DD> |
---|
446 | <DD><DL> |
---|
447 | <DT><B>Parameters:</B><DD><CODE>name</CODE> - Name of the meta block. |
---|
448 | <DT><B>Returns:</B><DD>A DataOutputStream that can be used to write Meta Block data. |
---|
449 | Closing the stream would signal the ending of the block. |
---|
450 | <DT><B>Throws:</B> |
---|
451 | <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> |
---|
452 | <DD><CODE><A HREF="../../../../../../org/apache/hadoop/io/file/tfile/MetaBlockAlreadyExists.html" title="class in org.apache.hadoop.io.file.tfile">MetaBlockAlreadyExists</A></CODE> - the Meta Block with the same name already exists.</DL> |
---|
453 | </DD> |
---|
454 | </DL> |
---|
455 | <!-- ========= END OF CLASS DATA ========= --> |
---|
456 | <HR> |
---|
457 | |
---|
458 | |
---|
459 | <!-- ======= START OF BOTTOM NAVBAR ====== --> |
---|
460 | <A NAME="navbar_bottom"><!-- --></A> |
---|
461 | <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> |
---|
462 | <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
---|
463 | <TR> |
---|
464 | <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
---|
465 | <A NAME="navbar_bottom_firstrow"><!-- --></A> |
---|
466 | <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
---|
467 | <TR ALIGN="center" VALIGN="top"> |
---|
468 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
---|
469 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
---|
470 | <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
---|
471 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/TFile.Writer.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> |
---|
472 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
---|
473 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
---|
474 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
---|
475 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
---|
476 | </TR> |
---|
477 | </TABLE> |
---|
478 | </TD> |
---|
479 | <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
---|
480 | </EM> |
---|
481 | </TD> |
---|
482 | </TR> |
---|
483 | |
---|
484 | <TR> |
---|
485 | <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
---|
486 | <A HREF="../../../../../../org/apache/hadoop/io/file/tfile/TFile.Reader.Scanner.Entry.html" title="class in org.apache.hadoop.io.file.tfile"><B>PREV CLASS</B></A> |
---|
487 | <A HREF="../../../../../../org/apache/hadoop/io/file/tfile/Utils.html" title="class in org.apache.hadoop.io.file.tfile"><B>NEXT CLASS</B></A></FONT></TD> |
---|
488 | <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
---|
489 | <A HREF="../../../../../../index.html?org/apache/hadoop/io/file/tfile/TFile.Writer.html" target="_top"><B>FRAMES</B></A> |
---|
490 | <A HREF="TFile.Writer.html" target="_top"><B>NO FRAMES</B></A> |
---|
491 | <SCRIPT type="text/javascript"> |
---|
492 | <!-- |
---|
493 | if(window==top) { |
---|
494 | document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); |
---|
495 | } |
---|
496 | //--> |
---|
497 | </SCRIPT> |
---|
498 | <NOSCRIPT> |
---|
499 | <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A> |
---|
500 | </NOSCRIPT> |
---|
501 | |
---|
502 | |
---|
503 | </FONT></TD> |
---|
504 | </TR> |
---|
505 | <TR> |
---|
506 | <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
---|
507 | SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> |
---|
508 | <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
---|
509 | DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> |
---|
510 | </TR> |
---|
511 | </TABLE> |
---|
512 | <A NAME="skip-navbar_bottom"></A> |
---|
513 | <!-- ======== END OF BOTTOM NAVBAR ======= --> |
---|
514 | |
---|
515 | <HR> |
---|
516 | Copyright © 2009 The Apache Software Foundation |
---|
517 | </BODY> |
---|
518 | </HTML> |
---|