Java Code Examples for org.elasticsearch.common.io.stream.StreamInput#readStringArray()

The following examples show how to use org.elasticsearch.common.io.stream.StreamInput#readStringArray() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GetWarmersResponse.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    int size = in.readVInt();
    ImmutableOpenMap.Builder<String, List<IndexWarmersMetaData.Entry>> indexMapBuilder = ImmutableOpenMap.builder();
    for (int i = 0; i < size; i++) {
        String key = in.readString();
        int valueSize = in.readVInt();
        List<IndexWarmersMetaData.Entry> warmerEntryBuilder = new ArrayList<>();
        for (int j = 0; j < valueSize; j++) {
            String name = in.readString();
            String[] types = in.readStringArray();
            BytesReference source = in.readBytesReference();
            Boolean queryCache = null;
            queryCache = in.readOptionalBoolean();
            warmerEntryBuilder.add(new IndexWarmersMetaData.Entry(
                            name,
                            types,
                            queryCache,
                            source)
            );
        }
        indexMapBuilder.put(key, Collections.unmodifiableList(warmerEntryBuilder));
    }
    warmers = indexMapBuilder.build();
}
 
Example 2
Source File: IndexWarmersMetaData.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Override
public IndexWarmersMetaData readFrom(StreamInput in) throws IOException {
    Entry[] entries = new Entry[in.readVInt()];
    for (int i = 0; i < entries.length; i++) {
        String name = in.readString();
        String[] types = in.readStringArray();
        BytesReference source = null;
        if (in.readBoolean()) {
            source = in.readBytesReference();
        }
        Boolean queryCache;
        queryCache = in.readOptionalBoolean();
        entries[i] = new Entry(name, types, queryCache, source);
    }
    return new IndexWarmersMetaData(entries);
}
 
Example 3
Source File: ExtendedAnalyzeRequest.java    From elasticsearch-extended-analyze with Apache License 2.0 6 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    text = in.readStringArray();
    analyzer = in.readOptionalString();
    tokenizer = in.readOptionalString();
    int size = in.readVInt();
    if (size > 0) {
        tokenFilters = new String[size];
        for (int i = 0; i < size; i++) {
            tokenFilters[i] = in.readString();
        }
    }
    field = in.readOptionalString();
    shortAttributeName = in.readBoolean();
    int attSize = in.readVInt();
    if (size > 0) {
        attributes = new String[attSize];
        for (int i = 0; i < attSize; i++) {
            attributes[i] = in.readString();
        }
    }
}
 
Example 4
Source File: GetSnapshotsRequest.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    repository = in.readString();
    snapshots = in.readStringArray();
    if (in.getVersion().onOrAfter(Version.V_2_2_0)) {
        ignoreUnavailable = in.readBoolean();
    }
}
 
Example 5
Source File: DeleteIndexRequest.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    indices = in.readStringArray();
    indicesOptions = IndicesOptions.readIndicesOptions(in);
    timeout = readTimeValue(in);
}
 
Example 6
Source File: GetFieldMappingsIndexRequest.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    types = in.readStringArray();
    fields = in.readStringArray();
    includeDefaults = in.readBoolean();
    probablySingleFieldRequest = in.readBoolean();
    originalIndices = OriginalIndices.readOriginalIndices(in);
}
 
Example 7
Source File: UpdateSettingsRequest.java    From crate with Apache License 2.0 5 votes vote down vote up
public UpdateSettingsRequest(StreamInput in) throws IOException {
    super(in);
    indices = in.readStringArray();
    indicesOptions = IndicesOptions.readIndicesOptions(in);
    settings = readSettingsFromStream(in);
    preserveExisting = in.readBoolean();
}
 
Example 8
Source File: JvmInfo.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@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();
    if (in.getVersion().onOrAfter(Version.V_2_2_0)) {
        useCompressedOops = in.readOptionalString();
    } else {
        useCompressedOops = null;
    }
}
 
Example 9
Source File: NodeMappingRefreshAction.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    index = in.readString();
    types = in.readStringArray();
    nodeId = in.readString();
    indexUUID = in.readString();
}
 
Example 10
Source File: TermsByQueryShardRequest.java    From siren-join with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * Deserialize
 *
 * @param in the input
 * @throws IOException
 */
@Override
public void readFrom(StreamInput in) throws IOException {
  super.readFrom(in);
  request = new TermsByQueryRequest();
  request.readFrom(in);

  if (in.readBoolean()) {
    filteringAliases = in.readStringArray();
  }
}
 
Example 11
Source File: ClusterInfoRequest.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    indices = in.readStringArray();
    types = in.readStringArray();
    indicesOptions = IndicesOptions.readIndicesOptions(in);
}
 
Example 12
Source File: ClusterSearchShardsRequest.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);

    indices = new String[in.readVInt()];
    for (int i = 0; i < indices.length; i++) {
        indices[i] = in.readString();
    }

    routing = in.readOptionalString();
    preference = in.readOptionalString();

    types = in.readStringArray();
    indicesOptions = IndicesOptions.readIndicesOptions(in);
}
 
Example 13
Source File: JvmInfo.java    From elasticsearch-helper with Apache License 2.0 5 votes vote down vote up
@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());
    }
    stats.timestamp = in.readVLong();
    stats.uptime = in.readVLong();

    stats.threads = Threads.readThreads(in);
    memoryPools = in.readStringArray();
    stats.mem = Mem.readMem(in);
    gcCollectors = in.readStringArray();
    stats.gc = GarbageCollectors.readGarbageCollectors(in);

    if (in.readBoolean()) {
        size = in.readVInt();
        stats.bufferPools = new ArrayList<>(size);
        for (int i = 0; i < size; i++) {
            BufferPool bufferPool = new BufferPool();
            bufferPool.readFrom(in);
            stats.bufferPools.add(bufferPool);
        }
    }
}
 
Example 14
Source File: PutMappingRequest.java    From crate with Apache License 2.0 5 votes vote down vote up
public PutMappingRequest(StreamInput in) throws IOException {
    super(in);
    indices = in.readStringArray();
    indicesOptions = IndicesOptions.readIndicesOptions(in);
    type = in.readOptionalString();
    source = in.readString();
    updateAllTypes = in.readBoolean();
    concreteIndex = in.readOptionalWriteable(Index::new);
}
 
Example 15
Source File: MultiPercolateRequest.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    indices = in.readStringArray();
    documentType = in.readOptionalString();
    indicesOptions = IndicesOptions.readIndicesOptions(in);
    int size = in.readVInt();
    for (int i = 0; i < size; i++) {
        PercolateRequest request = new PercolateRequest();
        request.readFrom(in);
        requests.add(request);
    }
}
 
Example 16
Source File: CoordinateSearchMetadata.java    From siren-join with GNU Affero General Public License v3.0 4 votes vote down vote up
public void readFrom(StreamInput in) throws IOException {
  this.indices = in.readStringArray();
  this.types = in.readStringArray();
  this.field = in.readOptionalString();
}
 
Example 17
Source File: IndicesExistsRequest.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    indices = in.readStringArray();
    indicesOptions = IndicesOptions.readIndicesOptions(in);
}
 
Example 18
Source File: DetailAnalyzeResponse.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    name = in.readString();
    texts = in.readStringArray();
}
 
Example 19
Source File: IndicesAliasesRequest.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
public AliasActions readFrom(StreamInput in) throws IOException {
    indices = in.readStringArray();
    aliases = in.readStringArray();
    aliasAction = readAliasAction(in);
    return this;
}
 
Example 20
Source File: GetIndexTemplatesRequest.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    names = in.readStringArray();
}