Displaying 8 results from an estimated 8 matches for "readinto".
2019 Nov 23
2
Re: [PATCH nbdkit v2 10/10] tests: Test the Python plugin thoroughly.
...http.getresponse()
...
return bytearray(r.read())
This is sad because on the C side we mempcpy the data again. So with this patch
we avoid one copy of the two.
To avoid all unneeded copies, we need to change pread() to:
def pread(h, buf, offset):
So the python side we can do:
f.readinto(buf)
Or:
sock.recv_info(buf)
It does not work for HTTPResponse, so in this case we have to do:
buf[:] = r.read()
Since we work on v2 now, I think we should consider this change.
An uglier alternative is:
def preadinto(h, buf, offset):
Matching python read() and readinto() interf...
2019 Nov 24
1
Re: [PATCH nbdkit v2 10/10] tests: Test the Python plugin thoroughly.
...e we mempcpy the data again. So with
> this patch
> > we avoid one copy of the two.
> >
> > To avoid all unneeded copies, we need to change pread() to:
> >
> > def pread(h, buf, offset):
> >
> > So the python side we can do:
> >
> > f.readinto(buf)
> >
> > Or:
> >
> > sock.recv_info(buf)
> >
> > It does not work for HTTPResponse, so in this case we have to do:
> >
> > buf[:] = r.read()
> >
> > Since we work on v2 now, I think we should consider this change.
>
> Rig...
2019 Nov 25
3
[PATCH nbdkit 0/2] python: Implement pread passing buffer for v2 API.
As suggested by Nir, here:
https://www.redhat.com/archives/libguestfs/2019-November/thread.html#00220
2019 Nov 24
0
Re: [PATCH nbdkit v2 10/10] tests: Test the Python plugin thoroughly.
...))
>
> This is sad because on the C side we mempcpy the data again. So with this patch
> we avoid one copy of the two.
>
> To avoid all unneeded copies, we need to change pread() to:
>
> def pread(h, buf, offset):
>
> So the python side we can do:
>
> f.readinto(buf)
>
> Or:
>
> sock.recv_info(buf)
>
> It does not work for HTTPResponse, so in this case we have to do:
>
> buf[:] = r.read()
>
> Since we work on v2 now, I think we should consider this change.
Right, we can consider this for v2, while leaving v1 calle...
2019 Nov 25
0
[PATCH nbdkit 1/2] python: For v2 API, avoid copy by passing a buffer to pread.
It's more efficient if we pass the C buffer directly to Python code.
In some cases the Python code will be able to write directly into the
C buffer using functions like file.readinto and socket.recv_into.
This avoids an extra copy.
Thanks: Nir Soffer
---
plugins/python/example.py | 8 ++++---
plugins/python/nbdkit-python-plugin.pod | 16 +++++--------
plugins/python/python.c | 32 +++++++++++++++----------
tests/python-exception.py...
2012 Nov 18
4
panic fts_solr for bad attachment
...ader.java:79)
... 19 more
Caused by: java.io.CharConversionException: Invalid UTF-8 start byte
0xfc (at char #25214836, byte #26687495)
at com.ctc.wstx.io.UTF8Reader.reportInvalidInitial(UTF8Reader.java:303)
at com.ctc.wstx.io.UTF8Reader.read(UTF8Reader.java:189)
at com.ctc.wstx.io.ReaderSource.readInto(ReaderSource.java:87)
at
com.ctc.wstx.io.BranchingReaderSource.readInto(BranchingReaderSource.java:57)
at com.ctc.wstx.sr.StreamScanner.loadMore(StreamScanner.java:988)
... 25 more
doveadm index stops after this error.
How can I make doveadm just to skip the error and to continue indexing?
Th...
2012 Dec 31
5
2.1.12: Panic: file solr-connection.c: line 547 (solr_connection_post_more)
...java:679)
Caused by: java.io.CharConversionException: Invalid UTF-8 start byte 0xf8 (at char #483989, byte #532382)
at com.ctc.wstx.io.UTF8Reader.reportInvalidInitial(UTF8Reader.java:302)
at com.ctc.wstx.io.UTF8Reader.read(UTF8Reader.java:188)
at com.ctc.wstx.io.ReaderSource.readInto(ReaderSource.java:84)
at com.ctc.wstx.io.BranchingReaderSource.readInto(BranchingReaderSource.java:57)
at com.ctc.wstx.sr.StreamScanner.loadMore(StreamScanner.java:992)
at com.ctc.wstx.sr.BasicStreamReader.readTextSecondary(BasicStreamReader.java:4628)
at com.ctc.wst...
2019 Nov 22
3
Re: [PATCH nbdkit v2 10/10] tests: Test the Python plugin thoroughly.
On Fri, Nov 22, 2019 at 9:55 PM Richard W.M. Jones <rjones@redhat.com> wrote:
>
> This tests the Python plugin thoroughly by issuing client commands
> through libnbd and checking we get the expected results.
> ---
> tests/Makefile.am | 13 +--
> tests/test-python-plugin.py | 134 ++++++++++++++++++++++++++++
> tests/test-python.py | 172