Refine search
@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); } }
/** * Writes string to output stream accounting for {@code null} values. * * @param out Output stream to write to. * @param s String to write, possibly {@code null}. * @throws IOException If write failed. */ public static void writeString(DataOutput out, String s) throws IOException { // Write null flag. out.writeBoolean(s == null); if (s != null) out.writeUTF(s); }
/** * Write the subscriber state to the given {@link DataInput} * in the order of: * isMaster * serverState * totalUpdates * streamId * @param dataOutput the data output to write to * @throws IOException */ public void write(DataOutput dataOutput) throws IOException { dataOutput.writeBoolean(isMaster); dataOutput.writeUTF(serverState); dataOutput.writeInt(totalUpdates); dataOutput.writeInt(streamId); }
/** * Static helper to write given {@link IgnoreEntryOccurrence} to the output stream. * * @param out output stream * @param entry entry to write * @throws IOException I/O exception */ public static synchronized void serialize(@NotNull DataOutput out, @NotNull IgnoreEntryOccurrence entry) throws IOException { out.writeUTF(entry.url); out.writeInt(entry.items.size()); for (Pair<String, Boolean> item : entry.items) { out.writeUTF(item.first); out.writeBoolean(item.second); } }
protected void looseMarshalString(String value, DataOutput dataOut) throws IOException { dataOut.writeBoolean(value != null); if (value != null) { dataOut.writeUTF(value); } }
@Override public void write(DataOutput out) throws IOException { super.write(out); out.writeInt(limit); out.writeInt(offset); if (partitionColumn != null) { out.writeBoolean(true); out.writeUTF(partitionColumn); } else { out.writeBoolean(false); } if (lowerBound != null) { out.writeBoolean(true); out.writeUTF(lowerBound); } else { out.writeBoolean(false); } if (upperBound != null) { out.writeBoolean(true); out.writeUTF(upperBound); } else { out.writeBoolean(false); } }
protected void looseMarshalString(String value, DataOutput dataOut) throws IOException { dataOut.writeBoolean(value != null); if (value != null) { dataOut.writeUTF(value); } }
public void writeExternal(DataOutput out) throws IOException { out.writeUTF(this.jobId); out.writeInt(this.repeat); out.writeLong(this.startTime); out.writeLong(this.delay); out.writeLong(this.nextTime); out.writeLong(this.period); if (this.cronEntry == null) { this.cronEntry = ""; } out.writeUTF(this.cronEntry); this.location.writeExternal(out); if (lastUpdate != null) { out.writeBoolean(true); this.lastUpdate.writeExternal(out); } else { out.writeBoolean(false); } }
protected void looseMarshalString(String value, DataOutput dataOut) throws IOException { dataOut.writeBoolean(value != null); if (value != null) { dataOut.writeUTF(value); } }
@Override public void toData(DataOutput out) throws IOException { super.toData(out); out.writeInt(this.processorId); out.writeUTF(this.regionName); InternalDataSerializer.invokeToData(this.eventId, out); out.writeBoolean(this.isBulkOp); }
protected void looseMarshalString(String value, DataOutput dataOut) throws IOException { dataOut.writeBoolean(value != null); if (value != null) { dataOut.writeUTF(value); } }
@Override public void toData(DataOutput out) throws IOException { super.toData(out); out.writeUTF(this.serviceName); DataSerializer.writeObject(this.objectName, out); out.writeLong(this.startTime); out.writeLong(this.leaseMillis); out.writeLong(this.waitMillis); out.writeBoolean(this.reentrant); out.writeBoolean(this.tryLock); out.writeInt(this.processorId); out.writeInt(this.lockId); out.writeInt(this.threadId); out.writeLong(this.grantorVersion); out.writeInt(this.grantorSerialNumber); out.writeInt(this.dlsSerialNumber); }
protected void looseMarshalString(String value, DataOutput dataOut) throws IOException { dataOut.writeBoolean(value != null); if (value != null) { dataOut.writeUTF(value); } }
public void write(DataOutput out) throws IOException { out.writeUTF(index); out.writeInt(shardId); out.writeBoolean(slice != null); if (slice != null) { out.writeInt(slice.id); out.writeInt(slice.max); } out.writeBoolean(serializedSettings != null); if (serializedSettings != null) { // same goes for settings byte[] utf = StringUtils.toUTF(serializedSettings); out.writeInt(utf.length); out.write(utf); } out.writeBoolean(serializedMapping != null); if (serializedMapping != null) { // avoid using writeUTF since the mapping can be longer than 65K byte[] utf = StringUtils.toUTF(serializedMapping); out.writeInt(utf.length); out.write(utf); } out.writeInt(locations.length); for (String location : locations) { out.writeUTF(location); } }