@Override protected ReplicaResult shardOperationOnReplica(ShardFlushRequest request, IndexShard replica) { replica.flush(request.getRequest()); logger.trace("{} flush request executed on replica", replica.shardId()); return new ReplicaResult(); } }
@Override protected PrimaryResult shardOperationOnPrimary(ShardFlushRequest shardRequest, IndexShard primary) { primary.flush(shardRequest.getRequest()); logger.trace("{} flush request executed on primary", primary.shardId()); return new PrimaryResult(shardRequest, new ReplicationResponse()); }
private PreSyncedFlushResponse performPreSyncedFlush(PreShardSyncedFlushRequest request) { IndexShard indexShard = indicesService.indexServiceSafe(request.shardId().getIndex()).getShard(request.shardId().id()); FlushRequest flushRequest = new FlushRequest().force(false).waitIfOngoing(true); logger.trace("{} performing pre sync flush", request.shardId()); indexShard.flush(flushRequest); final CommitStats commitStats = indexShard.commitStats(); final Engine.CommitId commitId = commitStats.getRawCommitId(); logger.trace("{} pre sync flush done. commit id {}, num docs {}", request.shardId(), commitId, commitStats.getNumDocs()); return new PreSyncedFlushResponse(commitId, commitStats.getNumDocs(), commitStats.syncId()); }
final TranslogStats translogStats = translogStats(); flush(new FlushRequest().waitIfOngoing(true)); synchronized (mutex) { verifyNotClosed();
@Override protected void doRun() throws Exception { flush(new FlushRequest()); }
@Override protected void doRun() throws Exception { try { indexShard.flush(new FlushRequest()); } catch (IllegalIndexShardStateException e) { // we are being closed, or in created state, ignore } catch (FlushNotAllowedEngineException e) { // ignore this exception, we are not allowed to perform flush } lastFlushTime = threadPool.estimatedTimeInMillis(); reschedule(); } });
@Override protected ReplicaResult shardOperationOnReplica(ShardFlushRequest request, IndexShard replica) { replica.flush(request.getRequest()); logger.trace("{} flush request executed on replica", replica.shardId()); return new ReplicaResult(); } }
@Override protected ReplicaResult shardOperationOnReplica(ShardFlushRequest request, IndexShard replica) { replica.flush(request.getRequest()); logger.trace("{} flush request executed on replica", replica.shardId()); return new ReplicaResult(); } }
@Override protected ReplicaResult shardOperationOnReplica(ShardFlushRequest request, IndexShard replica) { replica.flush(request.getRequest()); logger.trace("{} flush request executed on replica", replica.shardId()); return new ReplicaResult(); }
@Override protected PrimaryResult shardOperationOnPrimary(ShardFlushRequest shardRequest, IndexShard primary) { primary.flush(shardRequest.getRequest()); logger.trace("{} flush request executed on primary", primary.shardId()); return new PrimaryResult(shardRequest, new ReplicationResponse()); }
@Override protected PrimaryResult shardOperationOnPrimary(ShardFlushRequest shardRequest, IndexShard primary) { primary.flush(shardRequest.getRequest()); logger.trace("{} flush request executed on primary", primary.shardId()); return new PrimaryResult(shardRequest, new ReplicationResponse()); }
@Override protected PrimaryResult shardOperationOnPrimary(ShardFlushRequest shardRequest, IndexShard primary) { primary.flush(shardRequest.getRequest()); logger.trace("{} flush request executed on primary", primary.shardId()); return new PrimaryResult(shardRequest, new ReplicationResponse()); }
protected void flushShard(IndexShard shard, boolean force) { shard.flush(new FlushRequest(shard.shardId().getIndexName()).force(force)); }
long start = System.currentTimeMillis(); indexInfo.updated = false; // reset updated state indexShard.flush(new FlushRequest().force(false).waitIfOngoing(true)); if (logger.isInfoEnabled()) logger.info("Elasticsearch index=[{}] flushed, duration={}ms",indexInfo.name, System.currentTimeMillis() - start);
private PreSyncedFlushResponse performPreSyncedFlush(PreShardSyncedFlushRequest request) { IndexShard indexShard = indicesService.indexServiceSafe(request.shardId().getIndex()).getShard(request.shardId().id()); FlushRequest flushRequest = new FlushRequest().force(false).waitIfOngoing(true); logger.trace("{} performing pre sync flush", request.shardId()); Engine.CommitId commitId = indexShard.flush(flushRequest); logger.trace("{} pre sync flush done. commit id {}", request.shardId(), commitId); return new PreSyncedFlushResponse(commitId); }
private PreSyncedFlushResponse performPreSyncedFlush(PreShardSyncedFlushRequest request) { IndexShard indexShard = indicesService.indexServiceSafe(request.shardId().getIndex()).getShard(request.shardId().id()); FlushRequest flushRequest = new FlushRequest().force(false).waitIfOngoing(true); logger.trace("{} performing pre sync flush", request.shardId()); indexShard.flush(flushRequest); final CommitStats commitStats = indexShard.commitStats(); final Engine.CommitId commitId = commitStats.getRawCommitId(); logger.trace("{} pre sync flush done. commit id {}, num docs {}", request.shardId(), commitId, commitStats.getNumDocs()); return new PreSyncedFlushResponse(commitId, commitStats.getNumDocs(), commitStats.syncId()); }
@Override protected void shardOperationOnReplica(ShardFlushRequest request) { IndexShard indexShard = indicesService.indexServiceSafe(request.shardId().getIndex()).shardSafe(request.shardId().id()); indexShard.flush(request.getRequest()); logger.trace("{} flush request executed on replica", indexShard.shardId()); }
private PreSyncedFlushResponse performPreSyncedFlush(PreShardSyncedFlushRequest request) { IndexShard indexShard = indicesService.indexServiceSafe(request.shardId().getIndex()).getShard(request.shardId().id()); FlushRequest flushRequest = new FlushRequest().force(false).waitIfOngoing(true); logger.trace("{} performing pre sync flush", request.shardId()); indexShard.flush(flushRequest); final CommitStats commitStats = indexShard.commitStats(); final Engine.CommitId commitId = commitStats.getRawCommitId(); logger.trace("{} pre sync flush done. commit id {}, num docs {}", request.shardId(), commitId, commitStats.getNumDocs()); return new PreSyncedFlushResponse(commitId, commitStats.getNumDocs(), commitStats.syncId()); }
@Override protected Tuple<ActionWriteResponse, ShardFlushRequest> shardOperationOnPrimary(MetaData metaData, ShardFlushRequest shardRequest) throws Throwable { IndexShard indexShard = indicesService.indexServiceSafe(shardRequest.shardId().getIndex()).shardSafe(shardRequest.shardId().id()); indexShard.flush(shardRequest.getRequest()); logger.trace("{} flush request executed on primary", indexShard.shardId()); return new Tuple<>(new ActionWriteResponse(), shardRequest); }
private PreSyncedFlushResponse performPreSyncedFlush(PreShardSyncedFlushRequest request) { IndexShard indexShard = indicesService.indexServiceSafe(request.shardId().getIndex()).shardSafe(request.shardId().id()); FlushRequest flushRequest = new FlushRequest().force(false).waitIfOngoing(true); logger.trace("{} performing pre sync flush", request.shardId()); Engine.CommitId commitId = indexShard.flush(flushRequest); logger.trace("{} pre sync flush done. commit id {}", request.shardId(), commitId); return new PreSyncedFlushResponse(commitId); }