wuda0112 commented on pull request #224:
URL: https://github.com/apache/lucene/pull/224#issuecomment-906430050
> This looks good to me. Since we don't need to encode these numbers
differently maybe we could have a single abstract method, e.g.
>
> MultiLevelSkipListWriter
>
> ```java
> /**
> * Write a small positive long on a variable number of bytes.
> *
> * @param l the long to write
> * @param out the output to write to
> */
> protected void writeVLong(long l, DataOutput out) throws IOException{
> out.writeVLong(l);
> }
> ```
>
> MultiLevelSkipListReader
>
> ```java
> /**
> * Read a long written via {@link MultiLevelSkipListWriter#writeVLong}.
> *
> * @param in the IndexInput to read from
> */
> protected long readVLong(IndexInput in) throws IOException {
> return in.readVLong();
> }
> ```
>
> This is a small enough change to an internal class that I don't feel the
need to open a separate issue, we could do it on this PR.
There has one thing i want to confirm, since subclass do not know the
numbers is writing stands for(eg. for level length or child pointer), so
subclass can not add modifier and hierarchy befor the numbers, so the file may
be looks like case 1:
Case 1: no hierarchy and modifier
```
field title
term lucene
doc 499
freq 1
pos 3
skipList
1024
level 2
skipDoc 218
skipDocFP 15469
impacts
impact
freq 1
norm 1
impactsEnd
64
```
Case 2: we may expect
```
field title
term lucene
doc 499
freq 1
pos 3
skipList
1024
level 2
skipDoc 218
skipDocFP 15469
impacts
impact
freq 1
norm 1
impactsEnd
childPointer 64
```
Of course, **it is completely no need to change API to unsuitable state and
it may be just only for this PR**, so for me both case 1 and case 2 are ok!
What is your opinion, and case 1 is ok?
--
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]