@Override
 public void writeTo(StreamOutput out) throws IOException {
   out.writeOptionalString(this.getMessage());
   out.writeException(this.getCause());
   writeStackTraces(this, out);
   out.writeMapOfLists(headers, StreamOutput::writeString, StreamOutput::writeString);
 }
 @Override
 public void writeTo(StreamOutput out) throws IOException {
   out.writeVLong(fieldEvictions);
   out.writeVLong(fieldSize);
   out.writeVLong(filterSize);
   out.writeVLong(bloomSize);
 }
 /**
  * Writes an {@link IndexRoutingTable} to a {@link StreamOutput}.
  *
  * @param index {@link IndexRoutingTable} to write
  * @param out {@link StreamOutput} to write to
  * @throws IOException if something happens during write
  */
 public static void writeTo(IndexRoutingTable index, StreamOutput out) throws IOException {
   out.writeString(index.index());
   out.writeVInt(index.shards.size());
   for (IndexShardRoutingTable indexShard : index) {
     IndexShardRoutingTable.Builder.writeToThin(indexShard, out);
   }
 }
 @Override
 public void writeTo(StreamOutput out) throws IOException {
   super.writeTo(out);
   out.writeInt(numDocs);
   out.writeInt(termsList.size());
   for (TermInfo ti : termsList) ti.writeTo(out);
 }
 public static void writeOriginalIndices(OriginalIndices originalIndices, StreamOutput out)
     throws IOException {
   if (out.getVersion().onOrAfter(Version.V_1_4_0_Beta1)) {
     out.writeStringArrayNullable(originalIndices.indices);
     originalIndices.indicesOptions.writeIndicesOptions(out);
   }
 }
Example #6
0
 @Override
 public void writeTo(StreamOutput out) throws IOException {
   out.writeVInt(1); // version
   out.writeUTF(uid.field());
   out.writeUTF(uid.text());
   out.writeLong(version);
 }
Example #7
0
 @Override
 public void writeTo(StreamOutput out) throws IOException {
   super.writeTo(out);
   if (out.getVersion().onOrAfter(version1)) {
     out.writeInt(value2);
   }
 }
 @Override
 public void writeTo(StreamOutput out) throws IOException {
   super.writeTo(out);
   out.writeString(index);
   out.writeInt(shardId);
   timeout.writeTo(out);
 }
  @Override
  public void writeTo(StreamOutput out) throws IOException {
    shardId.writeTo(out);

    out.writeVInt(phase1FileNames.size());
    for (String phase1FileName : phase1FileNames) {
      out.writeUTF(phase1FileName);
    }

    out.writeVInt(phase1FileSizes.size());
    for (Long phase1FileSize : phase1FileSizes) {
      out.writeVLong(phase1FileSize);
    }

    out.writeVInt(phase1ExistingFileNames.size());
    for (String phase1ExistingFileName : phase1ExistingFileNames) {
      out.writeUTF(phase1ExistingFileName);
    }

    out.writeVInt(phase1ExistingFileSizes.size());
    for (Long phase1ExistingFileSize : phase1ExistingFileSizes) {
      out.writeVLong(phase1ExistingFileSize);
    }

    out.writeVLong(phase1TotalSize);
    out.writeVLong(phase1ExistingTotalSize);
  }
 @Override
 public void writeTo(StreamOutput out) throws IOException {
   super.writeTo(out);
   out.writeBoolean(valid);
   out.writeOptionalString(explanation);
   out.writeOptionalString(error);
 }
Example #11
0
 @Override
 public void writeTo(StreamOutput out) throws IOException {
   out.writeString(version);
   out.writeString(vmName);
   out.writeString(vmVersion);
   out.writeString(vmVendor);
 }
 @Override
 public void writeTo(StreamOutput out) throws IOException {
   out.writeVInt(shapes.size());
   for (ShapeBuilder shape : shapes) {
     out.writeShape(shape);
   }
 }
 @Override
 protected void parseCreateField(ParseContext context, List<Field> fields) throws IOException {
   if (!fieldType().stored()) {
     return;
   }
   byte[] value;
   if (context.parser().currentToken() == XContentParser.Token.VALUE_NULL) {
     return;
   } else {
     value = context.parser().binaryValue();
     if (compress != null && compress && !CompressorFactory.isCompressed(value, 0, value.length)) {
       if (compressThreshold == -1 || value.length > compressThreshold) {
         BytesStreamOutput bStream = new BytesStreamOutput();
         StreamOutput stream = CompressorFactory.defaultCompressor().streamOutput(bStream);
         stream.writeBytes(value, 0, value.length);
         stream.close();
         value = bStream.bytes().toBytes();
       }
     }
   }
   if (value == null) {
     return;
   }
   fields.add(new Field(names.indexName(), value, fieldType));
 }
 public static void writeSettingsToStream(Settings settings, StreamOutput out) throws IOException {
   out.writeVInt(settings.getAsMap().size());
   for (Map.Entry<String, String> entry : settings.getAsMap().entrySet()) {
     out.writeString(entry.getKey());
     out.writeString(entry.getValue());
   }
 }
 @Override
 public void writeTo(StreamOutput out) throws IOException {
   out.writeString(type);
   out.writeString(id);
   out.writeString(path);
   out.writeOptionalString(index);
   out.writeOptionalString(routing);
 }
Example #16
0
 @Override
 public void writeTo(StreamOutput out) throws IOException {
   out.writeVInt(count);
   out.writeVInt(cpuPercent);
   out.writeVLong(totalOpenFileDescriptors);
   out.writeLong(minOpenFileDescriptors);
   out.writeLong(maxOpenFileDescriptors);
 }
Example #17
0
 @Override
 public void writeTo(StreamOutput out) throws IOException {
   out.writeVInt(total);
   out.writeVInt(masterOnly);
   out.writeVInt(dataOnly);
   out.writeVInt(masterData);
   out.writeVInt(client);
 }
 @Override
 public void writeTo(StreamOutput out) throws IOException {
   super.writeTo(out);
   out.writeByte(stage.value());
   stats.writeTo(out);
   out.writeOptionalString(nodeId);
   out.writeOptionalString(failure);
 }
 @Override
 public void writeTo(StreamOutput out) throws IOException {
   super.writeTo(out);
   out.writeOptionalString(index);
   out.writeOptionalVInt(shard);
   out.writeOptionalBoolean(primary);
   out.writeBoolean(includeYesDecisions);
 }
Example #20
0
 @Override
 public void writeTo(StreamOutput out) throws IOException {
   out.writeString(name);
   out.writeVInt(path.size());
   for (String s : path) {
     out.writeString(s);
   }
 }
 @Override
 public void writeTo(StreamOutput out) throws IOException {
   super.writeTo(out);
   out.writeInt(simple.size());
   for (String t : simple) {
     out.writeString(t);
   }
 }
 @Override
 public void writeTo(StreamOutput out) throws IOException {
   out.writeString(term);
   out.writeInt(startOffset);
   out.writeInt(endOffset);
   out.writeVInt(position);
   out.writeOptionalString(type);
 }
 @Override
 protected void innerWriteTo(StreamOutput out) throws IOException {
   bucketCountThresholds.writeTo(out);
   out.writeOptionalString(executionHint);
   out.writeOptionalNamedWriteable(filterBuilder);
   out.writeOptionalWriteable(includeExclude);
   out.writeNamedWriteable(significanceHeuristic);
 }
Example #24
0
 @Override
 public void writeTo(StreamOutput out) throws IOException {
   out.writeVLong(heapInit);
   out.writeVLong(heapMax);
   out.writeVLong(nonHeapInit);
   out.writeVLong(nonHeapMax);
   out.writeVLong(directMemoryMax);
 }
 @Override
 public void writeTo(StreamOutput out) throws IOException {
   out.writeString(name);
   out.writeVLong(length);
   out.writeString(checksum);
   out.writeString(writtenBy.toString());
   out.writeBytesRef(hash);
 }
 @Override
 public void writeTo(StreamOutput out) throws IOException {
   out.writeString(STREAM.getName());
   out.writeOptionalString(scriptLang);
   out.writeString(scriptString);
   ScriptService.ScriptType.writeTo(scriptType, out);
   out.writeMap(params);
 }
 @Override
 protected void doWriteTo(StreamOutput out) throws IOException {
   out.writeString(type);
   out.writeBoolean(score);
   out.writeNamedWriteable(query);
   out.writeOptionalWriteable(innerHit);
   out.writeBoolean(ignoreUnmapped);
 }
 @Override
 public void writeTo(StreamOutput out) throws IOException {
   super.writeTo(out);
   out.writeByte(replicationType.id());
   out.writeByte(consistencyLevel.id());
   timeout.writeTo(out);
   out.writeString(index);
 }
 @Override
 public void writeTo(StreamOutput out) throws IOException {
   super.writeTo(out);
   out.writeByte(replicationType.id());
   out.writeByte(consistencyLevel.id());
   timeout.writeTo(out);
   out.writeStringArrayNullable(indices);
   indicesOptions.writeIndicesOptions(out);
 }
Example #30
0
 @Override
 public void writeTo(StreamOutput out) throws IOException {
   out.writeLong(refreshInterval);
   out.writeInt(availableProcessors);
   out.writeInt(allocatedProcessors);
   out.writeOptionalString(name);
   out.writeOptionalString(arch);
   out.writeOptionalString(version);
 }