Как получить доступ к OQL-запросу в регионе Gemfire 9.6 в Java - PullRequest
0 голосов
/ 15 апреля 2019
I am using Gemfire pivotal for the first time and I need someone who can help me with below question. The Gemfire Pivotal 9.6 is installed on Unix server and I am able to connect to Unix with no issue. I am inside unix now, but I can't access Gemfire. 

Q. How to Access OQL Query on a Gemfire 9.6 Region in java.

Так я подключился к Unix.

private String host = "имя хоста пошло сюда"; private String port = "номер порта здесь"; private String user = "userID"; private String password = "пароль" private String SSH command = "ssh ------" private String commandBah = "bash"; private String commandgfish = "sh /data/gemfire9.6/pivotal-gemfire-9.6.0/bin/gfsh";

        This is the way I am trying to connect to Gemfire which is not working properly now.



// Gemfire Connection URL, username and password 
            private String connect To Gemfire = "connect --locator=--------";
            private String username = "credential";--
            private String command Pass = "password"
            private String comman Setvariable  = "set variable --name=APP_RESULT_VIEWER --value=EXTERNAL";

1 Ответ

0 голосов
/ 15 апреля 2019

Чтобы получить доступ к региону в Java, вам необходимо создать клиент GemFire.Вот базовый фрагмент кода Java, который создает клиент GemFire ​​и выполняет запрос:

ClientCache cache = new ClientCacheFactory()
      .addPoolLocator(locator_host, 10334)
      .create()
cache.getQueryService().newQuery("select count(*) from /region").execute()

Для более полного примера вы можете взглянуть на проект примеров geode (GemFire ​​основан на Geode).Вот пример запроса от клиента: https://github.com/apache/geode-examples/tree/master/indexes

...