Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Time-to-live in query(syntax) #403

Merged
merged 3 commits into from
Jun 4, 2019
Merged

Conversation

ayyt
Copy link
Contributor

@ayyt ayyt commented May 20, 2019

As title.

@nebula-community-bot
Copy link
Member

Can one of the admins verify this patch?

@ayyt
Copy link
Contributor Author

ayyt commented May 24, 2019

Rebase and please review,thx.

return folly::stringPrintf("ttl_col = %s",
boost::get<std::string>(propValue_).c_str());
// TODO(YT) The following features will be supported in the future
case COMMENT:
Copy link
Contributor

Choose a reason for hiding this comment

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

We'd better remove them before discussing what configurations we should support.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah,I will remove them.
Written here only identifies them as attributes of the schema

public:
using Value = boost::variant<int64_t, bool, std::string>;

enum PropType : uint8_t {
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

@@ -95,6 +94,14 @@ ON ([Oo][Nn])
ROLES ([Rr][Oo][Ll][Ee][Ss])
BY ([Bb][Yy])
IN ([Ii][Nn])
TTL_DURATION ([Tt][Tt][Ll][_][Dd][Uu][Rr][Aa][Tt][Ii][Oo][Nn])
TTL_COL ([Tt][Tt][Ll][_][Cc][Oo][Ll])
COMMENT ([Cc][Oo][Mm][Mm][Ee][Nn][Tt])
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

CHECK_SEMANTIC_TYPE("TTL_COL", TokenType::KW_TTL_COL),
CHECK_SEMANTIC_TYPE("ttl_col", TokenType::KW_TTL_COL),
CHECK_SEMANTIC_TYPE("Ttl_col", TokenType::KW_TTL_COL),
CHECK_SEMANTIC_TYPE("COMMENT", TokenType::KW_COMMENT),
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

@ayyt ayyt force-pushed the TTL branch 2 times, most recently from f687d75 to ecbb77f Compare May 31, 2019 03:55
@ayyt
Copy link
Contributor Author

ayyt commented May 31, 2019

Fix comments and rebase master, please review again, thx.

propValue_ = std::move(val);
}

int64_t asInt() {
Copy link
Contributor

Choose a reason for hiding this comment

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

If you don't want to expose the methods to outside, just make them private.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍,good catch!

return boost::get<int64_t>(propValue_);
}

std::string& asString() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Return reference?

return propValue_.which() == 2;
}

int64_t getTtlDuration() {
Copy link
Contributor

Choose a reason for hiding this comment

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

StatusOr?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, I will do it.

}
}

std::string getTtlCol() {
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, I will do it.

@ayyt
Copy link
Contributor Author

ayyt commented May 31, 2019

Fix comments and rebase master, please review again, thx.

@dangleptr
Copy link
Contributor

Jenkins go

@dangleptr dangleptr added the ready-for-testing PR: ready for the CI test label May 31, 2019
@nebula-community-bot
Copy link
Member

Unit testing passed.

@ayyt
Copy link
Contributor Author

ayyt commented Jun 3, 2019

Rebase master

@dangleptr
Copy link
Contributor

Jenkins go

@nebula-community-bot
Copy link
Member

Unit testing passed.

Copy link
Contributor

@dangleptr dangleptr left a comment

Choose a reason for hiding this comment

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

Well done.

@nebula-community-bot
Copy link
Member

Unit testing passed.

return boost::get<std::string>(propValue_);
}

bool asBool() {
Copy link
Contributor

Choose a reason for hiding this comment

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

why need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because the type of some values can be bool type.

return propValue_.which() == 0;
}

bool isBool() {
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because the type of some values can be bool type.

Copy link
Contributor

@laura-ding laura-ding left a comment

Choose a reason for hiding this comment

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

well done

@laura-ding laura-ding merged commit da61d2d into vesoft-inc:master Jun 4, 2019
@ayyt ayyt deleted the TTL branch June 4, 2019 03:47
@ayyt ayyt mentioned this pull request Jun 4, 2019
@ayyt ayyt mentioned this pull request Jun 21, 2019
yixinglu pushed a commit to yixinglu/nebula that referenced this pull request Feb 16, 2020
* support time to live

* address dangleptr's comments

* address dangleptr's comment
tong-hao pushed a commit to tong-hao/nebula that referenced this pull request Jun 1, 2021
* support time to live

* address dangleptr's comments

* address dangleptr's comment
yixinglu pushed a commit to yixinglu/nebula that referenced this pull request Mar 21, 2022
stash

add datapath/rootpath in heartbeat && modify list cluster processor

store dir info by address

group snapshot rpc call in one host

fix snapshot parameter bug

fix canocial path bug

decrease lastUpdateTime not found info log level

stats init && options copy

rename ndoe to service

rename create backup fields

first runnable version

rename include system spaces

add balance thrift

resolve

resolve conflicts

fix test

modify tests

remove unrelated lines

remove unralted files

fix create backup test

add some comments & fix list cluster test

only report dir info once

improve code

add agent hb processor test && fix comments

fix copy right and log

add copyright

tidy the create checkpoint rpc

stash

add datapath/rootpath in heartbeat && modify list cluster processor

store dir info by address

group snapshot rpc call in one host

fix snapshot parameter bug

fix canocial path bug

decrease lastUpdateTime not found info log level

stats init && options copy

rename ndoe to service

rename create backup fields

first runnable version

rename include system spaces

add balance thrift

resolve

resolve conflicts

fix test

modify tests

remove unrelated lines

remove unralted files

fix create backup test

add some comments & fix list cluster test

only report dir info once

improve code

add agent hb processor test && fix comments

fix copy right and log

add copyright

Co-authored-by: Sophie <[email protected]>

Co-authored-by: pengwei.song <[email protected]>
Co-authored-by: Sophie <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-testing PR: ready for the CI test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants