Re: region name is incorrect while trying to get using region.get

2019-12-03 Thread Gang Yan
1. as you mentioned,  you create region on client.
"we use client region factory to create a region instance

"authIdCacheRegionInstance = GeodeCache.getCacheInstance(
).createClientRegionFactory(ClientRegionShortcut.PROXY).create("AuthIdRegion");"
"

how about the server side?
 how did you create region on server side?  by xml, gfsh or java?

2. "sometimes randomly while trying to get details from a region",  it is a
little weird ,  IMO,  if just create region on client,  every time when you
try to query an OQL, will see same error.


On Tue, Dec 3, 2019 at 10:16 AM Dan Smith  wrote:

> Perhaps the AuthIdRegion is not present on the server, and that's why you
> are getting error message (with the incorrectly formatted region name, as
> John said)?
>
> -Dan
>
> On Tue, Dec 3, 2019 at 10:10 AM John Blum  wrote:
>
>> This is an old bug (which was most certainly present in Apache Geode 1.1
>> since I think I remember seeing this bug all the way up through 1.3).
>> Technically, IIRC, there is no Region on the server by the name indicated
>> in the misleading error message, /AuthIdRegion/AuthIdRegion, it was
>> simply a problem with the error message.  Off the top of my head, I cannot
>> remember what ultimately caused the RegionDestroyedException in this
>> case, though.
>>
>> Rajesh - is it possible for you to upgrade to Apache Geode 1.10, which is
>> now the latest version?  You might still have an error/configuration
>> problem, but at least the error message should be more insightful.  Please
>> include the full stack trace and error message along with how you
>> configured the Region on the server.
>>
>> -j
>>
>>
>>
>> On Tue, Dec 3, 2019 at 9:53 AM Dan Smith  wrote:
>>
>>> Huh, that's weird. Is it possible that somewhere in your code you are
>>> calling createSubregion on the returned authIdCacheRegionInstance? The
>>> syntax /AuthIdRegion/AuthIdRegion indicates a region named AuthIdRegion
>>> with a subregion also named AuthIdRegion.
>>>
>>> -Dan
>>>
>>> On Mon, Dec 2, 2019 at 8:04 PM Rajesh Kumar 
>>> wrote:
>>>
 we are using apache geode 1.1.0 version. sometimes randomly while
 trying to get details from a region we are getting exceptions. On looking
 at the logs it seems the region is appended to itself and a region not
 found exception is thrown.



 Caused by: org.apache.geode.cache.RegionDestroyedException: Server
 connection from
 [identity(10.43.164.241(10772:loner):62563:aebd35c5,connection=1;
 port=62563]: Region named /AuthIdRegion/AuthIdRegion was not found during
 get request

 at
 org.apache.geode.internal.cache.tier.sockets.BaseCommand.writeRegionDestroyedEx(BaseCommand.java:633)

 at
 org.apache.geode.internal.cache.tier.sockets.command.Get70.cmdExecute(Get70.java:126)

 at
 org.apache.geode.internal.cache.tier.sockets.BaseCommand.execute(BaseCommand.java:141)

 at
 org.apache.geode.internal.cache.tier.sockets.ServerConnection.doNormalMsg(ServerConnection.java:783)

 at
 org.apache.geode.internal.cache.tier.sockets.ServerConnection.doOneMessage(ServerConnection.java:914)

 at
 org.apache.geode.internal.cache.tier.sockets.ServerConnection.run(ServerConnection.java:1171)

 at
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

 at
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

 at
 org.apache.geode.internal.cache.tier.sockets.AcceptorImpl$1$1.run(AcceptorImpl.java:519)

 ... 1 more





 The name of my region is /AuthIdRegion but it tries to query using
 "/AuthIdRegion/AuthIdRegion"



 we use client region factory to create a region instance

 "authIdCacheRegionInstance = GeodeCache.getCacheInstance(
 ).createClientRegionFactory(ClientRegionShortcut.PROXY).create("AuthIdRegion");"



 It will be really helpful if someone can point what exactly is the
 issue.



 Thanks,

 Rajesh

>>>
>>
>> --
>> -John
>> john.blum10101 (skype)
>>
>


[Docs Translation]Geode Documentation

2018-02-05 Thread Gang Yan
Hi  All

In recent years, many Chinese fans who have heard many Geode mentioned that
while Geode is a good product, there are few related Chinese introductions,
and the content found through Google and Baidu is often confused or
outdated. And also they want to know about Apache Geode's principles and
configuration options for various features.

The following link:
https://gyan-pivotal.gitbooks.io/apache-geode-chinese/content/

it is merged from some parts which had bean translated into Chinese and
original English chapters([Apache Geode 1.2 Documentation](
http://geode.apache.org/docs/guide/12/about_geode.html)).The current
processing of translation is as follows

Chapterstranslatorstatus
Summary
Gang Yan
translation completed
Getting Started with Apache Geode
Gang Yan
translation completed
Configuring and Running a Cluster
Gang Yan
translation completed
Basic Configuration and Programming
Gang Yan
translation draft 25%
The future of the Chinese translation will use it as a base, and
distributed as gitbook.

Welcome everyone to join and to distribute it.

在最近几年中, 经常听到很多 Geode 的中国粉丝们提到 Geode 虽然是很好的产品, 但是相关的中午介绍很少, 通过 Google 和
Baidu 找到的内容经常是互相矛盾或者是过时的. 他们也想要了解 Apache Geode 的原理和各种功能的配置选项说明.

下面这个链接:
https://gyan-pivotal.gitbooks.io/apache-geode-chinese/content/

是目前我已经翻译成中文的部分和其他尚未翻译的部分合成.以 Apache Geode1.2 文档为基础.目前的翻译完成情况如下:
章节负责人状态
整体章节目录 闫钢 完成
Apache Geode入门 闫钢 完成
配置和运行集群 闫钢 完成
基本配置和开发 闫钢 初稿25%

以后的中文文档翻译会以这个为提交基础,以gitbook的形式分发,欢迎大家加入.

Thanks and regards

Gang Yan(闫钢)
Sr. Solution Architect
Customer Success, Pivotal Great China
Mobile:+86 13636347460
g...@pivotal.io


Re: pdx serializer, need help

2017-09-07 Thread Gang Yan
Oql query log may be found in locator log file.

Please check your domain jar file in the classpath of cache server,  and
the version of domain class on the server is as same as on client.

Xiawei Zhang 于2017年9月7日 周四下午11:39写道:

> How do you wire PdxSerializer on the server side?
>
> you might want to check
>
>
> https://gemfire.docs.pivotal.io/geode/developing/data_serialization/use_pdx_serializer.html
> and
>
>
> https://gemfire.docs.pivotal.io/geode/tools_modules/gfsh/command-pages/configure.html#topic_jdkdiqbgphqh
>  for pdx configuration either through code or pure gfsh.
>
> -Xiawei
>
> On Thu, 7 Sep 2017 at 11:32 PM, Xu, Nan  wrote:
>
>> Btw, I don’t see anything at server log, where should I check this
>> problem?
>>
>>
>>
>> *From:* Xu, Nan
>> *Sent:* Thursday, September 07, 2017 10:23 AM
>> *To:* user@geode.apache.org
>> *Subject:* [External email from user-return-2063-nxu2=
>> baml@geode.apache.org] pdx serializer, need help
>>
>>
>>
>> hi,
>>
>>
>>
>>I try to use pdx serializer for a very simple class. After I deploy it
>> to server, the gfsh query prompt me. Really can not see where can go
>> wrong.  Can someone give suggestion?
>>
>>
>>
>> Btw, from client side, it works fine as this.
>>
>>
>>
>> public class Get {
>>
>> public static void main(String[] args) throws InterruptedException {
>>
>>
>>
>> Properties prop = new Properties();
>>
>> prop.setProperty("conserve-sockets","false");
>>
>> ClientCache cache = new
>> ClientCacheFactory(prop).addPoolLocator("centos", 10334)
>>
>> .setPdxSerializer(new MyPdxSerializer())
>>
>> .set("log-level", "info")
>>
>> .create();
>>
>>
>>
>>
>>
>> ClientRegionFactory regionFactory =
>> cache.createClientRegionFactory(ClientRegionShortcut.PROXY);
>>
>>
>>
>> Region region = regionFactory.create("test");
>>
>>
>>
>> Simple s =  region.get("key1");
>>
>> System.out.println(":" +s.getId() +" "+
>> s.getName() + " " + s.getTime());
>>
>>
>>
>> }
>>
>> }
>>
>>
>>
>> Thanks a lot.
>>
>>
>>
>> Nan
>>
>>
>>
>>
>>
>> On the server query, it breack…
>>
>>
>>
>> gfsh>query --query="select * from /test"
>>
>>
>>
>> Result : false
>>
>> startCount : 0
>>
>> endCount   : 20
>>
>> Message: Could not deserialize pdx because the pdx serializer's
>> fromData returned false for a pdx of class pojo.Simple
>>
>>
>>
>>
>>
>>
>>
>> Here is my class
>>
>>
>>
>> public class MyPdxSerializer  implements PdxSerializer, Declarable {
>>
>>
>>
>> @Override
>>
>> public void init(Properties props) {
>>
>>
>>
>> }
>>
>>
>>
>> @Override
>>
>> public boolean toData(Object o, PdxWriter writer) {
>>
>> if(!(o instanceof Simple)) {
>>
>> return false;
>>
>> }
>>
>> Simple s = (Simple) o;
>>
>> writer.writeString("id", s.id)
>>
>> .writeString("name", s.getName())
>>
>> .writeObject("time", s.getTime());
>>
>>
>>
>>
>>
>> return true;
>>
>> }
>>
>>
>>
>> @Override
>>
>> public Object fromData(Class clazz, PdxReader reader) {
>>
>> ;
>>
>> if(!clazz.equals(Simple.class)) {
>>
>> return null;
>>
>> }
>>
>> Simple s = Simple.getInstance();
>>
>> s.id = reader.readString("id");
>>
>> s.name = reader.readString("name");
>>
>> s.time = (Timestamp) reader.readObject("time");
>>
>> return s;
>>
>> }
>>
>> }
>>
>>
>>
>> And my domain object.
>>
>>
>>
>> public class Simple {
>>
>>
>>
>> public static Simple getInstance(){
>>
>> return new Simple();
>>
>> }
>>
>> //private Simple(){}
>>
>> String id;
>>
>>
>>
>> public String getId() {
>>
>> return id;
>>
>> }
>>
>>
>>
>> public void setId(String id) {
>>
>> this.id = id;
>>
>> }
>>
>>
>>
>> String name;
>>
>> Timestamp time;
>>
>>
>>
>> public String getName() {
>>
>> return name;
>>
>> }
>>
>>
>>
>> public void setName(String name) {
>>
>> this.name = name;
>>
>> }
>>
>>
>>
>> public Timestamp getTime() {
>>
>> return time;
>>
>> }
>>
>>
>>
>> public void setTime(Timestamp time) {
>>
>> this.time = time;
>>
>> }
>>
>> }
>>
>>
>> --
>>
>> This message, and any attachments, is for the intended recipient(s) only,
>> may contain information that is privileged, confidential and/or proprietary
>> and subject to important terms and conditions available at
>> http://www.bankofamerica.com/emaildisclaimer. If you are not the
>> intended recipient, please delete this message.
>> --
>> This message, and any attachments, is for the intended recipient(s) only,
>> may contain information that is privileged, confidential and/or proprietary
>> and subject to important terms and 

Re: How to handle string as java date type

2017-05-11 Thread Gang Yan
If you convert it to long,  do not need to_date  for the long field again.

Thacker, Dharam <dharam.thac...@jpmorgan.com>于2017年5月11日 周四下午10:48写道:

> Ok even if I convert it long format, how I can use that in compare
> expression
>
>
>
> Assuming data as below,
>
> {"id":"5","eventId":"Event4","intField":400,"currentDate":
> 1471254472000,"legalDate": 1471254472000}
>
>
>
> select e from /Event e where to_date(e.currentDate,'/MM/dd') >
> to_date(‘2018/02/20’,’/MM/dd’) from /Event e
>
>
>
> Query is invalid due to error - Syntax error in query- expecting
> StringLiteral, found 'e'
>
>
>
> Regards,
>
> Dharam
>
>
>
> *From:* Gang Yan [mailto:g...@pivotal.io]
> *Sent:* Thursday, May 11, 2017 8:11 PM
> *To:* user@geode.apache.org
> *Subject:* Re: How to handle string as java date type
>
>
>
> hi  Dharam
>
>
>
> maybe you can try to_date.
>
>
>
> but for reason of performance, I think that you can choose a long to
> represent a date value instead of a string.
>
>
>
>
> Thanks and regards
>
>
>
> Gang Yan(闫钢)
>
> Sr. Solution Architect
>
> Customer Success, Pivotal Great China
>
> Mobile:+86 13636347460
>
> g...@pivotal.io
>
>
>
> 2017-05-11 21:43 GMT+08:00 Thacker, Dharam <dharam.thac...@jpmorgan.com>:
>
> Hi Team,
>
>
>
> Is there any good way to play with DateType if I have PdxInstance data
> having date string with type [java.lang.String]?
>
>
>
> *Example:*
>
> "duedates": {
>
> "legalDate": "2022-04-19",
>
> "currentDate": "2022-04-19",
>
> }
>
>
>
> My goal is to get results based on date comparison,
>
>
>
> select i from /Event i where i.duedates.legalDate > ‘2022-04-15’
>
>
>
> Thanks & Regards,
>
> Dharam
>
> This message is confidential and subject to terms at: http://
> www.jpmorgan.com/emaildisclaimer including on confidentiality, legal
> privilege, viruses and monitoring of electronic messages. If you are not
> the intended recipient, please delete this message and notify the sender
> immediately. Any unauthorized use is strictly prohibited.
>
>
>
> This message is confidential and subject to terms at: http://
> www.jpmorgan.com/emaildisclaimer including on confidentiality, legal
> privilege, viruses and monitoring of electronic messages. If you are not
> the intended recipient, please delete this message and notify the sender
> immediately. Any unauthorized use is strictly prohibited.
>
-- 
null


Re: Geode memory handling issues

2016-12-13 Thread Gang Yan
Hi Assaf

Maybe, you met  tombstone mechanism.

And you can find some words about  tombstone on  the following link:
http://geode.apache.org/docs/guide/developing/distributed_regions/how_region_versioning_works.html



"When consistency checking is enabled for a region, a Geode member does not
immediately remove an entry from the region when an application destroys
the entry. Instead, the member retains the entry with its current version
stamp for a period of time in order to detect possible conflicts with
operations that have occurred. The retained entry is referred to as a
tombstone. "

Thanks and regards

Gang Yan(闫钢)
Sr. Solution Architect
Customer Success, Pivotal Great China
Mobile:+86 13636347460
g...@pivotal.io

2016-12-14 6:31 GMT+08:00 Udo Kohlmeyer <ukohlme...@pivotal.io>:

> The way overflow works is when the eviction-threshold is reached, the
> system will ask each region with overflow enabled to start overflowing data
> to disk.
>
> Whilst you have overflow enabled please set the previously mentioned ‑XX:
> CMSInitiatingOccupancyFraction=X and -XX:+UseCMSInitiatingOccupancyOnly.
> Make the InitiatingOccupancyFraction to be a few percent lower than the
> eviction-threshold. Then the GC will kick in clean before having to
> potentially overflow to disk. Also, once overflowed to disk, the gc will
> try and clean up any garbage left behind.
>
> Hope this helps...
>
> --Udo
>
> On 12/13/16 14:22, assaf_waiz...@amat.com wrote:
>
> Thanks Eric,
>
> I mistakenly thought that offheap is overflow...
> I'll test the offheap for my scenario, hope it will perform well on my
> data sizes and variance.
> One more thing I would like to ask- I saw that the overflow feature can be
> configured per region, does it mean that it also checks internally the mem
> usage for the region (not by querying the heap). If so it might be a
> possible workaround for me too.
>
> Once again, I really appreciate your help.
>
> On 14 Dec 2016, at 0:05, Charlie Black <cbl...@pivotal.io> wrote:
>
> It feels like Java hasn't hit the threshold when the GC would kick in.
>
> From a Geode perspective if the entry count is zero all of the references
> to the objects stored in Geode should be removed and are waiting to be
> reclaimed by Java.
>
> If you would like to force a GC try the gfsh command "gc".   GC will
> attempt to run the Java Garbage Collector.   Here is an example run:
>
> gfsh>gc
>
> GC Summary
>
>
> Member ID/Name  | HeapSize (MB) Before GC | HeapSize(MB)
> After GC | Time Taken for GC in ms
>
> --- | --- |
> - | ---
>
> 192.168.5.1(foo:23089):9696 | 189 | 142
> | 84
>
> On Tue, Dec 13, 2016 at 2:40 PM <assaf_waiz...@amat.com> wrote:
>
>> Indeed the eviction/offheap features or persistency can workaround this,
>> I considered the offheap but the problem for my scenario is that upon
>> reaching the threshold (which is tested by checking heap status) the
>> offheap will take place in I will have throughput hit although I have free
>> space in RAM (the server elements usage are less than threshold after some
>> keys removal, but since offheap is based on querying the heap new puts will
>> go offheap).
>>
>>
>>
>> My system requirements can’t afford working with disk while having free
>> RAM, it will impact it dramatically.
>>
>>
>>
>> Please share if you have more ideas to overcome this.
>>
>>
>>
>> Thanks a lot.
>>
>>
>>
>> *From:* Eric Shu [mailto:e...@pivotal.io]
>> *Sent:* יום ג 13 דצמבר 2016 23:27
>>
>>
>> *To:* user@geode.apache.org
>> *Subject:* Re: Geode memory handling issues
>>
>>
>>
>> Others might chime in as well. I think most users set eviction if they
>> know there will be a memory issue. Eviction is kicked in before the
>> critical heap setting (Low Memory Exception) with correct settings.
>>
>>
>>
>> Also, if it is partitioned region, you can add capacity by adding more
>> nodes so that system will be able to proceed. Users may also shut down
>> nodes and restart them again -- with persistence enabled. The data will be
>> recovered from disc.
>>
>>
>>
>> Regards,
>>
>> Eric
>>
>>
>>
>> On Tue, Dec 13, 2016 at 1:16 PM, <assaf_waiz...@amat.com> wrote:
>>
>> Thanks Dan & Jared,
>>
>> I carefully read the documentation for the resource management and
>> noticed that part that tells the interaction between it and the GC.
>