Best unofficial Apache Server developers community
Username
Forgot password?
Sign in with Twitter account
Sign in with Facebook account
List archives

Updated: (THRIFT-72) C++ structure constructor

Updated: (THRIFT-380) Use setuptools for python build
(8 lines)
Updated: (THRIFT-162) Thrift structures are unhashable, preventing them from being used as set elements
(8 lines)
Aug 12, 2010
Bryan Duxbury (JIRA)
Bryan Duxbury (JIRA)
     [
https://issues.apache.org/jira/browse...nels:all-tabpanel
]

Bryan Duxbury updated THRIFT-72:

Reply
Tags: updatedduxburybryan
Similar Threads
ServiceTracker constructor question
Hi...Trying to extend ServiceTracker rather than use a
ServiceTrackerCustomizer, but when I try new ServiceTracker(context,
filter, null) I get a Cannot Find Symbol for constructor
ServiceTracker(BundleContext, String, <nullable>).

The ServiceTracker javadoc talks about what happens if the customizer
parameter is null, so I assume it can be null?

Don


Reading File in constructor of Mapper
This is a multi-part message in MIME format.
Hello,

I am trying to do the following and hope to get some help on this problem:

I want to run 2 consecutive jobs which both use the same input files, but
the second should use additional data/information generated by the first.
More specifically, I want each Mapper to read a single file (the output of
the first job) and put the key/value pairs of the file into a hashmap,
before it starts mapping, because the hashmap is needed in the map
function.
How can I achieve this? Can I somehow use the constructor to do this?

Thanks,
Ben

CLI failure due to default constructor in Types
Hi Everyone

I am wondering why default visibility constructors were added to each of
the
*Type classes in the db.marshal package? If I'm understanding right, this
breaks the CLI.

Explanation:

This is the original UTF8Type class from 0.6.2, which worked:

import java.io.UnsupportedEncodingException;

public class UTF8Type extends AbstractType
{
    public int compare(byte[] o1, byte[] o2)
    {
        try
        {
            return new String(o1, "UTF-8").compareTo(new String(o2,
"UTF-8"));
        }
        catch (UnsupportedEncodingException e)
        {
            throw new RuntimeException(e);
        }
    }

    public String getString(byte[] bytes)
    {
        try
        {
            return new String(bytes, "UTF-8");
        }
        catch (UnsupportedEncodingException e)
        {
            throw new RuntimeException(e);
        }
    }
}


This is the UTF8Type class from the trunk and at least back to
2010-06-05_12-31-16, which does not work:

import java.io.UnsupportedEncodingException;

public class UTF8Type extends AbstractType
{
    public static final UTF8Type instance = new UTF8Type();

    UTF8Type() {} // singleton

    public int compare(byte[] o1, byte[] o2)
    {
        try
        {
            return new String(o1, "UTF-8").compareTo(new String(o2,
"UTF-8"));
        }
        catch (UnsupportedEncodingException e)
        {
            throw new RuntimeException(e);
        }
    }

    public String getString(byte[] bytes)
    {
        try
        {
            return new String(bytes, "UTF-8");
        }
        catch (UnsupportedEncodingException e)
        {
            throw new RuntimeException(e);
        }
    }
}


The difference is that after 0.6.2, these two lines were added:

    public static final UTF8Type instance = new UTF8Type();

    UTF8Type() {} // singleton

This causes the CLI to fail on gets on both Linux and Windows:

[defa### @Keyspace1] set Standard2['mykey']['mycol']='My value'
Value inserted.
[def### @Keyspace1] get Standard2['mykey']['mycol']
Exception Class org.apache.cassandra.cli.CliClient can not access a member
of class org.apache.cassandra.db.marshal.UTF8
Type with modifiers ""
[defa### @Keyspace1]


As you know, the Exception means that some classloader can't work with the
constructor with default (reduced) visibility.
So some code is definitely relying on the instance field, but it seems
that
some other client code also relies on the (implicit) public constructor?

This is the same for all types that have similar "singleton" code added; I
use UTF8Type as representative example.

So I wonder what the reason was for preventing the implicit public
constructor by reducing visibility this way. Ostensibly, it's to provide a
Singleton,
but because the constructor is not marked private, this is not a true
singleton anyway, and because there are no instance fields in any of these
classes, everything's method local, there's nothing to be a Singleton
about.
So what's the presumed Singleton part, even if it didn't break stuff?

I'm not sure what the benefit is, and this appears to be a bug. Perhaps I
misunderstand.

The following illustrates that removing this constructor, whose value is
not
immediately clear to begin with, fixes the problem:

Type 'help' or '?' for help. Type 'quit' or 'exit' to quit.
[def### @unknown] use Keyspace1
Authenticated to keyspace: Keyspace1
[def### @Keyspace1] set Standard2['k']['c']='v'
Value inserted.
[def### @Keyspace1] get Standard2['k']['c']
******************* ---->>> GETTING STRING WITH MODIFIED CODE.
=> (column=c, value=v, timestamp=1276287830318000)
[defa### @Keyspace1]


But that may not be desired, and perhaps the real solution is to update
something in the CLI code that's using reflection.

Should I file a bug and, unless I don't understand the benefit of this,
supply the (very modest) fix for each of the types? Or is this known and
understood, simply broken for now, and going somewhere good? If so, where?

Thanks for such a great project and community.
Eben




Created: (AVRO-596) NettyServer under-initialized in constructor.
NettyServer under-initialized in constructor.

list of structure..
Hello everybody!

We have puppet infrastructure integrated with ldap. I can pass
different variables via puppetVars attribute in ldap.
Currently, I need to write puppet class to configure mod_proxy server.
mod_proxy servers has 5-10 configured sites. Every site configuration
has some variables: site name, listen port, destination site name,
destination port, protocol..
Does anybody has an idea, how can I place all this variables out of
puppet classes? In ldap? Or maybe puppet have some internal database,
like chef?





Erlang Doc structure
I've been playing with Erlang views on and off in CouchDB, and find the
information on the internal Erlang structure of Docs lacking. Is there
somewhere I can read up on this? I had initially assumed that a Doc was a
list of tuples, but I am starting to suspect that I am wrong.

Mike

JMS-MAP-JSON Improper Data structure
I am getting an odd error in my data from my broker. Using perl I am
changing
a map message to json using jms-map-json. This returns an improperly
structured version of my data.



'map' => [
                     {
                       'entry' => [
                                    {
                                      'string' => [

As you can see it is creating an array where the hash should be.

I now have to access data like @{@{$json->{map}}[0]->{entry}}; Which
is very
unpleasant. We did not have this issue prior. I used to be able to simply
do

@{$json->{map}{entry}} to access my data


This is with amq 5.3.2




Need advice about docs structure design.
Hy guy's.

My model:
Users has
  Bookmarks and Posts

have idea keep Bookmarks and Posts in separate DB (for speed views).
But in view i want fetch Bookmarks and Posts with user name,

In what way i can do this?
keep copy of users in each DB?

or may be keep users in separate DB, fetch bookmarks or posts and then
fetch users and then merge?

Yes i know i can copy user name to doc, but have a trouble when user
name is changed (it's force me use stale=ok in request view
+background process to track changes and run rebuild index).

I think it's will be cool crazy stuff if i can update docs(cached
fields - not have effect to index) and say Couch you don't need
rebuild index relax ;).

Any advice?


Delete document Tree Structure

Hi,

       I design document in couchdb to have relation something like

              directory
                    |
                    A---------D
                    |
                    B---------C
                                 |
                                 |
                                 E ------F

         if i would like to http (DELETE B) will delete all down documents
what is the possible solution to use.

                1.    can i create view and find relation and delete all
of them ?
                2.    get  relation by higher programming api (C#,PHP) and
then delete each one?
                3.    Do you have any solution to suggest on this.....?


Thanks,
A. 


 		 	   		  

arbitrary structure for joins redux
Hi,
I recently discovered the new feature added in couchdb 0.11 which lets to
link related documents in the emit function by passing the _id value of a
given doc like it's explained in
http://blog.couch.io/post/446015664/w...11-part-two-views
I find this feature quite useful, but I would like to know if its planned
to
let use an arbitrary structure as the value for the emit function which
could contain several _id's references like emit(key, {title:"lorem
ipsum",
foo:{_id : "foo"}, bar : {_id : "bar"}})
so there could be linked more than one document with a single emit call. a
possible solution could probably be to call the emit function several
times
but then include_docs parameter could not be used when a reduce function
is
defined.

Thanks in advance

Regards




RE: Delete document Tree Structure

   hi ,

         I am very new to couchdb,  in my design , i just keep parent id
of each documents.
such as if i would like to delete B, i know that to delete C(have B id)
and then I have find and
to delete E(have c id).... etc.

        my question is ....

        1. is this possible ????

        2. how do i pass the document id (such as B) to view that i would
like to search and delete document under its? 

        3. dose couchdb support delete document in view or i have to query
all of them than use http api to delete ?

         

thanks for every ideas 

A.







-------- Original Message --------

  
    
      Subject: 
      Re: Delete document Tree Structure
    
    
      Date: 
      Thu, 27 May 2010 06:43:58 +0200
    
    
      From: 
      J Chris Anderson <jch### @gmail.com>
    
    
      Reply-To: 
      use### @couchdb.apache.org <us### @couchdb.apache.org>
    
    
      To: 
      use### @couchdb.apache.org <us### @couchdb.apache.org>
    
  





On May 26, 2010, at 8:48 PM, Aun... ??????? wrote:

 
 
 Hi,
 
       I design document in couchdb to have relation something like
 
              directory
                    |
                    A---------D
                    |
                    B---------C
                                 |
                                 |
                                 E ------F
 
         if i would like to http (DELETE B) will delete all down
documents what is the possible solution to use.
 
                1.    can i create view and find relation and delete
all of them ?
                2.    get  relation by higher programming api (C#,PHP)
and then delete each one?
                3.    Do you have any solution to suggest on
this.....?
 

It is common to store the full path to each item, on the item, so you'd
have

B > C > E > F stored on F

then you can view easily across the tree.

however, reparenting a node, (say, moving B to become a child of D)
require asynchronous processing or a bulk docs request and is not
transactional.

Chris


 
 Thanks,
 A.