-
Notifications
You must be signed in to change notification settings - Fork 34
Conversation
Add document about transactional semantics for Alcor Caches in general and spefically about Ignite Caches.
|
||
import java.util.Objects; | ||
|
||
public class CustomerResource extends Resource { | ||
|
||
@JsonProperty("project_id") | ||
// @QuerySqlField(index = true) |
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.
@pkommoju If we don't need add @QuerySqlField
here, please remove it and the import.
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.
@DavidLiu506 Please confirm, if we need the index on project_id
?
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 will remove it after Dahai confirms that it is no longer needed.
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.
Remove it first. Add it back if there are scenarios.
Removed the commented annotation.
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 just leave comment here. If we need it in the future, we can enable it then.
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.
Removed.
...ger/src/main/java/com/futurewei/alcor/netwconfigmanager/NetworkConfigManagerApplication.java
Outdated
Show resolved
Hide resolved
private String id; | ||
|
||
@JsonProperty("node_name") | ||
// @QuerySqlField(index = true) |
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.
@pkommoju and @DavidLiu506 Do we need index for node_id
and node_name
? If not, please remove it.
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.
node_name needs index. In fact NMM swagger and the getAllNodes allows querying on any combination of name, mac, local ip, ncm_id. I should add index on all of them. id may not be needed if getAllNodes doesn't use SCAN query if querying by only id. I will check this path and remove index on id if this is so.
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.
Removed index on id, added it on localIp, macAddress, ncm_id.
} | ||
|
||
@DurationStatistics | ||
public <E1, E2> Map<K, V> getBySqlFieldsAll(Map<String, Object[]> filterParams) { |
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.
@pkommoju Do we need to throw exception from this function?
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 think there is no need. runSqlFieldsQuery will throw any exception anyway. Just need to add throws CacheException.
if (sqlFields != null && sqlFields.size() != 0) { | ||
this.cache = getOrCreateIndexedCache(igniteClient, className, clientCacheConfig, null); | ||
if (this.cache == null) { | ||
logger.log(Level.WARNING, "Create cache for client " + className + " with index failed, falling back"); |
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.
@pkommoju How to handle falling back if this.cache=null
? just use igniteClient.getOrCreateCache(clientCacheConfig)
instead 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.
I am logging it as a warning message here. Few lines below, if this.cache is null, we call igniteClient.getOrCreateCache(clientCacheConfig). This call could also be because the the cache is not setup for SQLFieldsQuery in addition to handling the case where it is setup but something went wrong. Didn't want to have the call in two places.
* Set index value inline size to length of GUUID to avoid multiple index page fetch penalty. * Remove unecessary logging. * Check only once to see if SQL index can be created.
This pull request introduces 2 alerts when merging 5a1ea86 into a843622 - view on LGTM.com new alerts:
|
This pull request introduces 2 alerts when merging af58b49 into a843622 - view on LGTM.com new alerts:
|
|
||
import java.util.Objects; | ||
|
||
public class CustomerResource extends Resource { | ||
|
||
@JsonProperty("project_id") | ||
// @QuerySqlField(index = true) |
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 just leave comment here. If we need it in the future, we can enable it then.
...ger/src/main/java/com/futurewei/alcor/netwconfigmanager/NetworkConfigManagerApplication.java
Outdated
Show resolved
Hide resolved
docs/modules/ROOT/pages/performance/sql_and_scan_query_pref_comp.adoc
Outdated
Show resolved
Hide resolved
This pull request introduces 2 alerts when merging 02f04a5 into a843622 - view on LGTM.com new alerts:
|
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.
@pkommoju Another comment: please rename the scanquery
service to a name like scanquery_test_nodemanager
.
In that case, should the sqlquery service also be renamed as sqlquery_test_nodemanager, to be consistant?
this.cache = getOrCreateIndexedCache(igniteClient, className, clientCacheConfig, null); | ||
if (this.cache == null) { | ||
logger.log(Level.WARNING, "Create cache for client " + className + " with index failed, falling back"); | ||
} |
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.
Add if (!checkedForSqlFields)
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 check is a few lines above.
} | ||
private Map<String, SqlField> sqlFields = null; // needed for index creation and querying | ||
private List<String> sqlColumns = null; // needed for constructing indexes in specified order | ||
// so that a prefix query can use indexed search. |
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.
Remove sqlColumns , sqlFields use LinkedHashMap
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.
Is it fixed?
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.
Removed sqlColumns and changed Map to LinkedHashMap.
|
||
import java.util.Objects; | ||
|
||
public class CustomerResource extends Resource { | ||
|
||
@JsonProperty("project_id") | ||
// @QuerySqlField(index = true) |
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.
Remove it first. Add it back if there are scenarios.
Removed the commented annotation.
@@ -20,13 +20,15 @@ | |||
import com.futurewei.alcor.common.entity.CustomerResource; | |||
import lombok.Data; | |||
import lombok.NoArgsConstructor; | |||
import org.apache.ignite.cache.query.annotations.QuerySqlField; | |||
|
|||
import java.util.List; | |||
|
|||
@Data | |||
@JsonInclude(JsonInclude.Include.NON_ABSENT) | |||
public class PortEntity extends CustomerResource { | |||
@JsonProperty("network_id") |
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.
Don't add index
…y as suggested in the code review
This pull request introduces 2 alerts when merging eb19113 into a843622 - view on LGTM.com new alerts:
|
This pull request introduces 2 alerts when merging 3cf7110 into a843622 - view on LGTM.com new alerts:
|
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.
LGTM
Ignite SqlFieldQuery changes.