@Override public void write(DataOutput out) throws IOException { super.write(out); out.writeInt(kvCount); }
@Override public void write(DataOutput out) throws IOException { out.writeBoolean(isDefaultLG); if (!isDefaultLG) { out.writeUTF(name); } if (isDefaultLG && columnFamilies == null) { // only expect null when default LG, otherwise let a NPE occur out.writeInt(-1); } else { out.writeInt(columnFamilies.size()); for (Entry<ByteSequence,MutableLong> entry : columnFamilies.entrySet()) { out.writeInt(entry.getKey().length()); out.write(entry.getKey().getBackingArray(), entry.getKey().offset(), entry.getKey().length()); out.writeLong(entry.getValue().longValue()); } } out.writeBoolean(firstKey != null); if (firstKey != null) firstKey.write(out); indexWriter.close(out); }
@Override public void write(DataOutput out) throws IOException { key.write(out); out.writeInt(entries); if (newFormat) { Utils.writeVLong(out, offset); Utils.writeVLong(out, compressedSize); Utils.writeVLong(out, rawSize); } }
entry.getKey().write(dataOut); entry.getValue().write(dataOut);
@Override public void write(DataOutput out) throws IOException { super.write(out); out.writeInt(kvCount); }
@Override public void write(DataOutput out) throws IOException { super.write(out); out.writeInt(kvCount); }
private String serializeKey(Key key) throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(128); DataOutputStream out = new DataOutputStream(baos); key.write(out); out.close(); String key64 = Base64.encodeBytes(baos.toByteArray()); return URLEncoder.encode(key64, "UTF-8"); }
/** * Serialize the group, key, and value */ @Override public void write(final DataOutput out) throws IOException { group.write(out); key.write(out); value.write(out); }
private void writeObject(ObjectOutputStream out) throws IOException { key.write(out); new Value(value, false).write(out); }
@Override public void write(DataOutput out) throws IOException { key.write(out); out.writeInt(entries); if (newFormat) { Utils.writeVLong(out, offset); Utils.writeVLong(out, compressedSize); Utils.writeVLong(out, rawSize); } }
@Override public void write(DataOutput out) throws IOException { out.writeBoolean(isDefaultLG); if (!isDefaultLG) { out.writeUTF(name); } if (isDefaultLG && columnFamilies == null) { // only expect null when default LG, otherwise let a NPE occur out.writeInt(-1); } else { out.writeInt(columnFamilies.size()); for (Entry<ByteSequence,MutableLong> entry : columnFamilies.entrySet()) { out.writeInt(entry.getKey().length()); out.write(entry.getKey().getBackingArray(), entry.getKey().offset(), entry.getKey().length()); out.writeLong(entry.getValue().longValue()); } } out.writeBoolean(firstKey != null); if (firstKey != null) firstKey.write(out); indexWriter.close(out); }
protected void consume() throws IOException { digest.reset(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); DataOutputStream dos = new DataOutputStream(baos); if (!this.source.hasTop()) { this.topKey = null; this.topValue = null; return; } Key lastKeySeen = null; while (this.source.hasTop()) { baos.reset(); Key currentKey = this.source.getTopKey(); lastKeySeen = currentKey; currentKey.write(dos); this.source.getTopValue().write(dos); digest.update(baos.toByteArray()); this.source.next(); } this.topKey = lastKeySeen; this.topValue = new Value(digest.digest()); }
entry.getKey().write(dataOut); entry.getValue().write(dataOut);
entry.getKey().write(dataOut); entry.getValue().write(dataOut);
DataOutputStream out = new DataOutputStream(baos); try { entry.getKey().write(out); entry.getValue().write(out); } catch (Exception e) {