Java Code Examples for org.elasticsearch.index.shard.ShardId#readShardId()
The following examples show how to use
org.elasticsearch.index.shard.ShardId#readShardId() .
These examples are extracted from open source projects.
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 Project: Elasticsearch File: SnapshotsInProgress.java License: Apache License 2.0 | 6 votes |
@Override public SnapshotsInProgress readFrom(StreamInput in) throws IOException { Entry[] entries = new Entry[in.readVInt()]; for (int i = 0; i < entries.length; i++) { SnapshotId snapshotId = SnapshotId.readSnapshotId(in); boolean includeGlobalState = in.readBoolean(); State state = State.fromValue(in.readByte()); int indices = in.readVInt(); List<String> indexBuilder = new ArrayList<>(); for (int j = 0; j < indices; j++) { indexBuilder.add(in.readString()); } long startTime = in.readLong(); ImmutableMap.Builder<ShardId, ShardSnapshotStatus> builder = ImmutableMap.builder(); int shards = in.readVInt(); for (int j = 0; j < shards; j++) { ShardId shardId = ShardId.readShardId(in); String nodeId = in.readOptionalString(); State shardState = State.fromValue(in.readByte()); builder.put(shardId, new ShardSnapshotStatus(nodeId, shardState)); } entries[i] = new Entry(snapshotId, includeGlobalState, state, Collections.unmodifiableList(indexBuilder), startTime, builder.build()); } return new SnapshotsInProgress(entries); }
Example 2
Source Project: Elasticsearch File: RestoreInProgress.java License: Apache License 2.0 | 6 votes |
/** * {@inheritDoc} */ @Override public RestoreInProgress readFrom(StreamInput in) throws IOException { Entry[] entries = new Entry[in.readVInt()]; for (int i = 0; i < entries.length; i++) { SnapshotId snapshotId = SnapshotId.readSnapshotId(in); State state = State.fromValue(in.readByte()); int indices = in.readVInt(); List<String> indexBuilder = new ArrayList<>(); for (int j = 0; j < indices; j++) { indexBuilder.add(in.readString()); } ImmutableMap.Builder<ShardId, ShardRestoreStatus> builder = ImmutableMap.<ShardId, ShardRestoreStatus>builder(); int shards = in.readVInt(); for (int j = 0; j < shards; j++) { ShardId shardId = ShardId.readShardId(in); ShardRestoreStatus shardState = ShardRestoreStatus.readShardRestoreStatus(in); builder.put(shardId, shardState); } entries[i] = new Entry(snapshotId, state, Collections.unmodifiableList(indexBuilder), builder.build()); } return new RestoreInProgress(entries); }
Example 3
Source Project: Elasticsearch File: AllocationExplanation.java License: Apache License 2.0 | 6 votes |
@Override public void readFrom(StreamInput in) throws IOException { int size = in.readVInt(); for (int i = 0; i < size; i++) { ShardId shardId = ShardId.readShardId(in); int size2 = in.readVInt(); List<NodeExplanation> ne = new ArrayList<>(size2); for (int j = 0; j < size2; j++) { DiscoveryNode node = null; if (in.readBoolean()) { node = DiscoveryNode.readNode(in); } ne.add(new NodeExplanation(node, in.readString())); } explanations.put(shardId, ne); } }
Example 4
Source Project: Elasticsearch File: RecoveryCheckTranslogOffsetRequest.java License: Apache License 2.0 | 5 votes |
@Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); recoveryId = in.readLong(); shardId = ShardId.readShardId(in); currentOffset = in.readLong(); }
Example 5
Source Project: Elasticsearch File: ShardsSyncedFlushResult.java License: Apache License 2.0 | 5 votes |
@Override public void readFrom(StreamInput in) throws IOException { failureReason = in.readOptionalString(); int numResponses = in.readInt(); shardResponses = new HashMap<>(); for (int i = 0; i < numResponses; i++) { ShardRouting shardRouting = ShardRouting.readShardRoutingEntry(in); SyncedFlushService.ShardSyncedFlushResponse response = SyncedFlushService.ShardSyncedFlushResponse.readSyncedFlushResponse(in); shardResponses.put(shardRouting, response); } syncId = in.readOptionalString(); shardId = ShardId.readShardId(in); totalShards = in.readInt(); }
Example 6
Source Project: elasticsearch-helper File: IngestReplicaShardRequest.java License: Apache License 2.0 | 5 votes |
@Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); index = in.readString(); timeout = TimeValue.readTimeValue(in); ingestId = in.readLong(); shardId = ShardId.readShardId(in); int size = in.readVInt(); actionRequests = new LinkedList<>(); for (int i = 0; i < size; i++) { boolean exists = in.readBoolean(); if (exists) { boolean b = in.readBoolean(); if (b) { IndexRequest indexRequest = new IndexRequest(); indexRequest.readFrom(in); actionRequests.add(indexRequest); } else { DeleteRequest deleteRequest = new DeleteRequest(); deleteRequest.readFrom(in); actionRequests.add(deleteRequest); } } else { actionRequests.add(null); } } }
Example 7
Source Project: Elasticsearch File: RecoveryTranslogOperationsRequest.java License: Apache License 2.0 | 5 votes |
@Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); recoveryId = in.readLong(); shardId = ShardId.readShardId(in); operations = Translog.readOperations(in); totalTranslogOps = in.readVInt(); }
Example 8
Source Project: Elasticsearch File: SingleShardRequest.java License: Apache License 2.0 | 5 votes |
@Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); if (in.readBoolean()) { internalShardId = ShardId.readShardId(in); } index = in.readOptionalString(); // no need to pass threading over the network, they are always false when coming throw a thread pool }
Example 9
Source Project: Elasticsearch File: StartRecoveryRequest.java License: Apache License 2.0 | 5 votes |
@Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); recoveryId = in.readLong(); shardId = ShardId.readShardId(in); sourceNode = DiscoveryNode.readNode(in); targetNode = DiscoveryNode.readNode(in); markAsRelocated = in.readBoolean(); metadataSnapshot = new Store.MetadataSnapshot(in); recoveryType = RecoveryState.Type.fromId(in.readByte()); }
Example 10
Source Project: Elasticsearch File: RecoveryCleanFilesRequest.java License: Apache License 2.0 | 5 votes |
@Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); recoveryId = in.readLong(); shardId = ShardId.readShardId(in); snapshotFiles = new Store.MetadataSnapshot(in); totalTranslogOps = in.readVInt(); }
Example 11
Source Project: Elasticsearch File: SnapshotShardsService.java License: Apache License 2.0 | 5 votes |
@Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); snapshotId = SnapshotId.readSnapshotId(in); shardId = ShardId.readShardId(in); status = SnapshotsInProgress.ShardSnapshotStatus.readShardSnapshotStatus(in); }
Example 12
Source Project: Elasticsearch File: IndicesStore.java License: Apache License 2.0 | 5 votes |
@Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); clusterName = ClusterName.readClusterName(in); indexUUID = in.readString(); shardId = ShardId.readShardId(in); timeout = new TimeValue(in.readLong(), TimeUnit.MILLISECONDS); }
Example 13
Source Project: elasticsearch-helper File: IngestLeaderShardResponse.java License: Apache License 2.0 | 5 votes |
@Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); tookInMillis = in.readLong(); ingestId = in.readLong(); if (in.readBoolean()) { shardId = ShardId.readShardId(in); } successCount = in.readVInt(); quorumShards = in.readVInt(); actionRequests = new LinkedList<>(); int size = in.readVInt(); for (int i = 0; i < size; i++) { boolean exists = in.readBoolean(); if (exists) { boolean b = in.readBoolean(); if (b) { IndexRequest indexRequest = new IndexRequest(); indexRequest.readFrom(in); actionRequests.add(indexRequest); } else { DeleteRequest deleteRequest = new DeleteRequest(); deleteRequest.readFrom(in); actionRequests.add(deleteRequest); } } else { actionRequests.add(null); } } failures = new LinkedList<>(); size = in.readVInt(); for (int i = 0; i < size; i++) { failures.add(IngestActionFailure.from(in)); } }
Example 14
Source Project: Elasticsearch File: MoveAllocationCommand.java License: Apache License 2.0 | 4 votes |
@Override public MoveAllocationCommand readFrom(StreamInput in) throws IOException { return new MoveAllocationCommand(ShardId.readShardId(in), in.readString(), in.readString()); }
Example 15
Source Project: Elasticsearch File: BlobStartRecoveryRequest.java License: Apache License 2.0 | 4 votes |
@Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); shardId = ShardId.readShardId(in); }
Example 16
Source Project: Elasticsearch File: SyncedFlushService.java License: Apache License 2.0 | 4 votes |
@Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); this.shardId = ShardId.readShardId(in); }
Example 17
Source Project: Elasticsearch File: SyncedFlushService.java License: Apache License 2.0 | 4 votes |
@Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); shardId = ShardId.readShardId(in); }
Example 18
Source Project: Elasticsearch File: BroadcastShardRequest.java License: Apache License 2.0 | 4 votes |
@Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); shardId = ShardId.readShardId(in); originalIndices = OriginalIndices.readOriginalIndices(in); }
Example 19
Source Project: Elasticsearch File: TransportNodesListShardStoreMetaData.java License: Apache License 2.0 | 4 votes |
@Override public void readFrom(StreamInput in) throws IOException { allocated = in.readBoolean(); shardId = ShardId.readShardId(in); this.metadataSnapshot = new Store.MetadataSnapshot(in); }
Example 20
Source Project: Elasticsearch File: CancelAllocationCommand.java License: Apache License 2.0 | 4 votes |
@Override public CancelAllocationCommand readFrom(StreamInput in) throws IOException { return new CancelAllocationCommand(ShardId.readShardId(in), in.readString(), in.readBoolean()); }