Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions include/infinispan/hotrod/Query.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Query.h
*
* Created on: Nov 23, 2016
* Author: rigazilla
*/

#ifndef INCLUDE_INFINISPAN_HOTROD_QUERY_H_
#define INCLUDE_INFINISPAN_HOTROD_QUERY_H_
#include "query.pb.h"
#include <tuple>

using namespace org::infinispan::protostream;

namespace org {
namespace infinispan {
namespace query {
namespace remote {
namespace client {

// jpqlstring field has been renamed to querystring
// in the .proto file.
// This class mantains backward compatibility
class QueryRequest : public QueryRequestProtobuf
{
public:
inline bool has_jpqlstring() const { return has_querystring(); }
inline void clear_jpqlstring() { clear_querystring(); }
inline const ::std::string& jpqlstring() const { return querystring(); }
inline void set_jpqlstring(const ::std::string& value) { set_querystring(value); }
inline void set_jpqlstring(const char* value) { set_querystring(value); }
inline void set_jpqlstring(const char* value, size_t size) { set_querystring(value, size); }
inline ::std::string* mutable_jpqlstring() { return mutable_querystring(); }
inline ::std::string* release_jpqlstring() { return release_querystring(); }
inline void set_allocated_jpqlstring(::std::string* querystring) { set_allocated_querystring(querystring); }
};

}}}}}

#endif /* INCLUDE_INFINISPAN_HOTROD_QUERY_H_ */
10 changes: 2 additions & 8 deletions include/infinispan/hotrod/QueryUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,8 @@

#ifndef INCLUDE_INFINISPAN_HOTROD_QUERYUTILS_H_
#define INCLUDE_INFINISPAN_HOTROD_QUERYUTILS_H_
#if _MSC_VER
#pragma warning(push)
#pragma warning(disable:4267 4244)
#endif
#include "query.pb.h"
#if _MSC_VER
#pragma warning(pop)
#endif

#include "infinispan/hotrod/Query.h"
#include <tuple>
using namespace org::infinispan::protostream;

Expand Down
12 changes: 1 addition & 11 deletions include/infinispan/hotrod/RemoteCache.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#ifndef ISPN_HOTROD_REMOTECACHE_H
#define ISPN_HOTROD_REMOTECACHE_H



#include "infinispan/hotrod/RemoteCacheBase.h"
#include "infinispan/hotrod/Marshaller.h"
#include "infinispan/hotrod/Flag.h"
Expand All @@ -12,15 +10,7 @@
#include "infinispan/hotrod/Version.h"
#include "infinispan/hotrod/exceptions.h"
#include "infinispan/hotrod/ClientListener.h"
#if _MSC_VER
#pragma warning(push)
#pragma warning(disable:4267 4244)
#endif
#include "query.pb.h"
#if _MSC_VER
#pragma warning(pop)
#endif

#include "infinispan/hotrod/Query.h"
#include <cmath>
#include <set>
#include <map>
Expand Down
10 changes: 1 addition & 9 deletions include/infinispan/hotrod/RemoteCacheBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,7 @@
#include "infinispan/hotrod/Flag.h"
#include "infinispan/hotrod/MetadataValue.h"
#include "infinispan/hotrod/portable.h"
#if _MSC_VER
#pragma warning(push)
#pragma warning(disable:4267 4244)
#endif
#include "query.pb.h"
#if _MSC_VER
#pragma warning(pop)
#endif

#include "infinispan/hotrod/Query.h"
#include <map>
#include <set>
#include <vector>
Expand Down
21 changes: 14 additions & 7 deletions proto/org/infinispan/query/remote/client/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ package org.infinispan.query.remote.client;
/**
* @TypeId(1000101)
*/
message QueryRequest {
message QueryRequestProtobuf {

/**
* The query string, expressed in JPA query language.
* The query string, expressed in Infinispan's query language (a JPA subset with full-text enhancements).
* NOTE: currently only a limited subset of the JPA query language is supported.
*/
required string jpqlString = 1;
required string queryString = 1;

// NOTE: id 2 was used for sort criteria, which is now into the ORDER BY clause inside the jpqlString
// NOTE: id 2 was used for sort criteria, which is now into the ORDER BY clause inside the query string

/**
* The number of matching results to skip before the first returned result.
Expand Down Expand Up @@ -90,13 +90,20 @@ message FilterResult {
*/
message ContinuousQueryResult {

required bool isJoining = 1;
/* @TypeId(1000105) */
enum ResultType {
JOINING = 1;
LEAVING = 0;
UPDATED = 2;
}

required ResultType resultType = 1;

required bytes key = 2;

/* Only present if joining == true and projection is missing */
/* Only present if resultType is JOINING or UPDATED and projection is missing */
optional bytes value = 3;

/* Only present if joining == true and value is missing */
/* Only present if jresultType is JOINING or UPDATED and value is missing */
repeated org.infinispan.protostream.WrappedMessage projection = 4;
}
3 changes: 1 addition & 2 deletions src/hotrod/api/RemoteCacheBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
#include "infinispan/hotrod/RemoteCacheBase.h"
#include "infinispan/hotrod/RemoteCacheManager.h"
#include "hotrod/impl/RemoteCacheImpl.h"
#include "query.pb.h"

#include "infinispan/hotrod/Query.h"
#include <iostream>

namespace infinispan {
Expand Down
9 changes: 1 addition & 8 deletions src/hotrod/impl/RemoteCacheImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,7 @@
#include "hotrod/impl/MetadataValueImpl.h"
#include "hotrod/impl/VersionedValueImpl.h"
#include "hotrod/impl/operations/PingOperation.h"
#if _MSVC_VER
#pragma warning(push)
#pragma warning(disable:4267 4244)
#endif
#include "query.pb.h"
#if _MSVC_VER
#pragma warning(pop)
#endif
#include "infinispan/hotrod/Query.h"

using namespace org::infinispan::query::remote::client;

Expand Down
10 changes: 1 addition & 9 deletions src/hotrod/impl/operations/OperationsFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,7 @@
#include "infinispan/hotrod/Flag.h"

#include <infinispan/hotrod/portable.h>
#if _MSC_VER
#pragma warning(push)
#pragma warning(disable:4267 4244)
#endif
#include <query.pb.h>
#if _MSC_VER
#pragma warning(pop)
#endif

#include "infinispan/hotrod/Query.h"
#include "infinispan/hotrod/ClientListener.h"
#include <set>
#include <functional>
Expand Down
9 changes: 1 addition & 8 deletions src/hotrod/impl/operations/QueryOperation.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,7 @@
#define SRC_HOTROD_IMPL_OPERATIONS_QUERYOPERATION_H_

#include "hotrod/impl/operations/RetryOnFailureOperation.h"
#if _MSC_VER
#pragma warning(push)
#pragma warning(disable:4267 4244)
#endif
#include "query.pb.h"
#if _MSC_VER
#pragma warning(pop)
#endif
#include "infinispan/hotrod/Query.h"
#include <memory>
namespace infinispan {
namespace hotrod {
Expand Down
Loading