-
Notifications
You must be signed in to change notification settings - Fork 34
[AlcorLib] Support Multi-Params Query #252
Conversation
|
@Gzure Thanks for submitting the PR 👍 Quick comment: can you please take a look at the test result shown on https://github.com/futurewei-cloud/alcor/pull/252/checks?check_run_id=776341456? It seems that some existing Ignite UTs in AlcorLib doesn't pass. Maybe a UT issue. |
| public class IgniteCacheFactory implements ICacheFactory { | ||
|
|
||
| private IgniteClient igniteClient; | ||
| private Ignite ignite; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the difference of ignite.Ignite and ignite.client.IgniteClient? Is it Ignite some sort of client?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Gzure Could you think of renaming the class "ignite.Ignite" with more specific meaning, for example, IgniteXYZClient?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ignite.client.IgniteClient is a thin ignite client, about thin client https://www.gridgain.com/docs/latest/developers-guide/thin-clients/getting-started-with-thin-clients. A ignite. Ignite as an Ignite cluster node in client mode can support more functions than IgniteClient class, but it does not store data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay. Thanks.
We might need to consider:
- Slow client handling (ref: https://apacheignite.readme.io/docs/clients-vs-servers#managing-slow-clients).
- Client reconnect handling (ref: https://apacheignite.readme.io/docs/clients-vs-servers#reconnecting-a-client). This requires adding a special exception handling in the catch block.
- Number of Ignite nodes in client mode. If the number goes large, it could affect the performance on the server side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
|
@Gzure It seems that the latest alcor/master has some conflicting files. Could you do a pull and merge the conflict? Meanwhile, the PR history above shows some commits that were previously included in other PRs. Maybe you want to clean up your branch history a bit. |
b23e780 to
fa769da
Compare
| try { | ||
| cache = igniteClient.getOrCreateCache(name); | ||
| cache = ignite.getOrCreateCache(name); | ||
| } catch (ClientException e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we have used Ignite instead of IgniteClient, the exceptions of cache operations should be modified accordingly.
| return null; | ||
| } | ||
|
|
||
| E2 obj = result.get(0).getValue(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How to ensure that there is only one result of the query? if so, is the getAll (CachePredicate < E1, E2 > cachePredicate) interface sufficient?
| import com.futurewei.alcor.common.db.query.CachePredicate; | ||
| import com.google.common.collect.ImmutableMap; | ||
| import org.apache.ignite.binary.BinaryObject; | ||
| import org.apache.ignite.cache.query.ScanQuery; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's delete useless import.
2b213cc to
7bf67ab
Compare
|
@xieus Based on the test results with OpenStack, some modifications were made. Now two microservices of VPC and Subnet can be integrated with OpenStack normally. |
This is very cool! Thanks, @Gzure. Could you write a short instruction on Alcor-Nova integration including how to register Alcor on a running Nova service, how to trigger testing from Nova to Alcor etc. |
|
@xieus All we need to do is according integration_nova doc [How nova client identify alcor server url] section to register Alcor on OpenStack (include nova). |
| /** | ||
| * Get Cache value from cache db by multi params | ||
| * | ||
| * @param var1 the cache key |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems that we need to update the comments here.
| public class ControllerUtilTest { | ||
|
|
||
| @Test | ||
| public void transformUrlPathParamsTest() throws QueryParamTypeNotSupportException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like it.
| //@Bean | ||
| public KeystoneAuthWebFilter keystoneAuthWebFilter(){ | ||
| if(!keystoneEnable){ | ||
| return null; | ||
| } | ||
| return new KeystoneAuthWebFilter(); | ||
| } | ||
|
|
||
| @Bean | ||
| public KeystoneAuthGwFilter keystoneAuthGwFilter(){ | ||
| if(!keystoneEnable){ | ||
| return null; | ||
| } | ||
| return new KeystoneAuthGwFilter(); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicated issue or merge issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are different filter. KeystoneAuthGwFilter is used for Spring Gateway. KeystoneAuthWebFilter is used for Webflux filter.
Since webflux is now replaced with spring gateway, KeystoneAuthWebFilteris no longer useful。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Thanks for the clarification.
|
LGTM. @chenpiaoping Could you also continue to review and sign off the PR when it is ready? |
Good to know. Thanks for confirmation. |
|
This PR proposes a critical fundamental features as well as a few bug fix. Please list them all in the PR description. @Gzure |
sure |
ok |
lib/src/main/java/com/futurewei/alcor/common/db/query/ScanQueryBuilder.java
Show resolved
Hide resolved
lib/src/main/java/com/futurewei/alcor/common/db/query/impl/MapPredicate.java
Outdated
Show resolved
Hide resolved
lib/src/main/java/com/futurewei/alcor/common/db/ignite/IgniteDbCache.java
Outdated
Show resolved
Hide resolved
lib/src/main/java/com/futurewei/alcor/common/db/ignite/IgniteDbCache.java
Show resolved
Hide resolved
| } | ||
|
|
||
| @Override | ||
| public Transaction start() throws CacheException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need throws CacheException here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IgniteClienTransaction need
| if (clientTransaction != null) { | ||
| clientTransaction.close(); | ||
| if (transaction != null) { | ||
| transaction.close(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May need to catch IgniteException here.
lib/src/main/java/com/futurewei/alcor/common/db/redis/RedisExpireCache.java
Outdated
Show resolved
Hide resolved
|
|
||
| private IgniteClient igniteClient; | ||
| private ClientTransaction clientTransaction; | ||
| private final Ignite client; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Gzure Should Ignitetransaction also support IgniteClient based on the setting?
This is non-blocking. If we do need that, we can do it next PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Gzure Should Ignitetransaction also support IgniteClient based on the setting?
This is non-blocking. If we do need that, we can do it next PR.
I had added a IgniteClientTransaction which according to Ignite thin client
| ClientConnectorConfiguration clientConfig = new ClientConnectorConfiguration(); | ||
| clientConfig.setPort(ListenPort); | ||
|
|
||
| org.apache.ignite.configuration.IgniteConfiguration cfg = new org.apache.ignite.configuration.IgniteConfiguration(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In our MockIgniteServer, do we need to test both IgniteClient and Ignite?
xieus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR addresses one of the most critical needs in the Alcor project - multi-param query - with many other enhancement of feature and UT throughout the project.
Approve it with pleasure. Thank you for your contribution @Gzure
| import java.util.UUID; | ||
|
|
||
| @Service | ||
| //@Service |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If not that in use anyway, we can consider deprecate then remove them
|
@Gzure Somehow merge from latest alcor/master doesn't work (failure in RouteManager likely due to a recent check-in). Could you take a quick look? Thanks. |
add field filter support add UTs skip init ignite client bean
make some api return value meet neutron api
It confict with new Merge PR, Have fixed. |
This PR proposes the following changes:
Features:
Bugs: