-
Notifications
You must be signed in to change notification settings - Fork 78
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
fixes #867 - Stream support for Scanners #884
Conversation
this.age = a; | ||
this.id = id; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since these are being placed in a set, also need to implement equals method.
expected.add(new Person("Hulk", "Hogan", 60, 55234234)); | ||
|
||
Assert.assertEquals(expected.hashCode(), people.hashCode()); | ||
Assert.assertEquals(expected.size(), people.size()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After adding a equals method to the Person type , you can replace these two checks with :
Assert.assertEquals(expected, people);
colsVal.add(new ColumnValue(new Column("f1", "q2"), Bytes.of("v4"))); | ||
colsVal.add(new ColumnValue(new Column("f2", "q5"), Bytes.of("v5"))); | ||
|
||
ColumnScanner colScanStream = new ColumnScannerImpl(row, colsVal); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I would not have Stream in this var name. Could call it scanner
of colScanner
rowCols.stream().filter(rcv -> rcv.getColumn().getsFamily().equals("f2")) | ||
.collect(Collectors.toSet()); | ||
cellScanStream.stream().filter(rcv -> rcv.getColumn().getsFamily().equals("f2")) | ||
.collect(Collectors.toSet()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing is done with the sets created by the two stream operations above.
No description provided.