public Text evaluate(IntWritable i) { if (i == null) { return null; } else { out.reset(); LazyInteger.writeUTF8NoException(out, i.get()); t.set(out.getData(), 0, out.getCount()); return t; } }
ByteStream.Output serializeStream = new ByteStream.Output(); LazyUtils.writePrimitiveUTF8(serializeStream, writable, poi, false, (byte) 0, null); startRow = new byte[serializeStream.getCount()]; System.arraycopy(serializeStream.getData(), 0, startRow, 0, serializeStream.getCount()); return startRow;
public Text evaluate(LongWritable i) { if (i == null) { return null; } else { out.reset(); LazyLong.writeUTF8NoException(out, i.get()); t.set(out.getData(), 0, out.getCount()); return t; } }
int byteSizeStart = byteStream.getCount(); byteStream.write((byte) 0); byteStream.write((byte) 0); byteStream.write((byte) 0); byteStream.write((byte) 0); int listStart = byteStream.getCount(); int listEnd = byteStream.getCount(); int listSize = listEnd - listStart; byte[] bytes = byteStream.getData(); int byteSizeStart = byteStream.getCount(); byteStream.write((byte) 0); byteStream.write((byte) 0); byteStream.write((byte) 0); byteStream.write((byte) 0); int mapStart = byteStream.getCount(); int mapEnd = byteStream.getCount(); int mapSize = mapEnd - mapStart; byte[] bytes = byteStream.getData(); int byteSizeStart = byteStream.getCount(); byteStream.write((byte) 0); byteStream.write((byte) 0); byteStream.write((byte) 0); byteStream.write((byte) 0); int structStart = byteStream.getCount();
byte [] columnQualifierBytes = new byte[serializeStream.getCount()]; System.arraycopy( serializeStream.getData(), 0, columnQualifierBytes, 0, serializeStream.getCount()); continue; byte [] value = new byte[serializeStream.getCount()]; System.arraycopy(serializeStream.getData(), 0, value, 0, serializeStream.getCount()); put.add(colMap.familyNameBytes, columnQualifierBytes, value); return null; byte [] key = new byte[serializeStream.getCount()]; System.arraycopy(serializeStream.getData(), 0, key, 0, serializeStream.getCount()); if (i == iKey) { return key;
.set(serializeStream.getData(), 0, serializeStream.getCount()); return serializeCache;
out.reset(); LazyInteger.writeUTF8NoException(out, ((ByteObjectInspector) inputOI).get(input)); t.set(out.getData(), 0, out.getCount()); return t; case SHORT: out.reset(); LazyInteger.writeUTF8NoException(out, ((ShortObjectInspector) inputOI).get(input)); t.set(out.getData(), 0, out.getCount()); return t; case INT: out.reset(); LazyInteger.writeUTF8NoException(out, ((IntObjectInspector) inputOI).get(input)); t.set(out.getData(), 0, out.getCount()); return t; case LONG: out.reset(); LazyLong.writeUTF8NoException(out, ((LongObjectInspector) inputOI).get(input)); t.set(out.getData(), 0, out.getCount()); return t; case FLOAT:
/** * Serialize an object to a byte buffer in a binary compact way. */ @Override public Writable serialize(Object obj, ObjectInspector objInspector) throws SerDeException { // make sure it is a struct record if (objInspector.getCategory() != Category.STRUCT) { throw new SerDeException(getClass().toString() + " can only serialize struct types, but we got: " + objInspector.getTypeName()); } serializeByteStream.reset(); // serialize the row as a struct serializeStruct(serializeByteStream, obj, (StructObjectInspector) objInspector); // return the serialized bytes serializeBytesWritable.set(serializeByteStream.getData(), 0, serializeByteStream.getCount()); return serializeBytesWritable; }
public Text evaluate(LongWritable i) { if (i == null) { return null; } else { out.reset(); LazyLong.writeUTF8NoException(out, i.get()); result.set(out.getData(), 0, out.getCount()); return result; } }
public Text evaluate(IntWritable i) { if (i == null) { return null; } else { out.reset(); LazyInteger.writeUTF8NoException(out, i.get()); result.set(out.getData(), 0, out.getCount()); return result; } }
public Text evaluate(ShortWritable i) { if (i == null) { return null; } else { out.reset(); LazyInteger.writeUTF8NoException(out, i.get()); result.set(out.getData(), 0, out.getCount()); return result; } }
public Writable serialize(Object obj, ObjectInspector objInspector) throws SerDeException { try { bos_.reset(); bt.serialize(obj, objInspector, oprot_); oprot_.getTransport().flush(); } catch (Exception e) { e.printStackTrace(); throw new SerDeException(e); } ret.set(bos_.getData(), 0, bos_.getCount()); return ret; } }
public Text evaluate(ShortWritable i) { if (i == null) { return null; } else { out.reset(); LazyInteger.writeUTF8NoException(out, i.get()); t.set(out.getData(), 0, out.getCount()); return t; } }
public Text evaluate(ByteWritable i) { if (i == null) { return null; } else { out.reset(); LazyInteger.writeUTF8NoException(out, i.get()); t.set(out.getData(), 0, out.getCount()); return t; } }
public Text evaluate(ByteWritable i) { if (i == null) { return null; } else { out.reset(); LazyInteger.writeUTF8NoException(out, i.get()); result.set(out.getData(), 0, out.getCount()); return result; } } public Text evaluate(ByteWritable i, Text format) {