Querying in RIAK

2014-02-12 Thread Ajit Prasad(RMG00)
Hi,
we came across a question on RIAK's querying ability thru JAVA client.
For example, I have the below JSON record in a RIAK bucket.
I need the individual counts of 'tasks' across different 'statuses'.  Like for 
the below JSON record, it would be...

-  Completed Tasks - 3, InProgress Tasks - 2 and OnHold Tasks -1
What is best way to retrieve this information in Java from RIAK ?

{
  "csOutageID" : "110022",
  "outageType" : "Value Pack",
  "equipmentSerialNumber" : "297912",
  "siteName" : "Zhejiang Fuel Gas Power Gen Ltd.",
  "technicalCode" : "HD Gas",
  "contractNumber" : "CS21753",
  "taskCategory" : [{
"taskCategoryId" : "1",
"taskCategoryName" : "TIL",
"taskList" : [{
"taskTaskID" : "1000",
"taskTitle" : "ML 0434 
HYDRAULIC SYSTEM SETTING OF THE ACCUMULATOR REFILL RATE",
"taskStatus" : "Complete",
}, {
"taskTaskID" : "1001",
"taskTitle" : "MLI 0104 - HOSE, 
CHARGING, ACCUMULATOR",
"taskStatus" : "OnHold",
}]
  }, {
"taskCategoryId" : "2",
"taskCategoryName" : "HOTLIST",
"taskList" : [{
"taskTaskID" : "1002",
"taskTitle" : "TEMPERATURE 
REGULATION VALVES CONTAINING METHYLENE CHLORIDE",
"taskStatus" : "InProgress",
}, {
"taskTaskID" : "1003",
"taskTitle" : "MSDS Methylene 
Chloride to be added in O&M",
"taskStatus" : "Complete",
}]
  }, {
"taskCategoryId" : "2",
"taskCategoryName" : "HOTLIST",
"taskList" : [{
"taskTaskID" : "1004",
"taskTitle" : "MIXING 
RECOMMENDATIONS FOR SERIES CELLS IN LS2100 AND INNOVATION SERIES STATIC 
STARTERS",
"taskStatus" : "InProgress",
}, {
"taskTaskID" : "1005",
"taskTitle" : "BUCKET LOCKWIRE 
REDESIGN AND DOWEL PIN ASSEMBLY AND INSPECTION PROCEDURES",
"taskStatus" : "Complete",
}]
  }]
}

Thanks & regards,
Prem

~~Disclaimer~~~
Information contained and transmitted by this e-mail is confidential and 
proprietary to iGATE and its affiliates and is intended for use only by the 
recipient. If you are not the intended recipient, you are hereby notified that 
any dissemination, distribution, copying or use of this e-mail is strictly 
prohibited and you are requested to delete this e-mail immediately and notify 
the originator or mailad...@igate.com . iGATE does 
not enter into any agreement with any party by e-mail. Any views expressed by 
an individual do not necessarily reflect the view of iGATE. iGATE is not 
responsible for the consequences of any actions taken on the basis of 
information provided, through this email. The contents of an attachment to this 
e-mail may contain software viruses, which could damage your own computer 
system. While iGATE has taken every reasonable precaution to minimise this 
risk, we cannot accept liability for any damage which you sustain as a result 
of software viruses. You should carry out your own virus checks before opening 
an attachment. To know more about iGATE please visit www.igate.com 
.

___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: pagination over 2i indexes in java

2014-02-12 Thread Brian Roach
Joe -

The current Java client codebase it built in layers. The top-level
user API uses an instance of the mid-level RawClient interface which
passes it to the appropriate protocol-specific layer at the bottom.

We are not able to reproduce what you are describing using the 1.4.4
version of the client. Doing a 2i query (with a range or a single
value) and specifying a max number of results returns the results
requested and a continuation.

Here's a gist using the RawClient:

https://gist.github.com/broach/99880915e8c71c53e9bb

If you have a test case that demonstrates the issue you're having and
can post it as a gist in github (or a pastie, etc) we'll be happy to
look at it.

Thanks!
- Roach

On Tue, Feb 11, 2014 at 10:32 PM, joe dude  wrote:
> Yeah, i looked at your code and it looks very similar to what i'm doing. The
> difference is i'm just talking to the client directly:
>
> StreamingOperation result = rawClient.fetchIndex(query);
>
> And rawClient is a "PBClusterClient". Might that have something to do with
> it?
>
>
> On Tuesday, February 11, 2014 5:00 PM, Dave Rusek  wrote:
> Joe,
>
> Sorry, I wanted to get that email out before I stepped out. The specific
> test I added is here:
>
> https://github.com/basho/riak-java-client/blob/1.4.x-develop/src/test/java/com/basho/riak/client/itest/ITestBucket.java#L280
>
> Does this represent your use case? If not, do you happen to have a failing
> test I could take a look at?
>
> Thanks!
>
> --
> Dave Rusek
> Software Engineer
> Basho Technologies
> @davidjrusek
>
> On February 11, 2014 at 5:33:57 PM, Dave Rusek (dru...@basho.com) wrote:
>
> Joe,
>
> I added an integration test to the 1.4.x-develop and the 1.4.4 branch of the
> client and tried them against the latest 1.4 branch of Riak but was not able
> to reproduce your issue.
>
> https://github.com/basho/riak-java-client/tree/1.4.x-develop
>
> --
> Dave Rusek
> Software Engineer
> Basho Technologies
> @davidjrusek
>
> On February 11, 2014 at 5:21:11 PM, Brian Roach (ro...@basho.com) wrote:
>
> -- Forwarded message --
> From: joe dude 
> Date: Tue, Feb 11, 2014 at 2:15 PM
> Subject: Re: pagination over 2i indexes in java
> To: Brian Roach 
> Cc: "riak-users@lists.basho.com" 
>
>
> I'm using 1.4.4, and creating a PBClusterClient.
>
> Thanks.
>
>
> On Tuesday, February 11, 2014 11:03 AM, Brian Roach  wrote:
> Hi Joe -
>
> What version of the Riak Java client are you using, and which protocol
> (PB or HTTP)?
>
> Will take a look at it.
>
> Thanks!
> - Roach
>
> On Tue, Feb 11, 2014 at 11:50 AM, joe dude  wrote:
>> Hi, trying to figure out how to use the java client to do 2i index queries
>> with pagination.
>>
>> I can issue the query with max_results and get back exactly the number
>> that
>> i asked for, but the continuation value in the returned StreamingOperation
>> object is null.
>>
>> In contrast, i get pagination to work just fine using the examples from:
>> http://docs.basho.com/riak/latest/dev/using/2i/
>>
>> I'm using:
>>
>> public StreamingOperation fetchIndex(IndexSpec indexSpec)
>> throws IOException
>>
>>
>> It's as if i'm missing something when building IndexSpec, but not sure
>> what.
>>
>> Thx.
>>
>>
>> ___
>> riak-users mailing list
>> riak-users@lists.basho.com
>> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>>
>
>
> ___
> riak-users mailing list
> riak-users@lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>
>
>
> ___
> riak-users mailing list
> riak-users@lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>

___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


yokozuna Issues

2014-02-12 Thread Bryce
Has anyone else had problems with a fresh install of RHEL6 or fedora 19, 
riak2pre11, and turning search "on"?


The defaults start riak just fine on both distros. But when I change 
search to "on" some of the log files get a fair amount of java related 
errors (both with java installed and not... if that matters).I went 
looking through the riak issues on github, but wasn't able to find 
anything. I assume I'm missing some kind of dependency. I just can't 
seem to find my problem or a fix anywhere.


Thanks in advance,
Bryce

___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: yokozuna Issues

2014-02-12 Thread Tom Santero
Hi Bryce,

If you share the errors you're seeing in the logs it might help us better
identify the issue you're running into.

Cheers,
Tom


On Thu, Feb 13, 2014 at 3:46 AM, Bryce  wrote:

> Has anyone else had problems with a fresh install of RHEL6 or fedora 19,
> riak2pre11, and turning search "on"?
>
> The defaults start riak just fine on both distros. But when I change
> search to "on" some of the log files get a fair amount of java related
> errors (both with java installed and not... if that matters).I went looking
> through the riak issues on github, but wasn't able to find anything. I
> assume I'm missing some kind of dependency. I just can't seem to find my
> problem or a fix anywhere.
>
> Thanks in advance,
> Bryce
>
> ___
> riak-users mailing list
> riak-users@lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com