Search in sources :

Example 1 with BlobIndex

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);
        }
    }
}
Also used : BlobIndex.isBlobIndex(io.crate.blob.v2.BlobIndex.isBlobIndex)

Example 2 with BlobIndex

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);
    }
}
Also used : BlobIndex.isBlobIndex(io.crate.blob.v2.BlobIndex.isBlobIndex)

Example 3 with BlobIndex

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);
        }
    }
}
Also used : BlobIndicesService(io.crate.blob.v2.BlobIndicesService) Map(java.util.Map) BlobIndex(io.crate.blob.v2.BlobIndex)

Aggregations

BlobIndex.isBlobIndex (io.crate.blob.v2.BlobIndex.isBlobIndex)2 BlobIndex (io.crate.blob.v2.BlobIndex)1 BlobIndicesService (io.crate.blob.v2.BlobIndicesService)1 Map (java.util.Map)1