@Override public void write(DataOutput out) throws IOException { final byte[] segmentsBytes = HadoopDruidIndexerConfig.JSON_MAPPER.writeValueAsBytes(segments); out.writeInt(segmentsBytes.length); out.write(segmentsBytes); out.writeInt(locations.length); for (String location : locations) { out.writeUTF(location); } }
public void writeTo(DataOutput out) throws IOException { out.writeByte(iMode); out.writeByte(iMonthOfYear); out.writeByte(iDayOfMonth); out.writeByte(iDayOfWeek); out.writeBoolean(iAdvance); writeMillis(out, iMillisOfDay); }
public void writeTo(DataOutput out) throws Exception { out.writeByte(type.ordinal()); Bits.writeString(lock_name,out); out.writeInt(lock_id); Util.writeStreamable(owner, out); out.writeLong(timeout); out.writeBoolean(is_trylock); Util.writeStreamable(info_rsp, out); Util.writeAddress(sender, out); }
@Override public void write(DataOutput output) throws IOException { output.writeByte(inResponseTo ^ RESPONSE_MASK); output.writeInt(correlationId); output.writeByte(SUCCESS); output.writeByte(STRING_ARRAY); output.writeInt(response.length); for (String currentDomain : response) { output.writeUTF(currentDomain); } } });
@Override public void write(int b) { try { output.write(b); } catch (IOException impossible) { throw new AssertionError(impossible); } }
@Override public void write(DataOutput out) throws IOException { out.writeInt(bytes.length); out.write(bytes); out.writeDouble(weight); }
@Override public void writeInt(int v) { try { output.writeInt(v); } catch (IOException impossible) { throw new AssertionError(impossible); } }
@Override public void write(DataOutput output) throws IOException { output.writeByte(inResponseTo ^ RESPONSE_MASK); output.writeInt(correlationId); output.writeByte(SUCCESS); output.writeByte(BOOLEAN); output.writeBoolean(response); } });
@Override public void toData(DataOutput out) throws IOException { super.toData(out); out.writeLong(this.timestamp); out.writeInt(this.changeCount); for (int i = 0; i < this.changeCount; i++) { out.writeInt(this.listenerIds[i]); out.writeDouble(this.values[i]); } }
public void writeTo(DataOutput out) throws Exception { int length=cluster_name != null? cluster_name.length : -1; out.writeShort(length); if(cluster_name != null) out.write(cluster_name, 0, cluster_name.length); }
/** * Writes a boolean as a typed bytes sequence. * * @param b * the boolean to be written * @throws IOException */ public void writeBool(boolean b) throws IOException { out.write(Type.BOOL.code); out.writeBoolean(b); }
protected static void writeAuthToken(DataOutput out, AuthToken tok) throws Exception { out.writeByte(tok == null? 0 : 1); if(tok == null) return; short id=ClassConfigurator.getMagicNumber(tok.getClass()); out.writeShort(id); if(id < 0) { String classname=tok.getClass().getName(); out.writeUTF(classname); } tok.writeTo(out); }
/** * Write the contents of a buffer to an output stream. The bytes are copied from the current position * in the buffer. * @param out The output to write to * @param buffer The buffer to write from * @param length The number of bytes to write * @throws IOException For any errors writing to the output */ public static void writeTo(DataOutput out, ByteBuffer buffer, int length) throws IOException { if (buffer.hasArray()) { out.write(buffer.array(), buffer.position() + buffer.arrayOffset(), length); } else { int pos = buffer.position(); for (int i = pos; i < length + pos; i++) out.writeByte(buffer.get(i)); } }
/** * Writes a double as a typed bytes sequence. * * @param d * the double to be written * @throws IOException */ public void writeDouble(double d) throws IOException { out.write(Type.DOUBLE.code); out.writeDouble(d); }
@Override public void toData(DataOutput out) throws IOException { out.writeFloat(timeInMillis); out.writeInt(numResults); DataSerializer.writeString(indexesUsed, out); }