use of io.crate.blob.v2.BlobIndex in project crate by crate.
the class BlobIndicesService method indexShardStateChanged.
@Override
public void indexShardStateChanged(IndexShard indexShard, @Nullable IndexShardState previousState, IndexShardState currentState, @Nullable String reason) {
if (currentState == IndexShardState.POST_RECOVERY) {
String index = indexShard.shardId().getIndexName();
if (isBlobIndex(index)) {
BlobIndex blobIndex = indices.get(index);
blobIndex.initializeShard(indexShard);
}
}
}
use of io.crate.blob.v2.BlobIndex in project crate by crate.
the class BlobIndicesService method afterIndexShardCreated.
@Override
public void afterIndexShardCreated(IndexShard indexShard) {
String index = indexShard.shardId().getIndexName();
if (isBlobIndex(index)) {
BlobIndex blobIndex = indices.get(index);
assert blobIndex != null : "blobIndex must exists if a shard is created in it";
blobIndex.createShard(indexShard);
}
}
use of io.crate.blob.v2.BlobIndex in project crate by crate.
the class BlobIntegrationTestBase method forEachIndicesMap.
private void forEachIndicesMap(Consumer<Map<String, BlobIndex>> consumer) {
Iterable<BlobIndicesService> blobIndicesServices = internalCluster().getInstances(BlobIndicesService.class);
for (BlobIndicesService blobIndicesService : blobIndicesServices) {
try {
Map<String, BlobIndex> indices = (Map<String, BlobIndex>) indicesField.get(blobIndicesService);
consumer.accept(indices);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
}
}
Aggregations