Re: setStrategy_options syntax in thrift
Thanks, that worked. On Tue, Dec 20, 2011 at 4:08 PM, Dave Brosius wrote: > > KsDef ksDef = new KsDef(); > Map options = new HashMap(); > options.put("replication_factor", "2"); > ksDef.setStrategy_options(options); > > > > *- Original Message -* > *From:* "A J" > *Sent:* Tue, December 20, 2011 16:03 > *Subject:* Re: setStrategy_options syntax in thrift > > I am new to java. Can you specify the exact syntax for replication_factor=2 ? > > Thanks. > > On Tue, Dec 20, 2011 at 1:50 PM, aaron morton > wrote:> It looks like you tried to pass the string "{replication_factor:2}">> > You need to pas a Map type , where the the key is the option> > and the value is the option value.>> Cheers>> -> Aaron > Morton> Freelance Developer> @aaronmorton> http://www.thelastpickle.com>> On > 20/12/2011, at 12:02 PM, A J wrote:>> What is the syntax of > setStrategy_options in thrift.>> The following fails:>> Util.java:22:> > setStrategy_options(java.util.Map)> in > org.apache.cassandra.thrift.KsDef cannot be applied to> (java.lang.String)> > newKs.setStrategy_options("{replication_factor:2}");>> > >
Re: setStrategy_options syntax in thrift
KsDef ksDef = new KsDef();Map>;String, String;String, String
Re: setStrategy_options syntax in thrift
I am new to java. Can you specify the exact syntax for replication_factor=2 ? Thanks. On Tue, Dec 20, 2011 at 1:50 PM, aaron morton wrote: > It looks like you tried to pass the string "{replication_factor:2}" > > You need to pas a Map type , where the the key is the option > and the value is the option value. > > Cheers > > - > Aaron Morton > Freelance Developer > @aaronmorton > http://www.thelastpickle.com > > On 20/12/2011, at 12:02 PM, A J wrote: > > What is the syntax of setStrategy_options in thrift. > > The following fails: > > Util.java:22: > setStrategy_options(java.util.Map) > in org.apache.cassandra.thrift.KsDef cannot be applied to > (java.lang.String) > newKs.setStrategy_options("{replication_factor:2}"); > >
Re: setStrategy_options syntax in thrift
It looks like you tried to pass the string "{replication_factor:2}" You need to pas a Map type , where the the key is the option and the value is the option value. Cheers - Aaron Morton Freelance Developer @aaronmorton http://www.thelastpickle.com On 20/12/2011, at 12:02 PM, A J wrote: > What is the syntax of setStrategy_options in thrift. > > The following fails: > > Util.java:22: > setStrategy_options(java.util.Map) > in org.apache.cassandra.thrift.KsDef cannot be applied to > (java.lang.String) >newKs.setStrategy_options("{replication_factor:2}");