-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] RingsDetection test did not meet expectations #275
Comments
Possible solutions: @Override
public boolean hasNext() {
if (this.valueValid) {
return true;
}
if (MessageInput.this.messages.hasNext()) {
KvEntry entry = MessageInput.this.messages.peek();
Pointer key = entry.key();
int status = this.vidPointer.compareTo(key);
if (status == 0) {
MessageInput.this.messages.next();
this.valueValid = true;
try {
BytesInput in = IOFactory.createBytesInput(
entry.value().bytes());
// create a new value
MessageInput.this.value = MessageInput.this.config
.createObject(ComputerOptions.ALGORITHM_MESSAGE_CLASS);
MessageInput.this.value.read(in);
|
always return the same Object is reduce memory pressure and avoid GC |
Yep~ But semantically, Do we have some more elegant solutions? |
@javeme please take a look for this question. This does make it confusing for users. |
I agree this is a problem, it sacrifices user-friendliness for performance. |
Bug Type (问题类型)
data inconsistency (计算结果不合预期)
Before submit
Environment (环境信息)
Expected & Actual behavior (期望与实际表现)
Run
org.apache.hugegraph.computer.algorithm.path.rings.RingsDetectionTest#testRunAlgorithm
,Vertex A expected result is:
But got:
I modified some code and it works.
Further debug, I found
messages.next()
always return the same address Object(Field value may be different)!!!, it's a reference Object.Semantically, I think
messages.next()
should return a different address Object.The text was updated successfully, but these errors were encountered: