-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Conversation
Can one of the admins verify this patch? |
4db4b46
to
c80bb81
Compare
Rebase and please review,thx. |
src/parser/MaintainSentences.cpp
Outdated
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: |
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.
We'd better remove them before discussing what configurations we should support.
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.
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 { |
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.
ditto
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.
👍
src/parser/scanner.lex
Outdated
@@ -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]) |
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.
ditto
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.
👍
src/parser/test/ScannerTest.cpp
Outdated
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), |
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.
ditto
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.
👍
f687d75
to
ecbb77f
Compare
Fix comments and rebase master, please review again, thx. |
propValue_ = std::move(val); | ||
} | ||
|
||
int64_t asInt() { |
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 you don't want to expose the methods to outside, just make them private.
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.
👍,good catch!
src/parser/MaintainSentences.h
Outdated
return boost::get<int64_t>(propValue_); | ||
} | ||
|
||
std::string& asString() { |
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.
Return reference?
src/parser/MaintainSentences.h
Outdated
return propValue_.which() == 2; | ||
} | ||
|
||
int64_t getTtlDuration() { |
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.
StatusOr?
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.
Good point, I will do it.
src/parser/MaintainSentences.h
Outdated
} | ||
} | ||
|
||
std::string getTtlCol() { |
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.
ditto
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.
Good point, I will do it.
Fix comments and rebase master, please review again, thx. |
Jenkins go |
Unit testing passed. |
Rebase master |
Jenkins go |
Unit testing passed. |
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.
Well done.
Unit testing passed. |
return boost::get<std::string>(propValue_); | ||
} | ||
|
||
bool asBool() { |
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.
why need this?
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.
Because the type of some values can be bool type.
return propValue_.which() == 0; | ||
} | ||
|
||
bool isBool() { |
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.
ditto
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.
Because the type of some values can be bool type.
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.
well done
* support time to live * address dangleptr's comments * address dangleptr's comment
* support time to live * address dangleptr's comments * address dangleptr's comment
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]>
As title.