dosubot[bot] commented on issue #2657:
URL:
https://github.com/apache/incubator-hugegraph/issues/2657#issuecomment-2329090164
<!-- Answer -->
To limit the flow on the hstore side in Apache HugeGraph, you can use the
`scanIterator` method with a specified limit. The `scanIterator` method allows
you to set a limit on the number of entries returned during the scan. Here is
an example:
```java
HgStoreTestUtil.println("-- test limit 1 to 10 --");
for (int i = 1; i <= 10; i++) {
HgStoreTestUtil.println("- limit " + i + " -");
int limit = i;
HgKvIterator<HgKvEntry> iterator = session.scanIterator(tableName,
HgStoreTestUtil.toOwnerKey(keyName + "-0"),
HgStoreTestUtil.toOwnerKey(keyName + "-1"), limit);
int count = 0;
while (iterator.hasNext()) {
count++;
HgKvEntry entry = iterator.next();
HgStoreTestUtil.println(entry);
}
Assert.assertEquals(limit, count);
}
```
In this example, the `scanIterator` method is called with a limit parameter
that controls the number of entries returned. The loop iterates from 1 to 10,
setting different limits for each iteration. This effectively limits the flow
of data on the hstore side
<sup>[[1]](https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-store/hg-store-test/src/main/java/org/apache/hugegraph/store/client/HgStoreNodeStreamTest.java)</sup>.
<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]