store = new Store(shardId, this.indexSettings, directoryService.newDirectory(), lock, new StoreCloseListener(shardId, () -> eventListener.onStoreClosed(shardId))); indexShard = new IndexShard(routing, this.indexSettings, path, store, indexSortSupplier,
StoreStatsCache(TimeValue refreshInterval, Directory directory, DirectoryService directoryService) throws IOException { super(refreshInterval, new StoreStats(estimateSize(directory), directoryService.throttleTimeInNanos())); this.directory = directory; this.directoryService = directoryService; }
public Store(ShardId shardId, IndexSettings indexSettings, DirectoryService directoryService, ShardLock shardLock, OnClose onClose) throws IOException { super(shardId, indexSettings); final Settings settings = indexSettings.getSettings(); this.directory = new StoreDirectory(directoryService.newDirectory(), Loggers.getLogger("index.store.deletes", settings, shardId)); this.shardLock = shardLock; this.onClose = onClose; final TimeValue refreshInterval = indexSettings.getValue(INDEX_STORE_STATS_REFRESH_INTERVAL_SETTING); this.statsCache = new StoreStatsCache(refreshInterval, directory, directoryService); logger.debug("store stats are refreshed with refresh_interval [{}]", refreshInterval); assert onClose != null; assert shardLock != null; assert shardLock.getShardId().equals(shardId); }
public StoreStatsCache(TimeValue refreshInterval, Directory directory, DirectoryService directoryService) throws IOException { super(refreshInterval, new StoreStats(estimateSize(directory), directoryService.throttleTimeInNanos())); this.directory = directory; this.directoryService = directoryService; }
public Store(ShardId shardId, Settings indexSettings, DirectoryService directoryService, ShardLock shardLock, OnClose onClose) throws IOException { super(shardId, indexSettings); this.directory = new StoreDirectory(directoryService.newDirectory(), Loggers.getLogger("index.store.deletes", indexSettings, shardId)); this.shardLock = shardLock; this.onClose = onClose; final TimeValue refreshInterval = indexSettings.getAsTime(INDEX_STORE_STATS_REFRESH_INTERVAL, TimeValue.timeValueSeconds(10)); this.statsCache = new StoreStatsCache(refreshInterval, directory, directoryService); logger.debug("store stats are refreshed with refresh_interval [{}]", refreshInterval); assert onClose != null; assert shardLock != null; assert shardLock.getShardId().equals(shardId); }
@Override protected StoreStats refresh() { try { return new StoreStats(estimateSize(directory), directoryService.throttleTimeInNanos()); } catch (IOException ex) { throw new ElasticsearchException("failed to refresh store stats", ex); } }
store = new Store(shardId, this.indexSettings, directoryService.newDirectory(), lock, new StoreCloseListener(shardId, () -> eventListener.onStoreClosed(shardId))); indexShard = new IndexShard(routing, this.indexSettings, path, store, indexSortSupplier,
@Override protected StoreStats refresh() { try { return new StoreStats(estimateSize(directory), directoryService.throttleTimeInNanos()); } catch (IOException ex) { throw new ElasticsearchException("failed to refresh store stats", ex); } }