protected CompletableFuture<List<IndexItem>> queryAsyncFromUnsealedFile(
        String key, int maxCount, long beginTime, long endTime) {

        return CompletableFuture.supplyAsync(() -> {
            List<IndexItem> result = new ArrayList<>();
            try {
                fileReadWriteLock.readLock().lock();
                if (!UNSEALED.equals(this.fileStatus.get()) && !SEALED.equals(this.fileStatus.get())) {
                    return result;
                }

                if (mappedFile == null || !mappedFile.hold()) {
                    return result;
                }

                int hashCode = this.hashCode(key);
                int slotPosition = this.getSlotPosition(hashCode % this.hashSlotMaxCount);
                int slotValue = this.getSlotValue(slotPosition);

                int left = MAX_QUERY_COUNT;
                while (left > 0 &&
                    slotValue > INVALID_INDEX &&
                    slotValue <= this.indexItemCount.get()) {

                    byte[] bytes = new byte[IndexItem.INDEX_ITEM_SIZE];
                    ByteBuffer buffer = this.byteBuffer.duplicate();
                    buffer.position(this.getItemPosition(slotValue));
                    buffer.get(bytes);
                    IndexItem indexItem = new IndexItem(bytes);
                    long storeTimestamp = indexItem.getTimeDiff() + beginTimestamp.get();
                    if (hashCode == indexItem.getHashCode() &&
                        beginTime <= storeTimestamp && storeTimestamp <= endTime) {
                        result.add(indexItem);
                        if (result.size() > maxCount) {
                            break;
                        }
                    }
                    slotValue = indexItem.getItemIndex();
                    left--;
                }

                log.debug("IndexStoreFile query from unsealed mapped file, timestamp: {}, result size: {}, " +
                        "key: {}, hashCode: {}, maxCount: {}, timestamp={}-{}",
                    getTimestamp(), result.size(), key, hashCode, maxCount, beginTime, endTime);
            } catch (Exception e) {
                log.error("IndexStoreFile query from unsealed mapped file error, timestamp: {}, " +
                    "key: {}, maxCount: {}, timestamp={}-{}", getTimestamp(), key, maxCount, beginTime, endTime, e);
            } finally {
                fileReadWriteLock.readLock().unlock();
                mappedFile.release();
            }
            return result;
        }, MessageStoreExecutor.getInstance().bufferFetchExecutor);
    }
@Test
    public void queryAsyncFromUnsealedFileTest() throws Exception {
        long timestamp = indexStoreFile.getTimestamp();
        for (int i = 0; i < 5; i++) {
            for (int j = 0; j < 3; j++) {
                Assert.assertEquals(AppendResult.SUCCESS, indexStoreFile.putKey(TOPIC_NAME + i,
                    TOPIC_ID, QUEUE_ID, KEY_SET, MESSAGE_OFFSET, MESSAGE_SIZE, System.currentTimeMillis()));
            }
        }
        List<IndexItem> itemList = indexStoreFile.queryAsync(
            TOPIC_NAME + "1", KEY, 64, timestamp, System.currentTimeMillis()).get();
        Assert.assertEquals(3, itemList.size());
    }