You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@predictionio.apache.org by Rasna Tomar <ra...@getamplify.com> on 2017/11/03 06:20:47 UTC

Pio eventserver returning incorrect result

Hi

I have a use case where in I need to update entityId for enitityType =
 user.
I am updating it with Apache phoenix.

Update is successfully happening in both Phoenix and hbase.

But when I check on eventserver I am getting incorrect result .

*          Input - *

   - Suppose, Old entityId = 59af638e4d0dff65996eafa7
      - New enitytId = 59af638e4d0dff65996eafa8


        I have checked following scenarios using eventserver -

   1. Curl request with parameters (entityId, entityType) on  old entityId
   returns "Message not found" - which is obvious because this Id is updated
   2. Curl request with parameters (entityId, entityType) on  new entityId
   also returns "Message not found" - which is not expected
   3. Curl request with parameters (entityId only) on new entityId returns
   proper result
   4. When I again update Id back to old id , eventserver returns proper
   result


Also I am getting this exception for newId -
{

   - message: "org.apache.predictionio.data.storage.hbase.HBEventsUtil$RowKeyException:
   Incorrect byte array size. Bytes: -65,-51,-28,105,42,13,90,-24,
   21,111,82,-66,-118,-32,101,127,0,0,1,93,17,-60,-77,-112,-
   109,-97,-7,-101,21,89,-95."

}

What is the issue with eventserver?


Thanks

Re: Pio eventserver returning incorrect result

Posted by Donald Szeto <do...@apache.org>.
Hi Rasna,

Sorry for the late reply. The event server models log data as a series of
immutable events and thus do not support updates (except deletes) of entity
IDs. The event server itself does not maintain any cache between its REST
API to the backend storage (HBase, etc). It is simply an adapter between
the REST API and the chosen storage.

In particular, the row key implementation for HBase is at
https://github.com/apache/incubator-predictionio/blob/develop/storage/hbase/src/main/scala/org/apache/predictionio/data/storage/hbase/HBEventsUtil.scala#L146.
When you update the entry manually in Phoenix, it might not generate the
row key that is expected by the PIO HBase adapter.

Without knowing your specific use case, updates to events would usually be
done by:
- creating new events with "$set" and specify only updated properties, and
allow the PIO Event API to perform the aggregation for you to obtain the
latest state during training time;
- get the event in your code, delete it from event server, modify your
event in your code, and re-create it at event server.

Regards,
Donald

On Mon, Nov 6, 2017 at 5:18 AM, Rasna Tomar <ra...@getamplify.com> wrote:

> Does event server maintains any chache?
> Updated data is properly reflected in hbase but not in eventserver. Why?
>
> On Mon, Nov 6, 2017 at 12:08 PM, Rasna Tomar <ra...@getamplify.com> wrote:
>
>> Any solution for this problem?
>>
>> On Fri, Nov 3, 2017 at 11:50 AM, Rasna Tomar <ra...@getamplify.com>
>> wrote:
>>
>>> Hi
>>>
>>> I have a use case where in I need to update entityId for enitityType =
>>>  user.
>>> I am updating it with Apache phoenix.
>>>
>>> Update is successfully happening in both Phoenix and hbase.
>>>
>>> But when I check on eventserver I am getting incorrect result .
>>>
>>> *          Input - *
>>>
>>>    - Suppose, Old entityId = 59af638e4d0dff65996eafa7
>>>       - New enitytId = 59af638e4d0dff65996eafa8
>>>
>>>
>>>         I have checked following scenarios using eventserver -
>>>
>>>    1. Curl request with parameters (entityId, entityType) on  old
>>>    entityId returns "Message not found" - which is obvious because this Id is
>>>    updated
>>>    2. Curl request with parameters (entityId, entityType) on  new
>>>    entityId also returns "Message not found" - which is not expected
>>>    3. Curl request with parameters (entityId only) on new entityId
>>>    returns proper result
>>>    4. When I again update Id back to old id , eventserver returns
>>>    proper result
>>>
>>>
>>> Also I am getting this exception for newId -
>>> {
>>>
>>>    - message: "org.apache.predictionio.data.storage.hbase.HBEventsUtil$RowKeyException:
>>>    Incorrect byte array size. Bytes: -65,-51,-28,105,42,13,90,-24,2
>>>    1,111,82,-66,-118,-32,101,127,0,0,1,93,17,-60,-77,-112,-109,
>>>    -97,-7,-101,21,89,-95."
>>>
>>> }
>>>
>>> What is the issue with eventserver?
>>>
>>>
>>> Thanks
>>>
>>
>>
>

Re: Pio eventserver returning incorrect result

Posted by Rasna Tomar <ra...@getamplify.com>.
Does event server maintains any chache?
Updated data is properly reflected in hbase but not in eventserver. Why?

On Mon, Nov 6, 2017 at 12:08 PM, Rasna Tomar <ra...@getamplify.com> wrote:

> Any solution for this problem?
>
> On Fri, Nov 3, 2017 at 11:50 AM, Rasna Tomar <ra...@getamplify.com> wrote:
>
>> Hi
>>
>> I have a use case where in I need to update entityId for enitityType =
>>  user.
>> I am updating it with Apache phoenix.
>>
>> Update is successfully happening in both Phoenix and hbase.
>>
>> But when I check on eventserver I am getting incorrect result .
>>
>> *          Input - *
>>
>>    - Suppose, Old entityId = 59af638e4d0dff65996eafa7
>>       - New enitytId = 59af638e4d0dff65996eafa8
>>
>>
>>         I have checked following scenarios using eventserver -
>>
>>    1. Curl request with parameters (entityId, entityType) on  old
>>    entityId returns "Message not found" - which is obvious because this Id is
>>    updated
>>    2. Curl request with parameters (entityId, entityType) on  new
>>    entityId also returns "Message not found" - which is not expected
>>    3. Curl request with parameters (entityId only) on new entityId
>>    returns proper result
>>    4. When I again update Id back to old id , eventserver returns proper
>>    result
>>
>>
>> Also I am getting this exception for newId -
>> {
>>
>>    - message: "org.apache.predictionio.data.storage.hbase.HBEventsUtil$RowKeyException:
>>    Incorrect byte array size. Bytes: -65,-51,-28,105,42,13,90,-24,2
>>    1,111,82,-66,-118,-32,101,127,0,0,1,93,17,-60,-77,-112,-109,
>>    -97,-7,-101,21,89,-95."
>>
>> }
>>
>> What is the issue with eventserver?
>>
>>
>> Thanks
>>
>
>

Re: Pio eventserver returning incorrect result

Posted by Rasna Tomar <ra...@getamplify.com>.
Any solution for this problem?

On Fri, Nov 3, 2017 at 11:50 AM, Rasna Tomar <ra...@getamplify.com> wrote:

> Hi
>
> I have a use case where in I need to update entityId for enitityType =
>  user.
> I am updating it with Apache phoenix.
>
> Update is successfully happening in both Phoenix and hbase.
>
> But when I check on eventserver I am getting incorrect result .
>
> *          Input - *
>
>    - Suppose, Old entityId = 59af638e4d0dff65996eafa7
>       - New enitytId = 59af638e4d0dff65996eafa8
>
>
>         I have checked following scenarios using eventserver -
>
>    1. Curl request with parameters (entityId, entityType) on  old
>    entityId returns "Message not found" - which is obvious because this Id is
>    updated
>    2. Curl request with parameters (entityId, entityType) on  new
>    entityId also returns "Message not found" - which is not expected
>    3. Curl request with parameters (entityId only) on new entityId
>    returns proper result
>    4. When I again update Id back to old id , eventserver returns proper
>    result
>
>
> Also I am getting this exception for newId -
> {
>
>    - message: "org.apache.predictionio.data.storage.hbase.HBEventsUtil$RowKeyException:
>    Incorrect byte array size. Bytes: -65,-51,-28,105,42,13,90,-24,2
>    1,111,82,-66,-118,-32,101,127,0,0,1,93,17,-60,-77,-112,-109,
>    -97,-7,-101,21,89,-95."
>
> }
>
> What is the issue with eventserver?
>
>
> Thanks
>