Re: [protobuf] Re: Strings and Arenas

2018-06-07 Thread 'Feng Xiao' via Protocol Buffers
On Thu, Jun 7, 2018 at 8:01 AM aram  wrote:

> I am working on the same problem in my project (arena-allocated strings),
> and came across this topic. It is 2.5 years old now, so I wonder if
> arena-allocated strings or StringPiece class is going to be included in
> official protobuf releases any time soon?
>
Unfortunately this has happened yet. The main issue is how to adopt abseil
in protobuf library to be able to use the new string_view type and Cord. We
haven't figured that out yet. You can follow-up on
https://github.com/google/protobuf/issues/1896 and we will post updates
there.


> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to protobuf+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Error in UDF using google protobuf

2018-06-07 Thread Arghya Basu
I am getting the following error when executing UDF function. Please help 
to resolve the issue.


ts=2018-06-07T19:37:37.864Z lvl=info msg="UDF log" service=udf 
text="2018-06-07 19:37:37,864 INFO:root: Starting Agent"
ts=2018-06-07T19:37:37.864Z lvl=info msg="UDF log" service=udf 
text="Traceback (most recent call last):"
ts=2018-06-07T19:37:37.864Z lvl=info msg="UDF log" service=udf text="  File 
\"/home/ubuntu/kapacitor/udf/agent/py/kapacitor/udf/agent.py\", line 104, 
in _read_loop"
ts=2018-06-07T19:37:37.864Z lvl=info msg="UDF log" service=udf text="
response = self.handler.info()"
ts=2018-06-07T19:37:37.864Z lvl=info msg="UDF log" service=udf text="  File 
\"/home/ubuntu/kapacitor/udf/agent/examples/outliers/outliers.py\", line 
77, in info"
ts=2018-06-07T19:37:37.865Z lvl=info msg="UDF log" service=udf text="
response.info.options['field'].valueTypes.append(udf_pb2.STRING)"
ts=2018-06-07T19:37:37.865Z lvl=info msg="UDF log" service=udf text="  File 
\"/usr/lib/python2.7/dist-packages/google/protobuf/internal/containers.py\", 
line 64, in __getitem__"
ts=2018-06-07T19:37:37.865Z lvl=info msg="UDF log" service=udf text="
return self._values[key]"
ts=2018-06-07T19:37:37.865Z lvl=info msg="UDF log" service=udf 
text="TypeError: list indices must be integers, not str"
ts=2018-06-07T19:37:37.865Z lvl=info msg="UDF log" service=udf 
text="2018-06-07 19:37:37,865 ERROR:root: error processing request of type 
info: list indices must be integers, not str"
ts=2018-06-07T19:37:37.865Z lvl=error msg="received error message" 
service=udf err="error processing request of type info: list indices must 
be integers, not str"
ts=2018-06-07T19:37:37.865Z lvl=info msg="UDF log" service=udf 
text="2018-06-07 19:37:37,865 INFO:root: Agent finished"

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Where is Protocol Buffers wire level specification?

2018-06-07 Thread Markus Schaber
Hi, Jon,

Am Donnerstag, 7. Juni 2018 15:05:17 UTC+2 schrieb Jon Skeet:
>
> On Thursday, 7 June 2018 10:59:34 UTC+1, Markus Schaber wrote:
>>
>> This text is missing some interesting aspects, e. G. what happens when 
>> the field number needs more than 5 bits (I cannot imagine it's limited to 
>> 31 fields per message).
>>
>
> No, that's already described:
>
> > Each key in the streamed message is a varint with the value 
> (field_number << 3) | wire_type – in other words, the last three bits of 
> the number store the wire type.
>
> And slightly earlier there's a description of how varints are serialized. 
> So if you have a field number of (say) 1000 and a wire format of 1, that 
> tag would be serialized as the varint encoding of the number 8001, which is 
> (1000 << 3) | 1.
>

Yes, you're right - I was somehow reading this as a byte, not a varint... 
:-(

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Re: Strings and Arenas

2018-06-07 Thread aram
I am working on the same problem in my project (arena-allocated strings), 
and came across this topic. It is 2.5 years old now, so I wonder if 
arena-allocated strings or StringPiece class is going to be included in 
official protobuf releases any time soon?

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Where is Protocol Buffers wire level specification?

2018-06-07 Thread Jon Skeet
On Thursday, 7 June 2018 10:59:34 UTC+1, Markus Schaber wrote:
>
> This text is missing some interesting aspects, e. G. what happens when the 
> field number needs more than 5 bits (I cannot imagine it's limited to 31 
> fields per message).
>

No, that's already described:

> Each key in the streamed message is a varint with the value (field_number 
<< 3) | wire_type – in other words, the last three bits of the number store 
the wire type.

And slightly earlier there's a description of how varints are serialized. 
So if you have a field number of (say) 1000 and a wire format of 1, that 
tag would be serialized as the varint encoding of the number 8001, which is 
(1000 << 3) | 1.

Jon

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Where is Protocol Buffers wire level specification?

2018-06-07 Thread Markus Schaber
Hi,

I'm also on the search for a "full" spec.

Am Dienstag, 9. Januar 2018 18:24:19 UTC+1 schrieb Josh Humphries:
>
> This describes the basic encoding of protobuf messages into bytes:
> https://developers.google.com/protocol-buffers/docs/encoding
>

This text is missing some interesting aspects, e. G. what happens when the 
field number needs more than 5 bits (I cannot imagine it's limited to 31 
fields per message).

So reverse engineering existing codec sources is the only way to get a spec 
for the binary encoding? (e. g. for developing our own language backend or 
an independent lightweight parser)

Thanks,
Markus

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.