You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2020/06/26 12:33:34 UTC
[GitHub] [ignite] ptupitsyn opened a new pull request #7966: IGNITE-13148 Thin Client Continuous Query
ptupitsyn opened a new pull request #7966:
URL: https://github.com/apache/ignite/pull/7966
IEP: https://cwiki.apache.org/confluence/display/IGNITE/IEP-50%3A+Thin+Client+Continuous+Queries
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite] isapego commented on a change in pull request #7966: IGNITE-13148 .NET: Add Thin Client Continuous Query
Posted by GitBox <gi...@apache.org>.
isapego commented on a change in pull request #7966:
URL: https://github.com/apache/ignite/pull/7966#discussion_r457668187
##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheQueryContinuousRequest.java
##########
@@ -0,0 +1,147 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.platform.client.cache;
+
+import javax.cache.configuration.Factory;
+import javax.cache.configuration.FactoryBuilder;
+import javax.cache.event.CacheEntryEventFilter;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.binary.BinaryObject;
+import org.apache.ignite.cache.CacheEntryEventSerializableFilter;
+import org.apache.ignite.cache.query.ContinuousQuery;
+import org.apache.ignite.cache.query.QueryCursor;
+import org.apache.ignite.internal.binary.BinaryObjectImpl;
+import org.apache.ignite.internal.binary.BinaryRawReaderEx;
+import org.apache.ignite.internal.binary.GridBinaryMarshaller;
+import org.apache.ignite.internal.processors.platform.PlatformContext;
+import org.apache.ignite.internal.processors.platform.PlatformJavaObjectFactoryProxy;
+import org.apache.ignite.internal.processors.platform.client.ClientConnectionContext;
+import org.apache.ignite.internal.processors.platform.client.ClientPlatform;
+import org.apache.ignite.internal.processors.platform.client.ClientResponse;
+import org.apache.ignite.internal.processors.platform.client.ClientStatus;
+import org.apache.ignite.internal.processors.platform.client.IgniteClientException;
+import org.apache.ignite.internal.processors.platform.utils.PlatformUtils;
+
+/**
+ * Continuous query request.
+ */
+@SuppressWarnings({"rawtypes", "unchecked"})
+public class ClientCacheQueryContinuousRequest extends ClientCacheRequest {
+ /** Query. */
+ private final ContinuousQuery qry;
+
+ /** */
+ private final Object filter;
+
+ /** */
+ private final byte filterPlatform;
+
+ /**
+ * Ctor.
+ *
+ * @param reader Reader.
+ */
+ public ClientCacheQueryContinuousRequest(BinaryRawReaderEx reader) {
+ super(reader);
+
+ int pageSize = reader.readInt();
+ long timeInterval = reader.readLong();
+ boolean includeExpired = reader.readBoolean();
+
+ filter = reader.readObjectDetached();
+ filterPlatform = filter == null ? 0 : reader.readByte();
+
+ qry = new ContinuousQuery();
+
+ qry.setPageSize(pageSize)
+ .setTimeInterval(timeInterval)
+ .setIncludeExpired(includeExpired);
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClientResponse process(ClientConnectionContext ctx) {
+ qry.setRemoteFilterFactory(getFilterFactory(ctx));
+
+ ctx.incrementCursors();
Review comment:
Are you sure we should treat it as a query? I know there is a query word in name, but I'm not sure those mechanisms belong to the same pool.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite] ptupitsyn merged pull request #7966: IGNITE-13148 .NET: Add Thin Client Continuous Query
Posted by GitBox <gi...@apache.org>.
ptupitsyn merged pull request #7966:
URL: https://github.com/apache/ignite/pull/7966
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite] alex-plekhanov commented on a change in pull request #7966: IGNITE-13148 .NET: Add Thin Client Continuous Query
Posted by GitBox <gi...@apache.org>.
alex-plekhanov commented on a change in pull request #7966:
URL: https://github.com/apache/ignite/pull/7966#discussion_r456435091
##########
File path: modules/platforms/dotnet/Apache.Ignite.Core/Client/Cache/Query/Continuous/ContinuousQueryDisconnectedEventArgs.cs
##########
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */namespace Apache.Ignite.Core.Client.Cache.Query.Continuous
Review comment:
NL
##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheQueryContinuousRequest.java
##########
@@ -0,0 +1,147 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.platform.client.cache;
+
+import javax.cache.configuration.Factory;
+import javax.cache.configuration.FactoryBuilder;
+import javax.cache.event.CacheEntryEventFilter;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.binary.BinaryObject;
+import org.apache.ignite.cache.CacheEntryEventSerializableFilter;
+import org.apache.ignite.cache.query.ContinuousQuery;
+import org.apache.ignite.cache.query.QueryCursor;
+import org.apache.ignite.internal.binary.BinaryObjectImpl;
+import org.apache.ignite.internal.binary.BinaryRawReaderEx;
+import org.apache.ignite.internal.binary.GridBinaryMarshaller;
+import org.apache.ignite.internal.processors.platform.PlatformContext;
+import org.apache.ignite.internal.processors.platform.PlatformJavaObjectFactoryProxy;
+import org.apache.ignite.internal.processors.platform.client.ClientConnectionContext;
+import org.apache.ignite.internal.processors.platform.client.ClientPlatform;
+import org.apache.ignite.internal.processors.platform.client.ClientResponse;
+import org.apache.ignite.internal.processors.platform.client.ClientStatus;
+import org.apache.ignite.internal.processors.platform.client.IgniteClientException;
+import org.apache.ignite.internal.processors.platform.utils.PlatformUtils;
+
+/**
+ * Continuous query request.
+ */
+@SuppressWarnings({"rawtypes", "unchecked"})
+public class ClientCacheQueryContinuousRequest extends ClientCacheRequest {
+ /** Query. */
+ private final ContinuousQuery qry;
+
+ /** */
+ private final Object filter;
+
+ /** */
+ private final byte filterPlatform;
+
+ /**
+ * Ctor.
+ *
+ * @param reader Reader.
+ */
+ public ClientCacheQueryContinuousRequest(BinaryRawReaderEx reader) {
+ super(reader);
+
+ int pageSize = reader.readInt();
+ long timeInterval = reader.readLong();
+ boolean includeExpired = reader.readBoolean();
+
+ filter = reader.readObjectDetached();
+ filterPlatform = filter == null ? 0 : reader.readByte();
+
+ qry = new ContinuousQuery();
+
+ qry.setPageSize(pageSize)
+ .setTimeInterval(timeInterval)
+ .setIncludeExpired(includeExpired);
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClientResponse process(ClientConnectionContext ctx) {
+ qry.setRemoteFilterFactory(getFilterFactory(ctx));
+
+ ctx.incrementCursors();
+
+ try {
+ IgniteCache cache = filterPlatform == ClientPlatform.JAVA && !isKeepBinary()
+ ? rawCache(ctx)
+ : cache(ctx);
+
+ ClientCacheQueryContinuousHandle handle = new ClientCacheQueryContinuousHandle(ctx);
+ qry.setLocalListener(handle);
+
+ QueryCursor cur = cache.query(qry);
+ long cursorId = ctx.resources().put(handle);
+ handle.setCursor(cur);
+
+ return new ClientCacheQueryContinuousResponse(requestId(), handle, cursorId);
+ }
+ catch (Exception e) {
+ ctx.decrementCursors();
+ throw e;
+ }
+ }
+
+ /**
+ * Gets the filter factory.
+ *
+ * @param ctx Connection context.
+ * @return Filter factory or null.
+ */
+ private Factory<? extends CacheEntryEventFilter> getFilterFactory(ClientConnectionContext ctx) {
+ if (filter == null)
+ return null;
+
+ if (!(filter instanceof BinaryObject))
+ throw new IgniteClientException(ClientStatus.FAILED,
+ "Filter must be a BinaryObject: " + filter.getClass());
+
+ BinaryObjectImpl bo = (BinaryObjectImpl) filter;
+
+ switch (filterPlatform) {
+ case ClientPlatform.JAVA: {
+ if (bo.typeId() == GridBinaryMarshaller.PLATFORM_JAVA_OBJECT_FACTORY_PROXY) {
+ PlatformJavaObjectFactoryProxy prx = bo.deserialize();
+
+ CacheEntryEventSerializableFilter rmtFilter =
+ (CacheEntryEventSerializableFilter) prx.factory(ctx.kernalContext()).create();
+
+ return FactoryBuilder.factoryOf(rmtFilter);
+ }
+
+ return bo.deserialize();
+ }
+
+ case ClientPlatform.DOTNET: {
+ PlatformContext platformCtx = ctx.kernalContext().platform().context();
+
+ String curPlatform = platformCtx.platform();
+
+ if (!PlatformUtils.PLATFORM_DOTNET.equals(curPlatform))
+ throw new IgniteClientException(ClientStatus.FAILED, "ScanQuery filter platform is " +
Review comment:
`ScanQuery` -> `ContinuousQuery`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite] ptupitsyn commented on a change in pull request #7966: IGNITE-13148 .NET: Add Thin Client Continuous Query
Posted by GitBox <gi...@apache.org>.
ptupitsyn commented on a change in pull request #7966:
URL: https://github.com/apache/ignite/pull/7966#discussion_r456605504
##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheQueryContinuousRequest.java
##########
@@ -0,0 +1,147 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.platform.client.cache;
+
+import javax.cache.configuration.Factory;
+import javax.cache.configuration.FactoryBuilder;
+import javax.cache.event.CacheEntryEventFilter;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.binary.BinaryObject;
+import org.apache.ignite.cache.CacheEntryEventSerializableFilter;
+import org.apache.ignite.cache.query.ContinuousQuery;
+import org.apache.ignite.cache.query.QueryCursor;
+import org.apache.ignite.internal.binary.BinaryObjectImpl;
+import org.apache.ignite.internal.binary.BinaryRawReaderEx;
+import org.apache.ignite.internal.binary.GridBinaryMarshaller;
+import org.apache.ignite.internal.processors.platform.PlatformContext;
+import org.apache.ignite.internal.processors.platform.PlatformJavaObjectFactoryProxy;
+import org.apache.ignite.internal.processors.platform.client.ClientConnectionContext;
+import org.apache.ignite.internal.processors.platform.client.ClientPlatform;
+import org.apache.ignite.internal.processors.platform.client.ClientResponse;
+import org.apache.ignite.internal.processors.platform.client.ClientStatus;
+import org.apache.ignite.internal.processors.platform.client.IgniteClientException;
+import org.apache.ignite.internal.processors.platform.utils.PlatformUtils;
+
+/**
+ * Continuous query request.
+ */
+@SuppressWarnings({"rawtypes", "unchecked"})
+public class ClientCacheQueryContinuousRequest extends ClientCacheRequest {
+ /** Query. */
+ private final ContinuousQuery qry;
+
+ /** */
+ private final Object filter;
+
+ /** */
+ private final byte filterPlatform;
+
+ /**
+ * Ctor.
+ *
+ * @param reader Reader.
+ */
+ public ClientCacheQueryContinuousRequest(BinaryRawReaderEx reader) {
+ super(reader);
+
+ int pageSize = reader.readInt();
+ long timeInterval = reader.readLong();
+ boolean includeExpired = reader.readBoolean();
+
+ filter = reader.readObjectDetached();
+ filterPlatform = filter == null ? 0 : reader.readByte();
+
+ qry = new ContinuousQuery();
+
+ qry.setPageSize(pageSize)
+ .setTimeInterval(timeInterval)
+ .setIncludeExpired(includeExpired);
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClientResponse process(ClientConnectionContext ctx) {
+ qry.setRemoteFilterFactory(getFilterFactory(ctx));
+
+ ctx.incrementCursors();
+
+ try {
+ IgniteCache cache = filterPlatform == ClientPlatform.JAVA && !isKeepBinary()
+ ? rawCache(ctx)
+ : cache(ctx);
+
+ ClientCacheQueryContinuousHandle handle = new ClientCacheQueryContinuousHandle(ctx);
+ qry.setLocalListener(handle);
+
+ QueryCursor cur = cache.query(qry);
+ long cursorId = ctx.resources().put(handle);
+ handle.setCursor(cur);
+
+ return new ClientCacheQueryContinuousResponse(requestId(), handle, cursorId);
+ }
+ catch (Exception e) {
+ ctx.decrementCursors();
+ throw e;
+ }
+ }
+
+ /**
+ * Gets the filter factory.
+ *
+ * @param ctx Connection context.
+ * @return Filter factory or null.
+ */
+ private Factory<? extends CacheEntryEventFilter> getFilterFactory(ClientConnectionContext ctx) {
+ if (filter == null)
+ return null;
+
+ if (!(filter instanceof BinaryObject))
+ throw new IgniteClientException(ClientStatus.FAILED,
+ "Filter must be a BinaryObject: " + filter.getClass());
+
+ BinaryObjectImpl bo = (BinaryObjectImpl) filter;
+
+ switch (filterPlatform) {
+ case ClientPlatform.JAVA: {
+ if (bo.typeId() == GridBinaryMarshaller.PLATFORM_JAVA_OBJECT_FACTORY_PROXY) {
+ PlatformJavaObjectFactoryProxy prx = bo.deserialize();
+
+ CacheEntryEventSerializableFilter rmtFilter =
+ (CacheEntryEventSerializableFilter) prx.factory(ctx.kernalContext()).create();
+
+ return FactoryBuilder.factoryOf(rmtFilter);
+ }
+
+ return bo.deserialize();
+ }
+
+ case ClientPlatform.DOTNET: {
+ PlatformContext platformCtx = ctx.kernalContext().platform().context();
+
+ String curPlatform = platformCtx.platform();
+
+ if (!PlatformUtils.PLATFORM_DOTNET.equals(curPlatform))
+ throw new IgniteClientException(ClientStatus.FAILED, "ScanQuery filter platform is " +
Review comment:
Fixed
##########
File path: modules/platforms/dotnet/Apache.Ignite.Core/Client/Cache/Query/Continuous/ContinuousQueryDisconnectedEventArgs.cs
##########
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */namespace Apache.Ignite.Core.Client.Cache.Query.Continuous
Review comment:
Fixed
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite] alex-plekhanov commented on a change in pull request #7966: IGNITE-13148 Thin Client Continuous Query [DRAFT]
Posted by GitBox <gi...@apache.org>.
alex-plekhanov commented on a change in pull request #7966:
URL: https://github.com/apache/ignite/pull/7966#discussion_r454840906
##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheQueryContinuousRequest.java
##########
@@ -0,0 +1,144 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.platform.client.cache;
+
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.binary.BinaryObject;
+import org.apache.ignite.cache.CacheEntryEventSerializableFilter;
+import org.apache.ignite.cache.query.ContinuousQuery;
+import org.apache.ignite.cache.query.QueryCursor;
+import org.apache.ignite.internal.binary.BinaryObjectImpl;
+import org.apache.ignite.internal.binary.BinaryRawReaderEx;
+import org.apache.ignite.internal.binary.GridBinaryMarshaller;
+import org.apache.ignite.internal.processors.platform.PlatformContext;
+import org.apache.ignite.internal.processors.platform.PlatformJavaObjectFactoryProxy;
+import org.apache.ignite.internal.processors.platform.client.*;
+import org.apache.ignite.internal.processors.platform.utils.PlatformUtils;
+
+import javax.cache.configuration.Factory;
+import javax.cache.configuration.FactoryBuilder;
+import javax.cache.event.CacheEntryEventFilter;
+
+/**
+ * Continuous query request.
+ */
+@SuppressWarnings({"rawtypes", "unchecked"})
+public class ClientCacheQueryContinuousRequest extends ClientCacheRequest {
+
Review comment:
Redundant NL
##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheQueryContinuousHandle.java
##########
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.platform.client.cache;
+
+import org.apache.ignite.cache.query.QueryCursor;
+import org.apache.ignite.internal.processors.platform.client.ClientCloseableResource;
+import org.apache.ignite.internal.processors.platform.client.ClientConnectionContext;
+import org.apache.ignite.internal.processors.platform.client.ClientMessageParser;
+import org.apache.ignite.internal.processors.platform.client.ClientNotification;
+
+import javax.cache.event.CacheEntryEvent;
+import javax.cache.event.CacheEntryListenerException;
+import javax.cache.event.CacheEntryUpdatedListener;
+
+/**
+ * Continuous query handle.
+ * NOTE: Do not mark with {@link org.apache.ignite.lang.IgniteAsyncCallback} - it disables batching and sends
+ * events one by one.
+ */
+public class ClientCacheQueryContinuousHandle implements CacheEntryUpdatedListener<Object, Object>, ClientCloseableResource {
+ /** */
+ private final ClientConnectionContext ctx;
+
+ /** */
+ private volatile Long id;
+
+ /** */
+ private volatile QueryCursor<?> cur;
+
+ /**
+ * Ctor.
+ * @param ctx Context.
+ */
+ public ClientCacheQueryContinuousHandle(ClientConnectionContext ctx) {
+ assert ctx != null;
+
+ this.ctx = ctx;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void onUpdated(Iterable<CacheEntryEvent<?, ?>> iterable) throws CacheEntryListenerException {
+ // Client is not yet ready to receive notifications - skip them.
+ if (id == null)
+ return;
+
+ ClientCacheEntryEventNotification notification = new ClientCacheEntryEventNotification(
+ ClientMessageParser.OP_QUERY_CONTINUOUS_EVENT_NOTIFICATION, id, iterable);
+
+ ctx.notifyClient(notification);
+ }
+
+ /**
+ * Sets the cursor id.
+ * @param id Cursor id.
+ */
+ public void startNotifications(long id, QueryCursor<?> cur) {
+ assert cur != null;
+
+ this.id = id;
+ this.cur = cur;
+ }
+
+ /** <inheritdoc /> */
Review comment:
`{@inheritDoc}`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite] ptupitsyn commented on a change in pull request #7966: IGNITE-13148 .NET: Add Thin Client Continuous Query
Posted by GitBox <gi...@apache.org>.
ptupitsyn commented on a change in pull request #7966:
URL: https://github.com/apache/ignite/pull/7966#discussion_r458670006
##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheQueryContinuousRequest.java
##########
@@ -0,0 +1,147 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.platform.client.cache;
+
+import javax.cache.configuration.Factory;
+import javax.cache.configuration.FactoryBuilder;
+import javax.cache.event.CacheEntryEventFilter;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.binary.BinaryObject;
+import org.apache.ignite.cache.CacheEntryEventSerializableFilter;
+import org.apache.ignite.cache.query.ContinuousQuery;
+import org.apache.ignite.cache.query.QueryCursor;
+import org.apache.ignite.internal.binary.BinaryObjectImpl;
+import org.apache.ignite.internal.binary.BinaryRawReaderEx;
+import org.apache.ignite.internal.binary.GridBinaryMarshaller;
+import org.apache.ignite.internal.processors.platform.PlatformContext;
+import org.apache.ignite.internal.processors.platform.PlatformJavaObjectFactoryProxy;
+import org.apache.ignite.internal.processors.platform.client.ClientConnectionContext;
+import org.apache.ignite.internal.processors.platform.client.ClientPlatform;
+import org.apache.ignite.internal.processors.platform.client.ClientResponse;
+import org.apache.ignite.internal.processors.platform.client.ClientStatus;
+import org.apache.ignite.internal.processors.platform.client.IgniteClientException;
+import org.apache.ignite.internal.processors.platform.utils.PlatformUtils;
+
+/**
+ * Continuous query request.
+ */
+@SuppressWarnings({"rawtypes", "unchecked"})
+public class ClientCacheQueryContinuousRequest extends ClientCacheRequest {
+ /** Query. */
+ private final ContinuousQuery qry;
+
+ /** */
+ private final Object filter;
+
+ /** */
+ private final byte filterPlatform;
+
+ /**
+ * Ctor.
+ *
+ * @param reader Reader.
+ */
+ public ClientCacheQueryContinuousRequest(BinaryRawReaderEx reader) {
+ super(reader);
+
+ int pageSize = reader.readInt();
+ long timeInterval = reader.readLong();
+ boolean includeExpired = reader.readBoolean();
+
+ filter = reader.readObjectDetached();
+ filterPlatform = filter == null ? 0 : reader.readByte();
+
+ qry = new ContinuousQuery();
+
+ qry.setPageSize(pageSize)
+ .setTimeInterval(timeInterval)
+ .setIncludeExpired(includeExpired);
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClientResponse process(ClientConnectionContext ctx) {
+ qry.setRemoteFilterFactory(getFilterFactory(ctx));
+
+ ctx.incrementCursors();
Review comment:
No replies on dev list. Let's keep it as is for now. Continuous Query still gives us a `QueryCursor`, so I think it fits with the other cursors.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite] ptupitsyn commented on a change in pull request #7966: IGNITE-13148 .NET: Add Thin Client Continuous Query
Posted by GitBox <gi...@apache.org>.
ptupitsyn commented on a change in pull request #7966:
URL: https://github.com/apache/ignite/pull/7966#discussion_r457893271
##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheQueryContinuousRequest.java
##########
@@ -0,0 +1,147 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.platform.client.cache;
+
+import javax.cache.configuration.Factory;
+import javax.cache.configuration.FactoryBuilder;
+import javax.cache.event.CacheEntryEventFilter;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.binary.BinaryObject;
+import org.apache.ignite.cache.CacheEntryEventSerializableFilter;
+import org.apache.ignite.cache.query.ContinuousQuery;
+import org.apache.ignite.cache.query.QueryCursor;
+import org.apache.ignite.internal.binary.BinaryObjectImpl;
+import org.apache.ignite.internal.binary.BinaryRawReaderEx;
+import org.apache.ignite.internal.binary.GridBinaryMarshaller;
+import org.apache.ignite.internal.processors.platform.PlatformContext;
+import org.apache.ignite.internal.processors.platform.PlatformJavaObjectFactoryProxy;
+import org.apache.ignite.internal.processors.platform.client.ClientConnectionContext;
+import org.apache.ignite.internal.processors.platform.client.ClientPlatform;
+import org.apache.ignite.internal.processors.platform.client.ClientResponse;
+import org.apache.ignite.internal.processors.platform.client.ClientStatus;
+import org.apache.ignite.internal.processors.platform.client.IgniteClientException;
+import org.apache.ignite.internal.processors.platform.utils.PlatformUtils;
+
+/**
+ * Continuous query request.
+ */
+@SuppressWarnings({"rawtypes", "unchecked"})
+public class ClientCacheQueryContinuousRequest extends ClientCacheRequest {
+ /** Query. */
+ private final ContinuousQuery qry;
+
+ /** */
+ private final Object filter;
+
+ /** */
+ private final byte filterPlatform;
+
+ /**
+ * Ctor.
+ *
+ * @param reader Reader.
+ */
+ public ClientCacheQueryContinuousRequest(BinaryRawReaderEx reader) {
+ super(reader);
+
+ int pageSize = reader.readInt();
+ long timeInterval = reader.readLong();
+ boolean includeExpired = reader.readBoolean();
+
+ filter = reader.readObjectDetached();
+ filterPlatform = filter == null ? 0 : reader.readByte();
+
+ qry = new ContinuousQuery();
+
+ qry.setPageSize(pageSize)
+ .setTimeInterval(timeInterval)
+ .setIncludeExpired(includeExpired);
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClientResponse process(ClientConnectionContext ctx) {
+ qry.setRemoteFilterFactory(getFilterFactory(ctx));
+
+ ctx.incrementCursors();
Review comment:
Good point, I've posted this to the dev list.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite] ptupitsyn commented on a change in pull request #7966: IGNITE-13148 .NET: Add Thin Client Continuous Query
Posted by GitBox <gi...@apache.org>.
ptupitsyn commented on a change in pull request #7966:
URL: https://github.com/apache/ignite/pull/7966#discussion_r456604804
##########
File path: modules/platforms/dotnet/Apache.Ignite.Core/Client/Cache/Query/Continuous/ContinuousQueryDisconnectedEventArgs.cs
##########
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */namespace Apache.Ignite.Core.Client.Cache.Query.Continuous
Review comment:
Fixed
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite] ptupitsyn commented on a change in pull request #7966: IGNITE-13148 Thin Client Continuous Query [DRAFT]
Posted by GitBox <gi...@apache.org>.
ptupitsyn commented on a change in pull request #7966:
URL: https://github.com/apache/ignite/pull/7966#discussion_r454956116
##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheQueryContinuousRequest.java
##########
@@ -0,0 +1,144 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.platform.client.cache;
+
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.binary.BinaryObject;
+import org.apache.ignite.cache.CacheEntryEventSerializableFilter;
+import org.apache.ignite.cache.query.ContinuousQuery;
+import org.apache.ignite.cache.query.QueryCursor;
+import org.apache.ignite.internal.binary.BinaryObjectImpl;
+import org.apache.ignite.internal.binary.BinaryRawReaderEx;
+import org.apache.ignite.internal.binary.GridBinaryMarshaller;
+import org.apache.ignite.internal.processors.platform.PlatformContext;
+import org.apache.ignite.internal.processors.platform.PlatformJavaObjectFactoryProxy;
+import org.apache.ignite.internal.processors.platform.client.*;
+import org.apache.ignite.internal.processors.platform.utils.PlatformUtils;
+
+import javax.cache.configuration.Factory;
+import javax.cache.configuration.FactoryBuilder;
+import javax.cache.event.CacheEntryEventFilter;
+
+/**
+ * Continuous query request.
+ */
+@SuppressWarnings({"rawtypes", "unchecked"})
+public class ClientCacheQueryContinuousRequest extends ClientCacheRequest {
+
Review comment:
Fixed
##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheQueryContinuousHandle.java
##########
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.platform.client.cache;
+
+import org.apache.ignite.cache.query.QueryCursor;
+import org.apache.ignite.internal.processors.platform.client.ClientCloseableResource;
+import org.apache.ignite.internal.processors.platform.client.ClientConnectionContext;
+import org.apache.ignite.internal.processors.platform.client.ClientMessageParser;
+import org.apache.ignite.internal.processors.platform.client.ClientNotification;
+
+import javax.cache.event.CacheEntryEvent;
+import javax.cache.event.CacheEntryListenerException;
+import javax.cache.event.CacheEntryUpdatedListener;
+
+/**
+ * Continuous query handle.
+ * NOTE: Do not mark with {@link org.apache.ignite.lang.IgniteAsyncCallback} - it disables batching and sends
+ * events one by one.
+ */
+public class ClientCacheQueryContinuousHandle implements CacheEntryUpdatedListener<Object, Object>, ClientCloseableResource {
+ /** */
+ private final ClientConnectionContext ctx;
+
+ /** */
+ private volatile Long id;
+
+ /** */
+ private volatile QueryCursor<?> cur;
+
+ /**
+ * Ctor.
+ * @param ctx Context.
+ */
+ public ClientCacheQueryContinuousHandle(ClientConnectionContext ctx) {
+ assert ctx != null;
+
+ this.ctx = ctx;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void onUpdated(Iterable<CacheEntryEvent<?, ?>> iterable) throws CacheEntryListenerException {
+ // Client is not yet ready to receive notifications - skip them.
+ if (id == null)
+ return;
+
+ ClientCacheEntryEventNotification notification = new ClientCacheEntryEventNotification(
+ ClientMessageParser.OP_QUERY_CONTINUOUS_EVENT_NOTIFICATION, id, iterable);
+
+ ctx.notifyClient(notification);
+ }
+
+ /**
+ * Sets the cursor id.
+ * @param id Cursor id.
+ */
+ public void startNotifications(long id, QueryCursor<?> cur) {
+ assert cur != null;
+
+ this.id = id;
+ this.cur = cur;
+ }
+
+ /** <inheritdoc /> */
Review comment:
Fixed
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org