示例#1
0
 @Override
 public void readFrom(StreamInput in) throws IOException {
   pid = in.readLong();
   version = in.readString();
   vmName = in.readString();
   vmVersion = in.readString();
   vmVendor = in.readString();
   startTime = in.readLong();
   inputArguments = new String[in.readInt()];
   for (int i = 0; i < inputArguments.length; i++) {
     inputArguments[i] = in.readString();
   }
   bootClassPath = in.readString();
   classPath = in.readString();
   systemProperties = new HashMap<>();
   int size = in.readInt();
   for (int i = 0; i < size; i++) {
     systemProperties.put(in.readString(), in.readString());
   }
   mem = new Mem();
   mem.readFrom(in);
   gcCollectors = in.readStringArray();
   memoryPools = in.readStringArray();
   useCompressedOops = in.readString();
 }
 @Override
 public void readFrom(StreamInput in) throws IOException {
   super.readFrom(in);
   taskId = TaskId.readFromStream(in);
   parentTaskId = TaskId.readFromStream(in);
   nodesIds = in.readStringArray();
   actions = in.readStringArray();
   if (in.readBoolean()) {
     timeout = TimeValue.readTimeValue(in);
   }
 }
 @Override
 public void readFrom(StreamInput in) throws IOException {
   super.readFrom(in);
   type = in.readString();
   id = in.readString();
   routing = in.readOptionalString();
   preference = in.readOptionalString();
   source = in.readBytesReference();
   sourceUnsafe = false;
   filteringAlias = in.readStringArray();
   if (in.readBoolean()) {
     fields = in.readStringArray();
   }
 }
 @Override
 public void readFrom(StreamInput in) throws IOException {
   super.readFrom(in);
   indices = in.readStringArray();
   aliases = in.readStringArray();
   indicesOptions = IndicesOptions.readIndicesOptions(in);
 }
示例#5
0
  @Override
  public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    type = in.readString();
    id = in.readString();
    routing = in.readOptionalString();
    preference = in.readOptionalString();
    source = in.readBytesReference();
    filteringAlias = in.readStringArray();
    if (in.readBoolean()) {
      fields = in.readStringArray();
    }

    fetchSourceContext = FetchSourceContext.optionalReadFromStream(in);
    nowInMillis = in.readVLong();
  }
 @Override
 public void readFrom(StreamInput in) throws IOException {
   super.readFrom(in);
   replicationType = ReplicationType.fromId(in.readByte());
   consistencyLevel = WriteConsistencyLevel.fromId(in.readByte());
   timeout = TimeValue.readTimeValue(in);
   indices = in.readStringArray();
   indicesOptions = IndicesOptions.readIndicesOptions(in);
 }
 public static OriginalIndices readOptionalOriginalIndices(StreamInput in) throws IOException {
   if (in.getVersion().onOrAfter(Version.V_1_4_0_Beta1)) {
     boolean empty = in.readBoolean();
     if (!empty) {
       return new OriginalIndices(in.readStringArray(), IndicesOptions.readIndicesOptions(in));
     }
   }
   return OriginalIndices.EMPTY;
 }
 @Override
 public BenchmarkMetaData readFrom(StreamInput in) throws IOException {
   Entry[] entries = new Entry[in.readVInt()];
   for (int i = 0; i < entries.length; i++) {
     String benchmarkId = in.readString();
     State state = State.fromId(in.readByte());
     String[] nodes = in.readStringArray();
     entries[i] = new Entry(benchmarkId, state, nodes);
   }
   return new BenchmarkMetaData(entries);
 }
 @Override
 public void readFrom(StreamInput in) throws IOException {
   super.readFrom(in);
   snapshot = in.readString();
   repository = in.readString();
   indices = in.readStringArray();
   indicesOptions = IndicesOptions.readIndicesOptions(in);
   renamePattern = in.readOptionalString();
   renameReplacement = in.readOptionalString();
   waitForCompletion = in.readBoolean();
   includeGlobalState = in.readBoolean();
   settings = readSettingsFromStream(in);
 }
示例#10
0
  @Override
  public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    minScore = in.readFloat();
    routing = in.readOptionalString();
    preference = in.readOptionalString();
    sourceUnsafe = false;
    source = in.readBytesReference();
    types = in.readStringArray();

    if (in.getVersion().onOrAfter(Version.V_1_4_0_Beta1)) {
      terminateAfter = in.readVInt();
    }
  }
 @Override
 public final void readFrom(StreamInput in) throws IOException {
   try {
     getWriteableName(); // Throws UnsupportedOperationException if this aggregation should be read
                         // using old style Streams
     assert false : "Used reading constructor instead";
   } catch (UnsupportedOperationException e) {
     // OK
   }
   name = in.readString();
   bucketsPaths = in.readStringArray();
   metaData = in.readMap();
   doReadFrom(in);
 }
 public void testSimpleStreams() throws Exception {
   assumeTrue("requires a 64-bit JRE ... ?!", Constants.JRE_IS_64BIT);
   BytesStreamOutput out = new BytesStreamOutput();
   out.writeBoolean(false);
   out.writeByte((byte) 1);
   out.writeShort((short) -1);
   out.writeInt(-1);
   out.writeVInt(2);
   out.writeLong(-3);
   out.writeVLong(4);
   out.writeOptionalLong(11234234L);
   out.writeFloat(1.1f);
   out.writeDouble(2.2);
   int[] intArray = {1, 2, 3};
   out.writeGenericValue(intArray);
   int[] vIntArray = {4, 5, 6};
   out.writeVIntArray(vIntArray);
   long[] longArray = {1, 2, 3};
   out.writeGenericValue(longArray);
   long[] vLongArray = {4, 5, 6};
   out.writeVLongArray(vLongArray);
   float[] floatArray = {1.1f, 2.2f, 3.3f};
   out.writeGenericValue(floatArray);
   double[] doubleArray = {1.1, 2.2, 3.3};
   out.writeGenericValue(doubleArray);
   out.writeString("hello");
   out.writeString("goodbye");
   out.writeGenericValue(BytesRefs.toBytesRef("bytesref"));
   out.writeStringArray(new String[] {"a", "b", "cat"});
   out.writeBytesReference(new BytesArray("test"));
   out.writeOptionalBytesReference(new BytesArray("test"));
   out.writeOptionalDouble(null);
   out.writeOptionalDouble(1.2);
   out.writeTimeZone(DateTimeZone.forID("CET"));
   out.writeOptionalTimeZone(DateTimeZone.getDefault());
   out.writeOptionalTimeZone(null);
   final byte[] bytes = BytesReference.toBytes(out.bytes());
   StreamInput in = StreamInput.wrap(BytesReference.toBytes(out.bytes()));
   assertEquals(in.available(), bytes.length);
   assertThat(in.readBoolean(), equalTo(false));
   assertThat(in.readByte(), equalTo((byte) 1));
   assertThat(in.readShort(), equalTo((short) -1));
   assertThat(in.readInt(), equalTo(-1));
   assertThat(in.readVInt(), equalTo(2));
   assertThat(in.readLong(), equalTo(-3L));
   assertThat(in.readVLong(), equalTo(4L));
   assertThat(in.readOptionalLong(), equalTo(11234234L));
   assertThat((double) in.readFloat(), closeTo(1.1, 0.0001));
   assertThat(in.readDouble(), closeTo(2.2, 0.0001));
   assertThat(in.readGenericValue(), equalTo((Object) intArray));
   assertThat(in.readVIntArray(), equalTo(vIntArray));
   assertThat(in.readGenericValue(), equalTo((Object) longArray));
   assertThat(in.readVLongArray(), equalTo(vLongArray));
   assertThat(in.readGenericValue(), equalTo((Object) floatArray));
   assertThat(in.readGenericValue(), equalTo((Object) doubleArray));
   assertThat(in.readString(), equalTo("hello"));
   assertThat(in.readString(), equalTo("goodbye"));
   assertThat(in.readGenericValue(), equalTo((Object) BytesRefs.toBytesRef("bytesref")));
   assertThat(in.readStringArray(), equalTo(new String[] {"a", "b", "cat"}));
   assertThat(in.readBytesReference(), equalTo(new BytesArray("test")));
   assertThat(in.readOptionalBytesReference(), equalTo(new BytesArray("test")));
   assertNull(in.readOptionalDouble());
   assertThat(in.readOptionalDouble(), closeTo(1.2, 0.0001));
   assertEquals(DateTimeZone.forID("CET"), in.readTimeZone());
   assertEquals(DateTimeZone.getDefault(), in.readOptionalTimeZone());
   assertNull(in.readOptionalTimeZone());
   assertEquals(0, in.available());
   in.close();
   out.close();
 }
 @Override
 public void readFrom(StreamInput in) throws IOException {
   super.readFrom(in);
   indices = in.readStringArray();
   settings = readSettingsFromStream(in);
 }
 /** Read from a stream. */
 protected PipelineAggregator(StreamInput in) throws IOException {
   name = in.readString();
   bucketsPaths = in.readStringArray();
   metaData = in.readMap();
 }
示例#15
0
 @Override
 public void readFrom(StreamInput in) throws IOException {
   super.readFrom(in);
   features = in.readStringArray();
 }