Skip to content
This repository was archived by the owner on Mar 31, 2023. It is now read-only.

Conversation

@Gzure
Copy link
Contributor

@Gzure Gzure commented Jun 16, 2020

This PR proposes the following changes:

Features:

  • change IgniteClient to Ignite node client
  • add support multi params query
  • HTTP response can according to URL query param [field] filter need entity fields
  • unit test can initialize the Ignite client bean on demand
  • replace webflux with spring gateway route define
  • support default value return for HTTP JSON response
  • add a new API [/v2.0/extensions] in API GW
  • add security group API in API GW
  • support return both project_id and tenant_id

Bugs:

  • fix VPC , Subnet, Port microservices return value not correct
  • move generate UUID from API GW to microservice
  • remove some no need check in VPC and Subnet microservices

@xieus xieus self-requested a review June 16, 2020 11:58
@xieus xieus added the feature feature development label Jun 16, 2020
@xieus xieus added this to the Version 0.6.2020.06.30 milestone Jun 16, 2020
@xieus xieus linked an issue Jun 16, 2020 that may be closed by this pull request
@xieus
Copy link
Contributor

xieus commented Jun 16, 2020

@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.

@xieus xieus changed the title Multi params query [AlcorLib] Support Multi Params Query Jun 16, 2020
public class IgniteCacheFactory implements ICacheFactory {

private IgniteClient igniteClient;
private Ignite ignite;
Copy link
Contributor

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?

Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@xieus
Copy link
Contributor

xieus commented Jun 20, 2020

@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.

@Gzure Gzure force-pushed the multi-params-query branch from b23e780 to fa769da Compare June 22, 2020 02:58
@xieus xieus linked an issue Jun 23, 2020 that may be closed by this pull request
try {
cache = igniteClient.getOrCreateCache(name);
cache = ignite.getOrCreateCache(name);
} catch (ClientException e) {
Copy link
Contributor

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();
Copy link
Contributor

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;
Copy link
Contributor

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.

@Gzure Gzure force-pushed the multi-params-query branch from 2b213cc to 7bf67ab Compare June 29, 2020 07:50
@Gzure
Copy link
Contributor Author

Gzure commented Jun 29, 2020

@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.

@xieus
Copy link
Contributor

xieus commented Jun 30, 2020

@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.

@Gzure
Copy link
Contributor Author

Gzure commented Jun 30, 2020

@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
Copy link
Contributor

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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like it.

Comment on lines +37 to +51
//@Bean
public KeystoneAuthWebFilter keystoneAuthWebFilter(){
if(!keystoneEnable){
return null;
}
return new KeystoneAuthWebFilter();
}

@Bean
public KeystoneAuthGwFilter keystoneAuthGwFilter(){
if(!keystoneEnable){
return null;
}
return new KeystoneAuthGwFilter();
}
Copy link
Contributor

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?

Copy link
Contributor Author

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。

Copy link
Contributor

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.

@xieus
Copy link
Contributor

xieus commented Jun 30, 2020

LGTM. @chenpiaoping Could you also continue to review and sign off the PR when it is ready?

@xieus
Copy link
Contributor

xieus commented Jun 30, 2020

@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).

Good to know. Thanks for confirmation.

@xieus
Copy link
Contributor

xieus commented Jun 30, 2020

This PR proposes a critical fundamental features as well as a few bug fix. Please list them all in the PR description. @Gzure

@chenpiaoping
Copy link
Contributor

LGTM. @chenpiaoping Could you also continue to review and sign off the PR when it is ready?

sure

@Gzure
Copy link
Contributor Author

Gzure commented Jun 30, 2020

This PR proposes a critical fundamental features as well as a few bug fix. Please list them all in the PR description. @Gzure

ok

@Gzure Gzure force-pushed the multi-params-query branch from 79ce34e to c14d746 Compare July 2, 2020 03:44
}

@Override
public Transaction start() throws CacheException {
Copy link
Contributor

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?

Copy link
Contributor Author

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();
Copy link
Contributor

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.


private IgniteClient igniteClient;
private ClientTransaction clientTransaction;
private final Ignite client;
Copy link
Contributor

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.

Copy link
Contributor Author

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();
Copy link
Contributor

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?

Copy link
Contributor

@xieus xieus left a 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
Copy link
Contributor

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

@xieus
Copy link
Contributor

xieus commented Jul 3, 2020

@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.

@Gzure Gzure force-pushed the multi-params-query branch from 9d8ed7e to bc42ef2 Compare July 3, 2020 02:30
@Gzure
Copy link
Contributor Author

Gzure commented Jul 3, 2020

@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.

It confict with new Merge PR, Have fixed.

@xieus xieus changed the title [AlcorLib] Support Multi Params Query [AlcorLib] Support Multi-Params Query Jul 3, 2020
@xieus xieus merged commit 0276c27 into futurewei-cloud:master Jul 3, 2020
@Gzure Gzure deleted the multi-params-query branch July 3, 2020 08:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

feature feature development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Microservice Enhancement] APIs support multi params query Integration with Nova Compute (in the vm creation scenario)

3 participants