Java Code Examples for org.apache.hadoop.io.LongWritable#write()
The following examples show how to use
org.apache.hadoop.io.LongWritable#write() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NewOldCustomElement.java From WIFIProbe with Apache License 2.0 | 5 votes |
public void write(DataOutput dataOutput) throws IOException { Text text = new Text(wifiProb==null?"":wifiProb); text.write(dataOutput); LongWritable longWritable = new LongWritable(); longWritable.set(hour); longWritable.write(dataOutput); longWritable.set(newCustomer); longWritable.write(dataOutput); longWritable.set(oldCustomer); longWritable.write(dataOutput); }
Example 2
Source File: TestTezMerger.java From tez with Apache License 2.0 | 5 votes |
private void populateData(IntWritable intKey, LongWritable longVal, DataInputBuffer key, DataInputBuffer value) throws IOException { DataOutputBuffer k = new DataOutputBuffer(); DataOutputBuffer v = new DataOutputBuffer(); intKey.write(k); longVal.write(v); key.reset(k.getData(), 0, k.getLength()); value.reset(v.getData(), 0, v.getLength()); verificationDataSet.put(intKey.get(), longVal.get()); }
Example 3
Source File: CustomWritable.java From pxf with Apache License 2.0 | 4 votes |
@Override public void write(DataOutput out) throws IOException { // 0. Timestamp Text tms_text = new Text(tms); tms_text.write(out); // 1. num, int1, int2 IntWritable intw = new IntWritable(); for (int i = 0; i < num.length; i++) { intw.set(num[i]); intw.write(out); } intw.set(int1); intw.write(out); intw.set(int2); intw.write(out); // 2. st1 Text txt = new Text(); for (int i = 0; i < strings.length; i++) { txt.set(strings[i]); txt.write(out); } txt.set(st1); txt.write(out); // 3. doubles DoubleWritable dw = new DoubleWritable(); for (int i = 0; i < dubs.length; i++) { dw.set(dubs[i]); dw.write(out); } dw.set(db); dw.write(out); // 4. floats FloatWritable fw = new FloatWritable(); for (int i = 0; i < fts.length; i++) { fw.set(fts[i]); fw.write(out); } fw.set(ft); fw.write(out); // 5. longs LongWritable lw = new LongWritable(); for (int i = 0; i < lngs.length; i++) { lw.set(lngs[i]); lw.write(out); } lw.set(lng); lw.write(out); // 6. booleans BooleanWritable bw = new BooleanWritable(); for (int i = 0; i < bools.length; ++i) { bw.set(bools[i]); bw.write(out); } bw.set(bool); bw.write(out); // 7. shorts ShortWritable sw = new ShortWritable(); for (int i = 0; i < shrts.length; ++i) { sw.set(shrts[i]); sw.write(out); } sw.set(shrt); sw.write(out); // 8. bytes // BytesWritable btsw = new BytesWritable(bts); // btsw.write(out); BytesWritable btsw = new BytesWritable(); btsw.setCapacity(bts.length); btsw.setSize(bts.length); btsw.set(bts, 0, bts.length); btsw.write(out); }
Example 4
Source File: FSImageSerialization.java From hadoop with Apache License 2.0 | 4 votes |
/** write the long value */ static void writeLong(long value, DataOutputStream out) throws IOException { LongWritable uLong = TL_DATA.get().U_LONG; uLong.set(value); uLong.write(out); }
Example 5
Source File: FSImageSerialization.java From big-c with Apache License 2.0 | 4 votes |
/** write the long value */ static void writeLong(long value, DataOutputStream out) throws IOException { LongWritable uLong = TL_DATA.get().U_LONG; uLong.set(value); uLong.write(out); }
Example 6
Source File: FSImageSerialization.java From RDFS with Apache License 2.0 | 4 votes |
/** write the long value */ static void writeLong(long value, DataOutputStream out) throws IOException { LongWritable uLong = TL_DATA.get().U_LONG; uLong.set(value); uLong.write(out); }