-
Notifications
You must be signed in to change notification settings - Fork 1
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
Hdu reader skip rows #349
Hdu reader skip rows #349
Conversation
@@ -35,6 +35,12 @@ | |||
final DataInputStream tableDataStream; | |||
DataInputStream heapDataStream = null; | |||
|
|||
private final Header header; |
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.
why not public final?
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.
I learned not to expose any variables outside so I did that here, but yeah it is final it can be public. Changed it and removed the getter.
@@ -127,4 +127,8 @@ public Data readNext() throws Exception { | |||
|
|||
return item; | |||
} | |||
|
|||
public Reader getReader() { |
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.
Is this just for tests? Then Reader could be package private and the getter is unnecessary
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.
I need this also later in the SamplePedestal
processor but I changed it to a skipToRow function as this is the only thing I need. No reason to expose the whole reader.
@Override | ||
public void skipToRow(int num) throws IOException { | ||
//calc zshrink problem | ||
//num = num+1; |
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.
remove or explain
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.
fixed the error and thus the problem with zshrink
…other small changes
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.
This looks really nice. Made some minor suggestions.
@@ -141,4 +143,13 @@ private Serializable readArrayFromStream(BinTable.TableColumn c, DataInputStream | |||
} | |||
return null; | |||
} | |||
|
|||
@Override | |||
public void skipToRow(int num) throws IOException { |
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.
Can you write a little docstring here?
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.
sure and done
@@ -127,4 +127,8 @@ public Data readNext() throws Exception { | |||
|
|||
return item; | |||
} | |||
|
|||
public void skipToRow(int num) throws IOException{ |
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.
Some javadoc would be nice
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.
Done
* @param num The amount of rows to skip. | ||
* @throws IOException | ||
*/ | ||
void skipToRow(int num) throws IOException; |
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.
It skips 'num' rows right? So if i call 'skipToRow(4)' twice in a row im looking at row 8 right? I propose to change the name of the method to simply 'skipRows'
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.
It skipped to the row from the beginning and could only be called from there, I changed it now to be able to skip rows whenever
As said in the reply to @mackaiver, the skipToRow function is now a skipRows function that allows to skip from any position in the file. |
Removed the commented lines. If this was all it should be ready for merge. |
Added the ability to skip rows in the HDU reader. This is nedded for the SamplePedestalEvent processor that is coming in a later pull request.
This is the second part of the pull request simplification of #246 and can be merged independently of #348.