Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 32 additions & 4 deletions docs/_docs/snapshots/snapshots.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ control.(sh|bat) --snapshot restore snapshot_02092020 --start --groups snapshot-
--

==== Using CLI to control restore operation
The `control.sh|bat` script provides the ability to start, stop, and get the status of the restore operation.
The `control.sh|bat` script provides the ability to start and stop the restore operation.

[source,shell]
----
Expand All @@ -234,13 +234,41 @@ control.(sh|bat) --snapshot restore snapshot_09062021 --src /tmp/ignite/snapshot
# Start restoring only "cache-group1" and "cache-group2" from the snapshot "snapshot_09062021" in the background.
control.(sh|bat) --snapshot restore snapshot_09062021 --start --groups cache-group1,cache-group2

# Get the status of the restore operation for "snapshot_09062021".
control.(sh|bat) --snapshot restore snapshot_09062021 --status

# Cancel the restore operation for "snapshot_09062021".
control.(sh|bat) --snapshot restore snapshot_09062021 --cancel
----

== Getting Snapshot Operation Status

The status of the current snapshot operation in the cluster can be obtained using the `control.sh|bat` script or JMX interface:

[tabs]
--
tab:Unix[]
[source,shell]
----
# Get the status of the snapshot operation.
control.sh --snapshot status
----

tab:Windows[]
[source,shell]
----
# Get the status of the snapshot operation.
control.bat --snapshot status
----

tab:JMX[]
You can also get the current snapshot status via the `SnapshotMXBean` interface:
[source,java]
----
SnapshotMXBean mxBean = ...;

// The status of a current snapshot operation in the cluster.
String status = mxBean.status();
----
--

== Consistency Guarantees

All snapshots are fully consistent in terms of concurrent cluster-wide operations as well as ongoing changes with Ignite.
Expand Down
16 changes: 15 additions & 1 deletion modules/calcite/src/main/codegen/config.fmpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ data: {
"org.apache.ignite.lang.IgniteUuid",
"org.apache.calcite.sql.ddl.SqlDdlNodes",
"org.apache.ignite.internal.processors.query.calcite.sql.*",
"org.apache.ignite.internal.processors.query.calcite.sql.stat.*",
]

# List of new keywords. Example: "DATABASES", "TABLES". If the keyword is
Expand Down Expand Up @@ -66,7 +67,12 @@ data: {
"SERVICE"
"COMPUTE"
"ASYNC"
"QUERY"
"QUERY",
"STATISTICS",
"REFRESH",
"ANALYZE",
"MAX_CHANGED_PARTITION_ROWS_PERCENT",
"TOTAL"
]

# List of non-reserved keywords to add;
Expand Down Expand Up @@ -96,6 +102,11 @@ data: {
"COMPUTE"
"ASYNC"
"QUERY"
"STATISTICS",
"REFRESH",
"ANALYZE",
"MAX_CHANGED_PARTITION_ROWS_PERCENT",
"TOTAL",

# The following keywords are reserved in core Calcite,
# are reserved in some version of SQL,
Expand Down Expand Up @@ -621,6 +632,9 @@ data: {
"SqlKillQuery()",
"SqlCommitTransaction()",
"SqlRollbackTransaction()"
"SqlStatisticsAnalyze()"
"SqlStatisticsRefresh()"
"SqlStatisticsDrop()"
]

# List of methods for parsing extensions to "CREATE [OR REPLACE]" calls.
Expand Down
141 changes: 139 additions & 2 deletions modules/calcite/src/main/codegen/includes/parserImpls.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ SqlNodeList WithCreateTableOptionList() :
(
<QUOTED_IDENTIFIER>
{
return IgniteSqlCreateTable.parseOptionList(
return IgniteSqlCreateTableOption.parseOptionList(
SqlParserUtil.stripQuotes(token.image, DQ, DQ, DQDQ, quotedCasing),
getPos().withQuoting(true)
);
Expand Down Expand Up @@ -584,7 +584,7 @@ SqlNode SqlKillQuery():
}
{
<KILL> { s = span(); } <QUERY>
isAsync= IsAsyncOpt()
isAsync = IsAsyncOpt()
<QUOTED_STRING> {
String rawQueryId = SqlParserUtil.parseString(token.image);
SqlCharStringLiteral queryIdLiteral = SqlLiteral.createCharString(rawQueryId, getPos());
Expand Down Expand Up @@ -615,3 +615,140 @@ SqlNode SqlRollbackTransaction():
return new IgniteSqlRollback(s.end(this));
}
}

IgniteSqlStatisticsTable StatisticsTable():
{
final Span s = Span.of();
final SqlIdentifier id;
final SqlNodeList columnList;
}
{
id = CompoundIdentifier()
(
columnList = ParenthesizedSimpleIdentifierList()
|
{ columnList = null; }
)
{
return new IgniteSqlStatisticsTable(id, columnList, s.end(this));
}
}

SqlNodeList StatisticsTables():
{
final Span s = Span.of();
List<SqlNode> tbls = new ArrayList<SqlNode>();
SqlNode tbl;
}
{
tbl = StatisticsTable() { tbls.add(tbl); }
(
<COMMA> tbl = StatisticsTable() { tbls.add(tbl); }
)*
{
return new SqlNodeList(tbls, s.end(this));
}
}

SqlNodeList WithStatisticsAnalyzeOptionList() :
{
List<SqlNode> list = new ArrayList<SqlNode>();
final Span s;
}
{
[
<WITH> { s = span(); }
(
StatisticsAnalyzeOption(list)
(
<COMMA> { s.add(this); } StatisticsAnalyzeOption(list)
)*
{
return new SqlNodeList(list, s.end(this));
}
|
<QUOTED_IDENTIFIER>
{
return IgniteSqlStatisticsAnalyzeOption.parseOptionList(
SqlParserUtil.stripQuotes(token.image, DQ, DQ, DQDQ, quotedCasing),
getPos().withQuoting(true)
);
}
)
]
{ return null; }
}

SqlLiteral StatisticsAnalyzeOptionKey() :
{
}
{
<DISTINCT> { return SqlLiteral.createSymbol(IgniteSqlStatisticsAnalyzeOptionEnum.DISTINCT, getPos()); }
|
<TOTAL> { return SqlLiteral.createSymbol(IgniteSqlStatisticsAnalyzeOptionEnum.TOTAL, getPos()); }
|
<SIZE> { return SqlLiteral.createSymbol(IgniteSqlStatisticsAnalyzeOptionEnum.SIZE, getPos()); }
|
<NULLS> { return SqlLiteral.createSymbol(IgniteSqlStatisticsAnalyzeOptionEnum.NULLS, getPos()); }
|
<MAX_CHANGED_PARTITION_ROWS_PERCENT> { return SqlLiteral.createSymbol(IgniteSqlStatisticsAnalyzeOptionEnum.MAX_CHANGED_PARTITION_ROWS_PERCENT, getPos()); }
}

void StatisticsAnalyzeOption(List<SqlNode> list) :
{
final Span s;
final SqlLiteral key;
final SqlNode val;
}
{
key = StatisticsAnalyzeOptionKey() { s = span(); }
<EQ>
(
val = Literal()
|
val = SimpleIdentifier()
) {
list.add(new IgniteSqlStatisticsAnalyzeOption(key, val, s.end(this)));
}
}

SqlNode SqlStatisticsDrop():
{
final Span s;
SqlNodeList tablesList;
}
{
<DROP> <STATISTICS> { s = span(); }
tablesList = StatisticsTables()
{
return new IgniteSqlStatisticsDrop(tablesList, s.end(this));
}
}

SqlNode SqlStatisticsRefresh():
{
final Span s;
SqlNodeList tablesList;
}
{
<REFRESH> <STATISTICS> { s = span(); }
tablesList = StatisticsTables()
{
return new IgniteSqlStatisticsRefresh(tablesList, s.end(this));
}
}

SqlNode SqlStatisticsAnalyze():
{
final Span s;
SqlNodeList tablesList;
SqlNodeList optionsList;
}
{
<ANALYZE> { s = span(); }
tablesList = StatisticsTables()
optionsList = WithStatisticsAnalyzeOptionList()
{
return new IgniteSqlStatisticsAnalyze(tablesList, optionsList, s.end(this));
}
}
Loading