This is an automated email from the ASF dual-hosted git repository.
sk0x50 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
The following commit(s) were added to refs/heads/main by this push:
new f4f505f3ac IGNITE-18792 Added doc for distribution zones phase 1.
Fixes #1708
f4f505f3ac is described below
commit f4f505f3ac23c4e29f84656385ba491e51245ac0
Author: IgGusev <[email protected]>
AuthorDate: Tue Mar 7 11:14:07 2023 +0200
IGNITE-18792 Added doc for distribution zones phase 1. Fixes #1708
Signed-off-by: Slava Koptilin <[email protected]>
---
docs/_data/toc.yaml | 2 +
docs/_docs/sql-reference/ddl.adoc | 18 ++++
docs/_docs/sql-reference/distribution-zones.adoc | 119 +++++++++++++++++++++++
3 files changed, 139 insertions(+)
diff --git a/docs/_data/toc.yaml b/docs/_data/toc.yaml
index 5bd7e9b2cf..2f2dec7c92 100644
--- a/docs/_data/toc.yaml
+++ b/docs/_data/toc.yaml
@@ -41,6 +41,8 @@
url: sql-reference/ddl
- title: Data Manipulation Language (DML)
url: sql-reference/dml
+ - title: Distribution Zones
+ url: sql-reference/distribution-zones
- title: Supported Operators and Functions
url: sql-reference/operators-and-functions
- title: REST
diff --git a/docs/_docs/sql-reference/ddl.adoc
b/docs/_docs/sql-reference/ddl.adoc
index caba17a2df..d7d5d8eacd 100644
--- a/docs/_docs/sql-reference/ddl.adoc
+++ b/docs/_docs/sql-reference/ddl.adoc
@@ -72,6 +72,7 @@ Parameters:
** `Replicas` - sets the number of partition copies, including the master copy.
** `Partitions` - sets the number of table partitions.
+** `PRIMARY_ZONE` - sets the link:distribution-zones[Distriburion Zone].
** Other parameters, depending on the database engine.
@@ -298,6 +299,23 @@ Drop Person table if the one exists:
DROP TABLE IF EXISTS "Person";
----
+== DESCRIBE TABLE
+
+Returns information about the distribution zones of the table.
+
+[.diagram-container]
+Diagram(
+NonTerminal('DESCRIBE TABLE'),
+Optional('IF NOT EXISTS'),
+NonTerminal('qualified_table_name'),
+End({type:'complex'})
+)
+
+Parameters:
+
+- `IF EXISTS` - do not throw an error if a table with the same name does not
exist.
+- `qualified_table_name` - the name of the table. Can be schema-qualified.
+
== CREATE INDEX
Creates a new index.
diff --git a/docs/_docs/sql-reference/distribution-zones.adoc
b/docs/_docs/sql-reference/distribution-zones.adoc
new file mode 100644
index 0000000000..22b0a3262f
--- /dev/null
+++ b/docs/_docs/sql-reference/distribution-zones.adoc
@@ -0,0 +1,119 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+= Distribution Zones
+
+This section describes Apache Ignite 3 distribution zones.
+
+== CREATE ZONE
+
+Creates a new distribution zone.
+
+[source,sql]
+----
+CREATE ZONE [IF NOT EXISTS] qualified_zone_name [;]
+----
+
+Parameters:
+
+
+* `qualified_zone_name` - name of the distribution zone. Can be
schema-qualified.
+* `IF NOT EXISTS` - create a zone only if a different zone with the same name
does not exist.
+//* `WITH` - accepts the following additional parameters:
+//- `DATA_NODES_AUTO_ADJUST` - the delay in seconds between any topology
changes and the start of data zone adjustment.
+//- `DATA_NODES_AUTO_ADJUST_SCALE_UP` - the delay in seconds between the new
node joining and the start of data zone adjustment.
+//- `DATA_NODES_AUTO_ADJUST_SCALE_DOWN` - the delay in seconds between the
node leaving the cluster and the start of data zone adjustment.
+
+Examples:
+
+Creates an `exampleZone` distribution zone:
+
+[source,sql]
+----
+CREATE ZONE IF NOT EXISTS exampleZone
+----
+
+
+//Creates an `exampleZone` distribution zone that will only use nodes with SSD
attribute and adjust 300 seconds after cluster topology changes:
+
+//[source,sql]
+//----
+//CREATE ZONE IF NOT EXISTS exampleZone WITH DATA_NODES_AUTO_ADJUST=300
+//----
+
+
+//== ALTER ZONE
+
+//Modifies an existing distribution zone.
+
+//[source,sql]
+//----
+//ALTER ZONE IF EXISTS { 'qualified_zone_name' }
+// [WITH
+// [
+// ([DATA_NODES_AUTO_ADJUST = adjust_value],
+// [DATA_NODES_AUTO_ADJUST_SCALE_UP = adjust_value],
+// [DATA_NODES_AUTO_ADJUST_SCALE_DOWN = adjust_value],
+// [DATA_NODES_FILTER = filter_name])
+// ]
+// ]
+//[;]
+//----
+
+//Parameters:
+
+//* `qualified_zone_name` - name of the distribution zone. Can be
schema-qualified.
+//* `IF EXISTS` - do not throw an error if a zone with the specified name does
not exist.
+//* `WITH` - accepts the following additional parameters:
+//- `DATA_NODES_AUTO_ADJUST` - the delay in seconds between any topology
changes and the start of data zone adjustment.
+//- `DATA_NODES_AUTO_ADJUST_SCALE_UP` - the delay in seconds between the new
node joining and the start of data zone adjustment.
+//- `DATA_NODES_AUTO_ADJUST_SCALE_DOWN` - the delay in seconds between the
node leaving the cluster and the start of data zone adjustment.
+//- `DATA_NODES_FILTER` - a list of node names or node attributes. Only the
nodes with these attributes are included in the distribution zone.
+
+== ALTER ZONE
+
+Renames a distribution zone.
+
+[source,sql]
+----
+ALTER ZONE IF EXISTS { 'qualified_zone_name' } [RENAME TO
{new_qualified_zone_name}] [;]
+----
+
+Parameters:
+
+* `qualified_zone_name` - name of the distribution zone. Can be
schema-qualified.
+* `IF EXISTS` - do not throw an error if a zone with the specified name does
not exist.
+
+== DROP ZONE
+
+The `DROP ZONE` command drops an existing distribution zone.
+
+----
+DROP ZONE IF EXISTS qualified_zone_name
+----
+
+Parameters:
+
+- `IF EXISTS` - do not throw an error if a zone with the specified name does
not exist.
+- `qualified_zone_name` - the name of the distribution zone. Can be
schema-qualified.
+
+
+Examples:
+
+Drop Person table if the one exists:
+
+[source,sql]
+----
+DROP ZONE IF EXISTS exampleZone
+----