[protobuf] Re: Issue 256 in protobuf: Error Converting Message to array of Bytes (When negative Enum) - Java

2011-02-18 Thread protobuf


Comment #5 on issue 256 by gus...@veide.se: Error Converting Message to  
array of Bytes (When negative Enum) - Java

http://code.google.com/p/protobuf/issues/detail?id=256

What a coincidence. I ran into this error today when upgrading from  
protobuf 2.0.3 to 2.4.0a and a patch just came out :) Lucky me...


Will there be a patch release with this fix or should I patch it manually?

--
You received this message because you are subscribed to the Google Groups Protocol 
Buffers group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Re: Issue 210 in protobuf: Java code should detect incompatible runtime library version

2011-02-18 Thread protobuf


Comment #16 on issue 210 by gus...@veide.se: Java code should detect  
incompatible runtime library version

http://code.google.com/p/protobuf/issues/detail?id=210

I like the proposal that the version number is detected in runtime. I would  
also propose to add the version number to each generated source file. Both  
runtime files and files generated by protoc.


--
You received this message because you are subscribed to the Google Groups Protocol 
Buffers group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Re: Issue 210 in protobuf: Java code should detect incompatible runtime library version

2011-02-18 Thread protobuf


Comment #17 on issue 210 by gus...@veide.se: Java code should detect  
incompatible runtime library version

http://code.google.com/p/protobuf/issues/detail?id=210

I like the proposal that the version number is detected at runtime. I also  
propose that   version number is added to each generated source file.


--
You received this message because you are subscribed to the Google Groups Protocol 
Buffers group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Re: Issue 247 in protobuf: Ability to redirect file output to stdout

2011-02-18 Thread protobuf


Comment #9 on issue 247 by compuwarescc: Ability to redirect file output to  
stdout

http://code.google.com/p/protobuf/issues/detail?id=247

I've been thinking a lot of the use of run-time usage of .proto files in  
java (I use this technique) and I've gone through two uses now - both  
involve invoking protoc from java and then using the output.  The first was  
to perform actual code generation, compile, and load.  The second (and  
better i think) was to use the FileDescriptorSet output and load that into  
FileDescriptor(s).


The primary limitation of both approaches was the need to
1) invoke protoc through the shell (not very platform independent)
2) manipulate files when everything could/should be done in memory

The more I think on it, the more I think taking the this is an advanced  
use of protobuf approach and saying the most flexible solution to users  
that want to do this kind of work is to provide a java version of the  
current C library used to translate between .proto files  
and FileDescriptorProto protobufs.


This is the one big piece missing from the run-time java capability,  
everything but going .proto = FileDescriptorProto is in there already.


I'm interested in what Kenton or other active developers of the library  
think about this - how difficult would it be to port the C code to java?   
how much of a maintenance problem would this make?  I would be willing to  
assist with this effort if it is thought a useful contribution to the java  
library.  If it is believed this is a worthwhile pursuit, I believe that  
would supersede the need for console output from protoc.


--
You received this message because you are subscribed to the Google Groups Protocol 
Buffers group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Re: Issue 257 in protobuf: Java Protocol buffer payload more than that of regular payload when using repeated tag

2011-02-18 Thread protobuf


Comment #3 on issue 257 by jayaraga...@gmail.com: Java Protocol buffer  
payload more than that of regular payload when using repeated tag

http://code.google.com/p/protobuf/issues/detail?id=257

I have a .proto file which has 53 tags reflecting db columns. Most of them  
are strings with the exception of 4 ints and 1 float. Let us call it a  
Trade message. The 'TradeList' message has repeated tag for Trade. From the  
db results, I created a serialized object to check serialized payload and  
also create proto message. That is how I compared


--
You received this message because you are subscribed to the Google Groups Protocol 
Buffers group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] compound message allows colon

2011-02-18 Thread naderp
Hi,

Given the following .proto definition:

message person {
   required string name = 1;
   required int32 id = 2;
}

I noticed the following message syntax is valid:

person: {
   name: fred
   id: 3
}

i.e., the generated parser will quite happily accept a colon after the
compound message name (person: in this case).

Is this a bug or a feature?

Cheers

-- 
You received this message because you are subscribed to the Google Groups 
Protocol Buffers group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Re: Issue 257 in protobuf: Java Protocol buffer payload more than that of regular payload when using repeated tag

2011-02-18 Thread protobuf

Updates:
Status: WorkingAsIntended

Comment #4 on issue 257 by jas...@google.com: Java Protocol buffer payload  
more than that of regular payload when using repeated tag

http://code.google.com/p/protobuf/issues/detail?id=257

I tried an example around AddressBook, creating 100 person entries:

for (int i = 0; i  100; ++i) {
  Person.Builder personBuilder = Person.newBuilder()
  .setName(Person  + i)
  .setId(i)
  .setEmail(person + i + @gmail.com);
  builder.addPerson(personBuilder.build());
}
}

I converted this to an equivalent class (keeping the unused phone entries):
  static class PhoneNumber implements java.io.Serializable {
public String number;
public int type;
  }

  static class PersonJava implements java.io.Serializable {
public String name;
public int id;
public String email;
public ListPhoneNumber phoneNumbers;
  }

Serializing the equivalent ListPersonJava was larger:

Proto serialized size: 3480
Java serialized size: 4550

I'm not sure if there's something special about your protocol definition  
that allows Java serialization to be smaller. However, most of the  
independent investigations I've seen show that protobuf encoding is  
smaller. Either way, we can't change the wire format, so I'm closing this  
bug. Feel free to start a thread on the googlegroup if there's anything  
you'd like to discuss.


--
You received this message because you are subscribed to the Google Groups Protocol 
Buffers group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Re: Issue 257 in protobuf: Java Protocol buffer payload more than that of regular payload when using repeated tag

2011-02-18 Thread protobuf


Comment #5 on issue 257 by jayaraga...@gmail.com: Java Protocol buffer  
payload more than that of regular payload when using repeated tag

http://code.google.com/p/protobuf/issues/detail?id=257

For the most part, I agree with you. Today I tried a proto message for  
another db
report that had 7 fields. I tested upto 35000 records. Proto payload is  
1/3rd the size of java ser payload. Somewhere in the forums, I read that  
above 18 fields in a message, it gets messy. Could you repeat your tests  
with like 50 fields when you get a chance?


--
You received this message because you are subscribed to the Google Groups Protocol 
Buffers group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Re: Issue 256 in protobuf: Error Converting Message to array of Bytes (When negative Enum) - Java

2011-02-18 Thread protobuf

Updates:
Cc: liuj...@google.com

Comment #6 on issue 256 by jas...@google.com: Error Converting Message to  
array of Bytes (When negative Enum) - Java

http://code.google.com/p/protobuf/issues/detail?id=256

+liujisi, who's been doing the releases. I don't have the bandwidth (or  
know how!) to do a point release - Jisi, think it's worth doing one for  
this issue?


You'll probably want to patch in manually: even if we do go through a  
release it will take some time to get out.


OP: I thought this issue sounded familiar, and did a little more digging.  
It turns out that a similar issue was reported in Issue 200 and fixed in  
r354, which was included in 2.4.0. That fix changed the way negative enums  
are written but not the way their size is computed - the inconsistency  
causes the exception, and is indeed new to 2.4.0. Sorry to have doubted  
you :-)




--
You received this message because you are subscribed to the Google Groups Protocol 
Buffers group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Re: Issue 257 in protobuf: Java Protocol buffer payload more than that of regular payload when using repeated tag

2011-02-18 Thread protobuf


Comment #6 on issue 257 by jas...@google.com: Java Protocol buffer payload  
more than that of regular payload when using repeated tag

http://code.google.com/p/protobuf/issues/detail?id=257

Sorry, I'm going to have to ask you to provide the program if you want to  
look into these larger messages. There are likely going to be some  
applications where the protobuf encoding is larger than other encoding  
formats, but we don't have the resources to construct such examples. There  
may be something about your data that makes the protobuf encoding less  
efficient; if you can provide some examples perhaps we can offer some  
solutions.


I'm not sure of the thread that you mentioned, but due to the varint  
encoding tag numbers above 15 require an extra byte. Perhaps that's what  
you had read? If you have a large number of string fields, I would think  
this byte is pretty negligible relative to the actual payload.


--
You received this message because you are subscribed to the Google Groups Protocol 
Buffers group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Issue 259 in protobuf: extract_includes.bat doesn't copy plugin.h to include dir.

2011-02-18 Thread protobuf

Status: New
Owner: 
Labels: Type-Defect Priority-Medium

New issue 259 by jacobgla...@yahoo.com: extract_includes.bat doesn't copy  
plugin.h to include dir.

http://code.google.com/p/protobuf/issues/detail?id=259

What steps will reproduce the problem?
1.build on windows using vs2008.
2.run extract_includes.bat

What is the expected output? What do you see instead?

plugin.h should reside with the rest of the headers.


K:\Jake\Projects\pbuffs\protobuf-read-only\vsprojectsc:\Program  
Files\Subversion\bin\svn.exe diff extract_i

ncludes.bat
Index: extract_includes.bat
===
--- extract_includes.bat(revision 381)
+++ extract_includes.bat(working copy)
@@ -40,3 +40,4 @@
 copy ..\src\google\protobuf\compiler\cpp\cpp_generator.h  
include\google\protobuf\compiler\cpp\cpp_generator.h


 copy ..\src\google\protobuf\compiler\java\java_generator.h  
include\google\protobuf\compiler\java\java_generat

or.h
 copy ..\src\google\protobuf\compiler\python\python_generator.h  
include\google\protobuf\compiler\python\python

_generator.h
+copy ..\src\google\protobuf\compiler\plugin.h  
include\google\protobuf\compiler\plugin.h



--
You received this message because you are subscribed to the Google Groups Protocol 
Buffers group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Re: Issue 259 in protobuf: extract_includes.bat doesn't copy plugin.h to include dir.

2011-02-18 Thread protobuf

Updates:
Status: Accepted
Owner: liuj...@google.com

Comment #1 on issue 259 by liuj...@google.com: extract_includes.bat doesn't  
copy plugin.h to include dir.

http://code.google.com/p/protobuf/issues/detail?id=259

(No comment was entered for this change.)

--
You received this message because you are subscribed to the Google Groups Protocol 
Buffers group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Re: Issue 256 in protobuf: Error Converting Message to array of Bytes (When negative Enum) - Java

2011-02-18 Thread protobuf


Comment #7 on issue 256 by liuj...@google.com: Error Converting Message to  
array of Bytes (When negative Enum) - Java

http://code.google.com/p/protobuf/issues/detail?id=256

Yes, but we will probably wait for a couple of days in case we discover  
other bugs shortly.


--
You received this message because you are subscribed to the Google Groups Protocol 
Buffers group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.